diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-02-15 17:35:50 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-02-15 17:35:50 +0000 |
commit | 74164c5624c276e97cf9cb01876ef908745cd185 (patch) | |
tree | 8c1a196ff9b052b0f8adda3aa6b0d4b045d0aada /gdb/darwin-nat.c | |
parent | 01a8201190286f181bea5731495123ea465c6251 (diff) | |
download | gdb-74164c5624c276e97cf9cb01876ef908745cd185.zip gdb-74164c5624c276e97cf9cb01876ef908745cd185.tar.gz gdb-74164c5624c276e97cf9cb01876ef908745cd185.tar.bz2 |
gdb/
* defs.h (parse_pid_to_attach): New.
* utils.c (parse_pid_to_attach): New.
* darwin-nat.c (darwin_attach): Replace ARGS parsing by parse_pid.
* gnu-nat.c (gnu_attach): Likewise.
* nto-procfs.c (procfs_attach): Likewise.
* procfs.c (procfs_attach): Likewise.
* windows-nat.c (windows_attach): Likewise.
* inf-ptrace.c (inf_ptrace_attach): Likewise. Remove variable dummy.
* inf-ttrace.c (inf_ttrace_attach): Likewise.
* remote.c (extended_remote_attach_1): Likewise. New comment on getpid
check.
gdb/testsuite/
* gdb.base/attach.exp (attach to nonsense is prohibited): Make the
"Illegal process-id" expect string more exact.
(attach to digits-starting nonsense is prohibited): New.
Diffstat (limited to 'gdb/darwin-nat.c')
-rw-r--r-- | gdb/darwin-nat.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c index 535720d..40b9f3f 100644 --- a/gdb/darwin-nat.c +++ b/gdb/darwin-nat.c @@ -1514,12 +1514,9 @@ darwin_attach (struct target_ops *ops, char *args, int from_tty) struct inferior *inf; kern_return_t kret; - if (!args) - error_no_arg (_("process-id to attach")); + pid = parse_pid_to_attach (args); - pid = atoi (args); - - if (pid == getpid ()) /* Trying to masturbate? */ + if (pid == getpid ()) /* Trying to masturbate? */ error (_("I refuse to debug myself!")); if (from_tty) |