[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Attach gdb to program?

On Fri, Apr 9, 2010 at 8:10 AM, Adrian von Bidder <avbidder@fortytwo.ch> wrote:
> On Thursday 08 April 2010 16.04:39 Carsten Pfeiffer wrote:
>> Am Donnerstag, 8. April 2010 schrieb Adrian von Bidder:
>> > Given a Debian package (kmail, in this case, with installed kdepim-dbg
>> > package) and an extracted source package: how do I properly start gdb
>> > (or ddd or ...) so that it finds both the debugging symbols and the
>> > source code?
>> >
>> > Just gdb -p <pid> /usr/bin/kmail doesn't work :-(
>> >

Just don't specify any binary to the gdb command line. Let it find the
correct binary from /proc:

$ gdb -p <pid>

This is because sometimes kdeinit4 is the binary and the application
is loaded as a shared library and gdb gets very confused if you tell
it where the binary is.

Also, always make sure that the debug symbols package is exactly the
same version as the package providing the binary. In some debug
packages dependencies are not strict and you might get version


Reply to: