Hi all, I was looking through --pid and attach mingw PRs in the GNATS, and noticed an annoying issue. If one specifies an explicit PID to attach to, failing to attach, gdb will try to open a core file of the same name. The attach fail -> open core is there to support invoking gdb as: gdb program pid or: gdb program core Since, if the user specifies gdb program 3333, gdb can't know if 3333 is a pid or a core file named "3333". So for, so good. Now, If the user specifies, gdb program --pid=3333, gdb has no business trying to look for a core file named 3333. The patch avoids these confusing messages [1] when the user specifies an invalid or non-existing pid: Before: >./gdb --pid=3333 Attaching to process 3333 ptrace: No such process. /home/pedro/gdb/build/3333: No such file or directory. <==== [1] (gdb) After: >./gdb --pid=3333 Attaching to process 3333 ptrace: No such process. (gdb) The patch also catches invalid simultaneous --pid,--core uses, And these weirdnesses: Before: >gdb/gdb gdb/gdb --pid=3333 4444 5555 Excess command line arguments ignored. (5555) Attaching to program: /home/pedro/gdb/build/gdb/gdb, process 4444 ptrace: No such process. /home/pedro/gdb/build/4444: No such file or directory. After: >gdb/gdb gdb/gdb --pid=3333 4444 5555 Excess command line arguments ignored. (4444 ...) Attaching to program: /home/pedro/gdb/build/gdb/gdb, process 3333 ptrace: No such process. Tested on i686-pc-linux-gnu, no regressions. OK ?