question about conditional breaking

Kevin Buettner kevinb@redhat.com
Fri Sep 20 08:46:00 GMT 2002


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



More information about the Gdb mailing list