From: Tom Tromey <tromey@redhat.com>
To: "Ulrich Weigand" <uweigand@de.ibm.com>
Cc: gdb-patches@sourceware.org, Jan Kratochvil <jkratoch@redhat.com>
Subject: Re: [rfc] Infrastructure to disable breakpoints during inferior startup
Date: Wed, 22 Jul 2009 20:32:00 -0000 [thread overview]
Message-ID: <m3prbscz9w.fsf@fleche.redhat.com> (raw)
In-Reply-To: <200907221701.n6MH1l1C001297@d12av02.megacenter.de.ibm.com> (Ulrich Weigand's message of "Wed\, 22 Jul 2009 19\:01\:47 +0200 \(CEST\)")
>>>>> "Ulrich" == Ulrich Weigand <uweigand@de.ibm.com> writes:
Ulrich> The following patch attempts to address this by temporarily
Ulrich> disabling all user-installed breakpoints during the inferior
Ulrich> startup phase, using a mechanism similar to
Ulrich> disable_watchpoints_before_interactive_call_start.
FWIW, I took a look at the PIE patch from the Fedora SRPM. It has
almost identical functions disable_breakpoints_before_startup and
re_enable_breakpoints_at_startup.
There are some differences, but I don't know whether they are relevant
or not.
The Fedora disable_breakpoints_before_startup has a check like this:
+ if (((b->type == bp_breakpoint) ||
+ (b->type == bp_hardware_breakpoint)) &&
+ b->enable_state == bp_enabled &&
+ !b->loc->duplicate)
This differs from yours because it checks `loc->duplicate'.
The Fedora re_enable_breakpoints_at_startup does this:
+ /* Do not reenable the breakpoint if the shared library
+ is still not mapped in. */
+ if (target_read_memory (b->loc->address, buf, 1) == 0)
+ {
+ /*printf ("enabling breakpoint at 0x%s\n", paddr_nz(b->loc->address));*/
+ b->enable_state = bp_enabled;
+ }
I have no idea about this either. Perhaps it is something specific to
PIE on Linux.
Maybe Jan can follow up when he gets back.
Ulrich> +/* Are we executing startup code? */
Ulrich> +static int executing_startup;
This seems like it should be a field in struct inferior.
I seem to say that a lot :-). I don't actually know .. should we be
doing this sort of thing now, or are we waiting for Pedro's
multi-inferior patches to land first?
Ulrich> + bp_startup_disabled,/* The eventpoint has been disabled during inferior
I think a new bp_ constant probably needs an entry in the array in
print_one_breakpoint_location. Otherwise if something funny happens,
and we try to print one, gdb will get an internal error.
Tom
next prev parent reply other threads:[~2009-07-22 20:15 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-22 17:14 Ulrich Weigand
2009-07-22 20:32 ` Tom Tromey [this message]
2009-07-23 15:49 ` Ulrich Weigand
2009-07-23 16:51 ` Tom Tromey
2009-07-23 18:06 ` Ulrich Weigand
2009-07-23 18:57 ` Pedro Alves
2009-07-24 22:49 ` Tom Tromey
2009-07-24 23:32 ` Multi-exec patches (Was: [rfc] Infrastructure to disable breakpoints during inferior startup) Tom Tromey
2009-07-25 16:05 ` Pedro Alves
2009-07-25 19:31 ` Pedro Alves
2009-07-27 17:39 ` Multi-exec patches Tom Tromey
2009-07-27 18:45 ` Tom Tromey
2009-07-28 14:28 ` Pedro Alves
2009-07-29 22:03 ` Tom Tromey
2009-07-31 15:45 ` [rfc] Infrastructure to disable breakpoints during inferior startup Ulrich Weigand
2009-08-03 3:07 ` Thiago Jung Bauermann
2009-08-03 18:13 ` Eli Zaretskii
2009-08-05 18:14 ` Ulrich Weigand
2009-08-05 18:58 ` Eli Zaretskii
2009-08-06 17:46 ` Tom Tromey
2009-08-06 18:42 ` Eli Zaretskii
2009-08-06 19:12 ` Michael Snyder
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=m3prbscz9w.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=jkratoch@redhat.com \
--cc=uweigand@de.ibm.com \
/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