From: Jeff Johnston <jjohnstn@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA]: Fix for pending breakpoints in manually loaded/unloaded shlibs
Date: Wed, 11 Aug 2004 15:58:00 -0000 [thread overview]
Message-ID: <411A4209.6020801@redhat.com> (raw)
In-Reply-To: <7494-Wed11Aug2004070352+0300-eliz@gnu.org>
Eli Zaretskii wrote:
>>Date: Tue, 10 Aug 2004 15:09:37 -0400
>>From: Jeff Johnston <jjohnstn@redhat.com>
>>
>>To fix this, I have added an observer for a new event: solib_unloaded. When
>>update_solib_list discovers a shared library has been unloaded, it notifies all
>>observers (initially this is just breakpoint.c). Breakpoint.c sets up an
>>observer to find all breakpoints in the removed shlib and mark them as
>>non-inserted and bp_shlib_disabled. This solves the problem.
>
>
> Could you please explain why this complicated mechanism is needed to
> fix this problem? Why cannot GDB directly mark the breakpoints when
> the library is unloaded, instead of going the observer path?
>
Kind of damned if I do, damned if I don't :) I had talked over the problem with
Andrew and he suggested the observer path as this is an event that other parts
of gdb would be interested in knowing about. IMHO, the mechanism is rather
elegant, extensible, and simple to use.
Do you feel that this event isn't worthy of observation?
-- Jeff J.
>
>>Index: doc/observer.texi
>>===================================================================
>>RCS file: /cvs/src/src/gdb/doc/observer.texi,v
>>retrieving revision 1.7
>>diff -u -p -r1.7 observer.texi
>>--- doc/observer.texi 21 May 2004 16:04:03 -0000 1.7
>>+++ doc/observer.texi 10 Aug 2004 18:47:47 -0000
>>@@ -90,3 +90,8 @@ at the entry-point instruction. For @sa
>> @value{GDBN} calls this observer immediately after connecting to the
>> inferior, and before any information on the inferior has been printed.
>> @end deftypefun
>>+
>>+@deftypefun void solib_unloaded (struct so_list *@var{solib})
>>+The specified shared library has been discovered to be unloaded.
>>+@end deftypefun
>>+
>
>
> This part is approved (provided that the rest of the patch is
> aproved).
>
>
>>+/* Disable any breakpoints that are in in an unloaded shared library. Only
>
> ^^^^^
> A typo.
>
>
>>+void
>>+disable_breakpoints_in_unloaded_shlib (struct so_list *solib)
>>+{
>>+ struct breakpoint *b;
>>+ int disabled_shlib_breaks = 0;
>>+
>>+ /* See also: insert_breakpoints, under DISABLE_UNSETTABLE_BREAK. */
>>+ ALL_BREAKPOINTS (b)
>>+ {
>>+#if defined (PC_SOLIB)
>
>
> I think this #ifdef should be outside the loop: why loop at all if we
> do nothing inside the loop body?
>
next prev parent reply other threads:[~2004-08-11 15:58 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-10 19:09 Jeff Johnston
2004-08-10 19:45 ` Kevin Buettner
2004-08-11 4:07 ` Eli Zaretskii
2004-08-11 15:58 ` Jeff Johnston [this message]
2004-08-11 16:58 ` Andrew Cagney
2004-08-11 17:59 ` Eli Zaretskii
2004-08-11 20:42 ` Andrew Cagney
2004-08-11 20:47 ` Daniel Jacobowitz
2004-08-11 22:19 ` Andrew Cagney
2004-08-12 12:58 ` Daniel Jacobowitz
2004-08-12 13:16 ` New observer objfile_mapped; was Andrew Cagney
2004-08-12 13:18 ` Daniel Jacobowitz
2004-08-12 3:45 ` [RFA]: Fix for pending breakpoints in manually loaded/unloaded shlibs Eli Zaretskii
2004-08-12 12:10 ` Andrew Cagney
2004-08-12 18:49 ` Eli Zaretskii
2004-08-12 20:44 ` Andrew Cagney
2004-08-14 11:50 ` Eli Zaretskii
2004-08-18 13:45 ` Daniel Jacobowitz
2004-08-19 3:57 ` Eli Zaretskii
2004-08-11 8:09 ` Michael Chastain
2004-08-11 15:42 ` Jeff Johnston
2004-08-12 13:05 ` Michael Chastain
2004-08-12 13:33 ` Michael Chastain
2004-08-12 17:47 ` Jeff Johnston
2004-08-12 18:59 ` Michael Chastain
2004-08-12 20:23 ` Jeff Johnston
2004-08-11 17:12 ` Daniel Jacobowitz
2004-08-11 20:12 ` Jeff Johnston
2004-08-18 13:56 ` Daniel Jacobowitz
2004-08-18 19:22 ` Jeff Johnston
2004-08-18 19:39 ` Daniel Jacobowitz
2004-08-18 20:03 ` Jeff Johnston
2004-08-19 4:01 ` Eli Zaretskii
2004-09-01 15:15 ` Andrew Cagney
2004-09-01 18:01 ` Jeff Johnston
2004-09-01 19:30 ` Michael Chastain
2004-09-01 20:44 ` Jeff Johnston
2004-09-01 20:59 ` Michael Chastain
2004-09-01 23:27 ` Jeff Johnston
2004-09-02 3:54 ` Eli Zaretskii
2004-08-23 21:33 ` Jeff Johnston
2004-08-23 22:09 ` Michael Chastain
2004-08-23 22:35 ` Jeff Johnston
2004-08-24 2:26 ` Michael Chastain
2004-08-24 15:51 ` Jeff Johnston
2004-08-24 16:04 ` Michael Chastain
2004-08-12 2:48 ` Andrew Cagney
2004-08-12 3:54 ` 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=411A4209.6020801@redhat.com \
--to=jjohnstn@redhat.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sources.redhat.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