This is the mail archive of the gdb@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: 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


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