FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian KDE

 
 
LinkBack Thread Tools
 
Old 04-08-2010, 05:21 AM
Adrian von Bidder
 
Default Attach gdb to program?

Heyho!

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 :-(

(I've only ever used gdb on locally compiled simple projects, I've never
worked with the separate symbol files as delivered in -dbg packages.)

thanks in advance
-- vbi

--
Wer sich an eine falsche Vorstellung gewöhnt, dem wird jeder
Irrtum willkommen sein.
-- Goethe, Maximen und Reflektionen, Nr. 1026
 
Old 04-08-2010, 02:04 PM
Carsten Pfeiffer
 
Default Attach gdb to program?

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 :-(
>
> (I've only ever used gdb on locally compiled simple projects, I've never
> worked with the separate symbol files as delivered in -dbg packages.)

Not sure if this is the same as your example, but I usually used

gdb kmail
attach <pid>

But check the output of ps aux | grep kmail -- if kmail is launched via
kdeinit or kdeinit4, you need to run "gdb kdeinit" or kdeinit4.

Cheers,
Carsten
 
Old 04-09-2010, 07:10 AM
Adrian von Bidder
 
Default Attach gdb to program?

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 :-(
> >
> > (I've only ever used gdb on locally compiled simple projects, I've
> > never worked with the separate symbol files as delivered in -dbg
> > packages.)
>
> Not sure if this is the same as your example, but I usually used
>
> gdb kmail
> attach <pid>
>
> But check the output of ps aux | grep kmail -- if kmail is launched via
> kdeinit or kdeinit4, you need to run "gdb kdeinit" or kdeinit4.

Ok, I wasn't specific enough. Sorry about that.

What I meant with "doesn't work" is: it doesn't load the symbols.

I have now tried "gdb /usr/lib/debug/usr/bin/kmail <pid>", and this gives me
the symbols for the main binary (and if pwd is ok or I add "-d <path>" to
the cmdline, it even shows the source code, so that's fine, too), but for
all the shared libraries, I'm still stuck.

add-symbol-file wants an address (where would I get this?); plain "symbol-
file" crashes gdb (and in any case: wouldn't this *replace* the symbol table
instead of add to it?)


cheers
-- vbi

--
Anyone can invent a security system that he himself cannot break.
-- Schneier's Law
 
Old 04-09-2010, 12:45 PM
Adrian von Bidder
 
Default Attach gdb to program?

On Thursday 08 April 2010 07.21:59 Adrian von Bidder wrote:
> Just gdb -p <pid> /usr/bin/kmail doesn't work :-(

Arrgh!

As it turns out, gdb 7.0 (squeeze) doesn't really work with binarries from
sid (or experimental), at least onn 32bit x86. gdb 7.1 (sid) works fine.

cheers
-- vbi

--
As we found out later, our activities had both saturated an uplink two
"hops" up from our university, at the Nordic University Network level
and made some DoS-alarms go off at the national level. All part of a fun
release.
-- serving Debian sarge and Ubuntu Breezy CD images
http://www.acc.umu.se/~maswan/2005-12-10/2gbit-freesoftware.html
 
Old 04-09-2010, 12:47 PM
George Kiagiadakis
 
Default 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
mismatch.

Regards,
George


--
To UNSUBSCRIBE, email to debian-kde-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: z2rba4a6e221004090547qc44a03b2sbf7a268b9263fa52@ma il.gmail.com">http://lists.debian.org/z2rba4a6e221004090547qc44a03b2sbf7a268b9263fa52@ma il.gmail.com
 

Thread Tools




All times are GMT. The time now is 05:26 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org