public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: <gdb-patches@sourceware.org>
Subject: RE: [RFC] breakpoint.c:  Fix nasty problem with msvcrt DLL on Windows
Date: Thu, 05 Aug 2010 12:12:00 -0000	[thread overview]
Message-ID: <003601cb3497$8ac36b80$a04a4280$@muller@ics-cnrs.unistra.fr> (raw)
In-Reply-To: <002a01cb3492$5ba5c050$12f140f0$@muller@ics-cnrs.unistra.fr>


  Just one short follow-up:
I ran the testsuite with my patch on a x86_64 machine
and got two regressions:

First:
< PASS: gdb.base/attach.exp: attach1 detach
---
> FAIL: gdb.base/attach.exp: attach1 detach
Detaching from program:
/home/muller/auto-test-gdb/build/gdb/testsuite/gdb.base/
attach, process 16517^M
warning: Temporarily disabling breakpoints for unloaded shared library
"/lib/lib
c.so.6"^M
(gdb) FAIL: gdb.base/attach.exp: attach1 detach

The failure comes from the new warning introduced by my patch.

Second:
< PASS: gdb.server/ext-attach.exp: detach
---
> FAIL: gdb.server/ext-attach.exp: detach
Same reason.

With the updated patch below these two regressions disappear.

Pierre


2010-08-05  Pierre Muller  <muller@ics.u-strasbg.fr>

	* breakpoint.c (set_longjmp_breakpoint): Only insert breakpoints
	if the dynamic library was not unloaded.
	(disable_breakpoints_in_unloaded_shlib): Disable also 'longjmp'
	breakpoints.

Index: src/gdb/breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.506
diff -u -p -r1.506 breakpoint.c
--- src/gdb/breakpoint.c	3 Aug 2010 22:35:41 -0000	1.506
+++ src/gdb/breakpoint.c	5 Aug 2010 10:03:14 -0000
@@ -5573,10 +5573,12 @@ set_longjmp_breakpoint (int thread)
   /* To avoid having to rescan all objfile symbols at every step,
      we maintain a list of continually-inserted but always disabled
      longjmp "master" breakpoints.  Here, we simply create momentary
-     clones of those and enable them for the requested thread.  */
+     clones of those and enable them for the requested thread.
+     Do not try to insert 'longjmp' breakpoints of unloaded libraries.  */
   ALL_BREAKPOINTS_SAFE (b, temp)
     if (b->pspace == current_program_space
-	&& b->type == bp_longjmp_master)
+	&& b->type == bp_longjmp_master
+        && b->loc && !b->loc->shlib_disabled)
       {
 	struct breakpoint *clone = clone_momentary_breakpoint (b);
 
@@ -5801,7 +5805,8 @@ disable_breakpoints_in_unloaded_shlib (s
 	   succeeding so we must mark the breakpoint as not inserted
 	   to prevent future errors occurring in remove_breakpoints.  */
 	loc->inserted = 0;
-	if (!disabled_shlib_breaks)
+	if (!disabled_shlib_breaks && b->type != bp_longjmp_master
+	    && b->type != bp_longjmp)
 	  {
 	    target_terminal_ours_for_output ();
 	    warning (_("Temporarily disabling breakpoints for unloaded
shared library \"%s\""),

  reply	other threads:[~2010-08-05 12:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-05 11:35 Pierre Muller
2010-08-05 12:12 ` Pierre Muller [this message]
2010-08-12 15:42 ` Pedro Alves
2010-08-13  8:47   ` Pierre Muller
2010-08-13 11:15     ` Pedro Alves
2010-08-13 13:50       ` Pierre Muller
2010-09-17 19:56         ` [PING][RFC] " Pierre Muller

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='003601cb3497$8ac36b80$a04a4280$@muller@ics-cnrs.unistra.fr' \
    --to=pierre.muller@ics-cnrs.unistra.fr \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).