public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] Report GetLastError value when DebugActiveProcess fails
Date: Tue, 19 Nov 2019 16:22:00 -0000	[thread overview]
Message-ID: <c9739b6a06730b65df135766dec4c4d14d78bd38@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT c9739b6a06730b65df135766dec4c4d14d78bd38 ***

commit c9739b6a06730b65df135766dec4c4d14d78bd38
Author:     Tom Tromey <tromey@adacore.com>
AuthorDate: Wed Nov 6 09:43:52 2019 -0700
Commit:     Tom Tromey <tromey@adacore.com>
CommitDate: Tue Nov 19 08:33:53 2019 -0700

    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

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 80ec8f3522..0305d67bd6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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>
 
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 5901f63b28..fdc21f38bf 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -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);
 


             reply	other threads:[~2019-11-19 16:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-19 16:22 gdb-buildbot [this message]
2019-11-19 16:22 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, branch master gdb-buildbot
2019-11-27  9:57 ` Failures on Fedora-i686, " gdb-buildbot
2019-11-27 10:10 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2019-11-27 10:13 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2019-11-27 10:44 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c9739b6a06730b65df135766dec4c4d14d78bd38@gdb-build \
    --to=gdb-buildbot@sergiodj.net \
    --cc=gdb-testers@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).