Break whenever an application enters a given library

Paul Pluzhnikov ppluzhnikov@google.com
Fri May 8 00:19:00 GMT 2009


On Thu, May 7, 2009 at 10:08 AM, Michael Snyder <msnyder@vmware.com> wrote:
> Mausoom Sarkar wrote:
>>
>>    I want gdb to break whenever calls are made to functions within a
>> particular library. How can I set such a library level breakpoint?
>
> In general, you can't.
> Maybe set an access watchpoint on the library's whole text section?

Another way is to do something like this:

  bash$ nm /path/to/lib.so | grep ' T ' |
     sed -e 's/.* T //' -e 's/^/break /' > gdb.cmds
  (gdb) source gdb.cmds

Cheers,
-- 
Paul Pluzhnikov



More information about the Gdb mailing list