This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix a crash when displaying variables from shared library.


On Mon, Mar 09, 2009 at 04:24:48PM -0700, Paul Pluzhnikov wrote:
> It looks to me that this works purely by accident, and so I ask
> again: shouldn't all types of breakpoints, and not just
> bp_breakpoint and bp_hardware_breakpoint, be shlib_disabled in
> disable_breakpoints_in_shlibs?

Disabling a shlib_event breakpoint is pretty weird - there won't be an
event to restore it, so unless we're restarting the program it won't
be enabled again ever.  If we're disabling a step-return or finish
breakpoint, we'll lose control of the inferior.  And so forth...

> I went ahead and did this:
> 
> diff -u -p -u -r1.382 breakpoint.c
> --- breakpoint.c        6 Mar 2009 18:51:05 -0000       1.382
> +++ breakpoint.c        9 Mar 2009 22:55:02 -0000
> @@ -4434,8 +4434,7 @@ disable_breakpoints_in_shlibs (void)
>         becomes enabled, or the duplicate is removed, gdb will try to insert
>         all breakpoints.  If we don't set shlib_disabled here, we'll try
>         to insert those breakpoints and fail.  */
> -    if (((b->type == bp_breakpoint) || (b->type == bp_hardware_breakpoint))
> -       && !loc->shlib_disabled
> +    if (!loc->shlib_disabled
>  #ifdef PC_SOLIB
>         && PC_SOLIB (loc->address)
>  #else
> 
> And that did not produce any new failures on Linux/x86_64.

It needs at least breakpoint_address_is_meaningful.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]