mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-06 12:09:26 +08:00
Report GetLastError value when DebugActiveProcess fails
When DebugActiveProcess fails, the error message is fairly generic: error (_("Can't attach to process.")); It would be more useful for diagnosing problems if the Windows error code was included in the message. This patch implements this. gdb/ChangeLog 2019-11-19 Tom Tromey <tromey@adacore.com> * windows-nat.c (windows_nat_target::attach): Include GetLastError result in error when DebugActiveProcess fails. Change-Id: Ie1bf502a0d96bb7c09bd5b1c5e0c924ba58cd68c
This commit is contained in:
parent
f2032b672a
commit
c9739b6a06
@ -1,3 +1,8 @@
|
||||
2019-11-19 Tom Tromey <tromey@adacore.com>
|
||||
|
||||
* windows-nat.c (windows_nat_target::attach): Include GetLastError
|
||||
result in error when DebugActiveProcess fails.
|
||||
|
||||
2019-11-18 Sergio Durigan Junior <sergiodj@redhat.com>
|
||||
Pedro Alves <palves@redhat.com>
|
||||
|
||||
|
@ -1983,7 +1983,8 @@ windows_nat_target::attach (const char *args, int from_tty)
|
||||
#endif
|
||||
|
||||
if (!ok)
|
||||
error (_("Can't attach to process."));
|
||||
error (_("Can't attach to process %u (error %u)"),
|
||||
(unsigned) pid, (unsigned) GetLastError ());
|
||||
|
||||
DebugSetProcessKillOnExit (FALSE);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user