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: [RFA] Don't reset watchpoint block on solib load.


Vladimir Prus <vladimir at codesourcery.com> writes:
> On Thursday 29 November 2007 07:24:36 Eli Zaretskii wrote:
>> > Cc: gdb-patches@sources.redhat.com
>> > From: Jim Blandy <jimb@codesourcery.com>
>> > Date: Wed, 28 Nov 2007 14:18:06 -0800
>> > 
>> > Now, if I later unload libx.so, the watchpoint should delete itself
>> > with an appropriate message, just as a watchpoint on a stack variable
>> > does when its frame is popped --- when a shared library is unloaded,
>> > that ends the lifetimes of the variables it defines, just as exiting a
>> > block ends the lifetimes of the variables defined in the block.
>> 
>> Actually, a more useful behavior would be to disable the watchpoint in
>> this case, and reenable it (and, possibly, re-parse the expression) if
>> the library gets loaded again.
>
> This is probably good behaviour, indeed. Or maybe we should not
> disable watchpoint, but mark it as pending, in the same sense of
> "user wanted it to be enabled, but it won't trigger until a shared
> lib is loaded" that is used for ordinary watchpoints.

I think so, too.  I guess the key observation is that, while it's not
meaningful to talk about a particular local variable "coming back
alive", since each function call creates a distinct set of local
variables, and you can have recursion, etc., it is meaningful to talk
about a shared library being reloaded, and it's intuitive to identify
the 'X' from the first loading with the 'X' in the second loading,
even if they're at different addresses.


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