summaryrefslogtreecommitdiff
path: root/gdb/remote-vx.c
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>1994-08-24 20:22:25 +0000
committerStan Shebs <shebs@codesourcery.com>1994-08-24 20:22:25 +0000
commit3d19ff2b13614924624b45a044aa6e31b88012ae (patch)
tree599e9ff34e7656e83d29eea2e06bbbbf80c30871 /gdb/remote-vx.c
parent2c5d4a3443c9b9323ad4bcbe0e38e523181bd419 (diff)
downloadbinutils-gdb-3d19ff2b13614924624b45a044aa6e31b88012ae.tar.gz
* remote-vx.c (vx_attach): Interpret the command argument as an
unsigned long.
Diffstat (limited to 'gdb/remote-vx.c')
-rw-r--r--gdb/remote-vx.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gdb/remote-vx.c b/gdb/remote-vx.c
index 5c1aeaaf0fa..15ca4aeb70d 100644
--- a/gdb/remote-vx.c
+++ b/gdb/remote-vx.c
@@ -1094,7 +1094,7 @@ vx_attach (args, from_tty)
char *args;
int from_tty;
{
- int pid;
+ unsigned long pid;
char *cptr = 0;
Rptrace ptrace_in;
Ptrace_return ptrace_out;
@@ -1103,13 +1103,13 @@ vx_attach (args, from_tty)
if (!args)
error_no_arg ("process-id to attach");
- pid = strtol (args, &cptr, 0);
+ pid = strtoul (args, &cptr, 0);
if ((cptr == args) || (*cptr != '\0'))
error ("Invalid process-id -- give a single number in decimal or 0xhex");
if (from_tty)
- printf_unfiltered ("Attaching pid %s.\n",
- local_hex_string((unsigned long) pid));
+ printf_unfiltered ("Attaching pid %s.\n",
+ local_hex_string((unsigned long) pid));
memset ((char *)&ptrace_in, '\0', sizeof (ptrace_in));
memset ((char *)&ptrace_out, '\0', sizeof (ptrace_out));
@@ -1126,6 +1126,9 @@ vx_attach (args, from_tty)
/* It worked... */
push_target (&vx_run_ops);
+ /* The unsigned long pid will get turned into a signed int here,
+ but it doesn't seem to matter. inferior_pid must be signed
+ in order for other parts of GDB to work correctly. */
inferior_pid = pid;
vx_running = 0;
}