Don't try to attach to gdb itself in `attachp` (#2445)

gdb doesn't allow debugging itself:

```
attachp some-nonexistent-process-name
Attaching to 361478
Error: I refuse to debug myself!
```

This fixes the test_attachp_command_nonexistent_procname test for me.
pull/2447/head
peace-maker 1 year ago committed by GitHub
parent 6892a09c5a
commit 15a6927248
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -100,6 +100,10 @@ def find_pids(target, user, all):
pid, args = process_info
cmd = args.split(maxsplit=1)[0]
# Cannot attach to gdb itself.
if int(pid) == os.getpid():
continue
if target == cmd:
pids_exact_match_cmd.append(pid)
elif target in cmd:

Loading…
Cancel
Save