Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Christopher Faylor <cgf@gnu.org>
To: gdb-patches@sourceware.org
Subject: [commit] Ignore SEGVs from win32 IsBad* functions
Date: Sun, 27 Mar 2005 05:21:00 -0000	[thread overview]
Message-ID: <20050327052052.GA23610@coe.casa.cgf.cx> (raw)

There have been a number of complaints in the cygwin lists about
gdb's behavior with the win32 IsBad*Ptr calls.

This patch causes gdb to ignore notification of SEGV from within
those calls.

cgf

2005-03-27  Christopher Faylor  <cgf@timesys.com>

        * win32-nat.c (handle_exception): Treat win32 routines which check for
        valid addresses as "special" and don't stop when a SEGV is detected.
        (get_child_debug_event): Properly flag exception as unhandled.

Index: win32-nat.c
===================================================================
RCS file: /cvs/uberbaum/gdb/win32-nat.c,v
retrieving revision 1.109
diff -u -p -r1.109 win32-nat.c
--- win32-nat.c	21 Mar 2005 19:54:15 -0000	1.109
+++ win32-nat.c	27 Mar 2005 05:17:45 -0000
@@ -1077,6 +1077,14 @@ handle_exception (struct target_waitstat
     case EXCEPTION_ACCESS_VIOLATION:
       DEBUG_EXCEPTION_SIMPLE ("EXCEPTION_ACCESS_VIOLATION");
       ourstatus->value.sig = TARGET_SIGNAL_SEGV;
+      {
+	char *fn;
+	if (find_pc_partial_function ((CORE_ADDR) current_event.u.Exception
+				      .ExceptionRecord.ExceptionAddress,
+				      &fn, NULL, NULL)
+	    && strncmp (fn, "KERNEL32!IsBad", strlen ("KERNEL32!IsBad")) == 0)
+	  return 0;
+      }
       break;
     case STATUS_STACK_OVERFLOW:
       DEBUG_EXCEPTION_SIMPLE ("STATUS_STACK_OVERFLOW");
@@ -1360,6 +1368,8 @@ get_child_debug_event (int pid, struct t
 	break;
       if (handle_exception (ourstatus))
 	retval = current_event.dwThreadId;
+      else
+	continue_status = DBG_EXCEPTION_NOT_HANDLED;
       break;
 
     case OUTPUT_DEBUG_STRING_EVENT:	/* message from the kernel */


             reply	other threads:[~2005-03-27  5:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-27  5:21 Christopher Faylor [this message]
2005-03-27 10:56 ` Eli Zaretskii
2005-03-27 15:42   ` Daniel Jacobowitz
2005-03-27 19:31     ` Eli Zaretskii

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=20050327052052.GA23610@coe.casa.cgf.cx \
    --to=cgf@gnu.org \
    --cc=gdb-patches@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