This is the mail archive of the gdb@sources.redhat.com 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: How do you debug a shared library if the main app is compiledwithout debug?


Jim Blandy wrote:

Richard Tierney <mfoc73@dsl.pipex.com> writes:


I've written a shared library (ELF/.so), with debug enabled, which is
called from a commercial package. I don't have sources for the other
vendor's code, and it was (I think) compiled without debug info.

Question: can I use gdb to debug my own code in this environment? If I
set 'file' to the name of the vendor's executable then I get a message
about there being no symbols. I've tried setting breakpoints in my own
code, using a function name or a file and a line number, and then
running the main app. I had assumed that the breakpoints would be set
when my code is loaded, but this isn't happening - I get a warning
about not being able to insert a breakpoint, and a memory access error.


You should try the current GDB sources.  As of about a month ago, Jeff
Johnston got "pending breakpoint" support working, which does exactly
what you want.  Below, '__overflow' is a function used internally by
the 'puts' function:

Fantastic! Many thanks.


Rick



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