This is the mail archive of the gdb@sources.redhat.com 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: question about conditional breaking


On Sep 20, 12:36am, Peter Jay Salzman wrote:

> so it appears that here's the rule:
> 
> you're allowed to use any function, even library functions, provided that:
> 
> 1. the library is linked to your application
> 2. you actually _use_ the function somewhere in your code.
> 
> to be honest, i'm not the least surprised by condition 1, but i'm
> shocked by condition 2.

Is the library in question a shared library?

I'm not all that surprised by condition 2 if you attempt to set these
conditional breakpoints prior to running gdb (and thus loading the
shared library).  

For library functions which are used by your application, you're able
to find them prior to loading the shared library due to the fact that
these symbols have PLT entries.  Once the shared library has been
loaded, you should be able to find other library functions too.

Something to try: Put a breakpoint on main and run the program. 
Once the breakpoint has been hit, try adding your conditional
breakpoints.  My guess is that you'll be able to add those that
you couldn't previously add.

BTW, I believe that this is the same problem as being unable to put
breakpoints on shared library functions (which are not directly used
by the application) prior to the shared library being loaded.

Kevin


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