This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Break whenever an application enters a given library
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