gdb plus strace


Forum: Extension Development
Topic: gdb plus strace
started by: lucky13

Posted by lucky13 on May 18 2008,21:40
I'm separating this from the remastering guide because it's a distinct topic and because there's been some interest expressed in updating the gdb extension.

meo:
Quote
I did it so that I could make an extension of the Gnu Debugger at the same time.

Did you compress as UCI or just tar.gz? Do you boot toram so that would explain why your RAM use was so inflated?

I'm also curious if you set any other variables when running configure. I just compiled gdb and strace in the same directory (/opt/gdb-6.8) but without any other configure options other than target=i486-linux for either. As a result, I have the following bloat I could cut:
2.5M    ./info
1.1M    ./share/locale
48K     ./man/man1

That's out of a total unstripped 36MB for the whole thing.

I'd remove those to shave off about 10% barring objections from those who'd insist on keeping info and/or NLS (da, cn, vi, es, fi, fr, ja, rw, sv, tr, zh_CN, de, id, nl, pt) even though the online documentation is extensive and adequate.

FWIW, I put these two together because strace isn't nearly as big as gdb and I think the users who'd be interested in one would be interested in the other as well since they can be used in tandem.

Posted by WDef on May 18 2008,21:48
I now have a gdb v6.1 .dsl extension - made from a deb package I found in the wild that had been backported (from Sarge?) to Woody.  It's only 4 years out of date as opposed to the 6 year old current gdb extension .

But if you have a more recent gdb uci on the way (good!), I won't bother posting this as an update to ye veryie olde gdb.dsl I put in the repo

Posted by lucky13 on May 18 2008,21:54
WDef - Do you like the idea of including strace or would you be just as happy without?
Posted by lucky13 on May 18 2008,23:41
I had a few minutes to test and look to see what else I can do to get the size down.

BAK = unstripped...
2801724 May 18 18:23 i486-linux-gdb
15808898 May 18 18:23 i486-linux-gdbBAK
2801724 May 18 18:23 i486-linux-gdbtui
15808943 May 18 18:23 i486-linux-gdbtuiBAK
190172 May 18 18:24 strace
640866 May 18 18:24 straceBAK
8362 May 18 16:16 strace-graph (shell script)

Does anyone need gdbtui since it can be called (iirc) from gdb with --i=tui?

Informal poll of those interested in this:
Do you want or even care if I leave in NLS? (See previous entry for languages covered.)
Do you want both gdb and gdbtui?
Do you want strace included or as a separate extension?
Anything else?

Edit: Uncompressed, stripped, without gdbtui (which can still be called from the binary as noted above), with man and info and NLS removed:

du -h gdb-6.8/
1.1M    gdb-6.8/lib
2.9M    gdb-6.8/bin (includes gdb, strace, strace-graph)
3.9M    gdb-6.8

Both strace and gdb seem to work as they're supposed to so far. More testing tomorrow and if there are no objections I'll submit by Tuesday or Wednesday. Unless meo wants to submit it first.

Posted by lucky13 on May 19 2008,04:06
1727930 May 18 22:50 gdb-strace.uci

So ~300kb bigger than gdb.dsl but it also includes strace.

Posted by WDef on May 19 2008,12:14
Having strace somewhere might come in handy, either included or separately.

One thing maybe to check (which I'm not sure of) is whether or not the version of gdb used is supposed to match in some sense the highest version of gcc used for compiling - have a feeling there might be something like that, that gcc and gdb are written to be compatible?  Dunno.

Posted by lucky13 on May 19 2008,15:04
Quote
One thing maybe to check (which I'm not sure of) is whether or not the version of gdb used is supposed to match in some sense the highest version of gcc used for compiling...

I'll check into that later today if I get a chance.

Posted by lucky13 on May 20 2008,16:40
I'm submitting strace separately and gdb will follow (hopefully by the end of this coming weekend) when I have time to check up on matching gcc/gdb.
Posted by WDef on May 29 2008,23:29
It could be I raised a red herring here Lucky.

Looking at the gdb NEWS < http://sources.redhat.com/cgi-bin....oot=src >

I can see one or two gdb features supporting gcc options that only exist on gcc past certain versions, but then we don't need those if the binary being debugged wasn't compiled with them (if that make sense) and that seems to be for pretty old gdb versions anyway.

Maybe just go ahead and post; I was raising it as a possibility rather than a known reality.

Posted by lucky13 on May 29 2008,23:46
Then I should be able to get that to Robert sometime tomorrow. Boy, will meo be glad.
Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.