Re: Regarding shared library and GDB



sunil <sunil.vvn@xxxxxxxxx> writes:

On Sep 27, 1:25 pm, dan.odega...@xxxxxxxxx wrote:

Can i debug that library iusing GDB.

Yes.

My problem is unable to caught the library using gdb while application
executing the library.

You are not making much sense, and you are not explaining your
difficulty. After reading this:

http://catb.org/~esr/faqs/smart-questions.html

ask your question again, but explain exactly what you are doing
and what you observe gdb do (and what you expected it to do).

My guess is that the library is loaded dynamically into your app,
and so when you try to set breakpoint in it, the breakpoint is
never set (or never fires).

If so, there are several ways to deal with this.
Commands you'll want to try:

set stop-on-solib-events 1 # stop after every DSO load
info shared # see when your library is loaded.
# Once it is, you can set breakpoints in it.

Alternatively, if you are on x86, insert a breakpoint instruction
into the place in your library where you want gdb to stop:

__asm__ __volatile__ ("int3");

However, this will cause the app to die with 'Trace/breakpoint trap'
when run outside of gdb.

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
.



Relevant Pages

  • Re: Please help resurrecting GDB for version 7.0 release
    ... - old GDB versions for DJGPP ... For Linux upgrade ... When I attempted to set breakpoint to some C procedure I got a message ...
    (comp.os.msdos.djgpp)
  • problem with gdb
    ... I have problem with gdb. ... i cant debug program that i want. ... and i set breakpoint and i run this program. ... UNIX is simple; it just takes a genius to understand its simplicity ...
    (freebsd-hackers)
  • Re: gdb Multi Threading not working in Redhat Linux
    ... I just got a "funny" result from gdb on FC2, when the app is linked ... In order to understand recursion you must first understand recursion. ...
    (comp.os.linux.development.apps)
  • Re: strace
    ... signals. ... you can send any signal to the app from the (gdb) prompt ... In order to understand recursion you must first understand recursion. ...
    (comp.unix.programmer)
  • Re: debug an excutale which is launched by another excutable
    ... > In the first win app, I use Process.Startto launch the second one. ... You mean that the second app exits before you can attach to it? ... > Is there any way to set breakpoint in the second app to debug it? ... Debug | Processes to attach to it during this timeout. ...
    (microsoft.public.vsnet.debugging)