Report GetLastError value when DebugActiveProcess fails
authorTom Tromey <tromey@adacore.com>
Wed, 6 Nov 2019 16:43:52 +0000 (09:43 -0700)
committerTom Tromey <tromey@adacore.com>
Tue, 19 Nov 2019 15:33:53 +0000 (08:33 -0700)
commitc9739b6a06730b65df135766dec4c4d14d78bd38
tree4478c8ad91c52568cebdd3eb1abba57b19b20d28
parentf2032b672ac5f0c570f3a6d263ce6b764e7dca93
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
gdb/ChangeLog
gdb/windows-nat.c