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

Re: RFC: Debugging libraries

[Please move this discussion to debian-devel as it is of general
interest and debian-gtk-gnome is not achived (why?)]

On Tue, Apr 27, 1999 at 08:50:21AM +0200, Torsten Landschoff wrote:
> On Mon, Apr 26, 1999 at 11:26:13PM -0400, James LewisMoss wrote:
> > # all dbg packages that install source must register using
> > # install-source <directory>.  This will put the directory in the file
> > # /etc/sources and run the scripts in /etc/rc.sources.  The gdb
> > # script in /etc/rc.sources/gdb generates a file /etc/gdb.sources
> > # which contains a line for each non-empty line in /etc/sources
> > # consisting of "dir <directory>".
> > 
> > exec gdb -x /etc/gdb.sources $@
> Great idea but that would be a great overhead on our ftp servers. We would
> have the source both in the .deb and in the .orig.tar.gz...

Only for .c and .h (and .cc ...) and only for libs.
Usually what makes a source tarball heavier are docs and other stuff.

The idea of combining a gdb wrapper with a config file to locate the
sources is great.
I would propose to have a directory instead of a file, say /etc/dbg.src/
where each -dbg package installs a conf file with its info. This would
permit to get these infos as conffiles and to avoid having an
install-src script.
Then the gdb wrapper just collects ('cat') the content of the directory
and offers it to the real gdb:

cat /etc/dbg.src/* >/tmp/dbg.src.$$  (or somthing better using tempfile:-)
exec .../gdb -x /tmp/gdb.src.$$ "$@"

In my -dbg libs I used a make trick to get the correct dir (the one
where the sources will be installed) into the .s before the assembler
creates the .o , but I knew that some packages where make is badly used,
could not do that.
This seems to me a better idea, but I would like to check it before :-)

> and a notice how to install them (e.g. dpkg-source -x/apt-get source)?

I have thought about this when I added sources to my -dbg packages and I
came to the conclusion that the sources in the tarball (even after the
patch) _cannot_ be used by gdb, because they are _not_ the sources used
to compile the binary dbg lib we are going to use.
There are too much build fases that change the sources: configure for
example is run only after the diff is taken, and it usually heavily
modify include files. 
gdb will present you the wrong source line.
More, some tarball carry general routines to be used in case they are
missing on the compilation system, which is different than the one we
run the dbg lib.

> Why /usr/src/debug? The source does not differ between debugging and release
> code.

I used /usr/src/<pkg>. It seems a natural place to me.

> Hmm. Another good point for having sources in -dbg packages... What should we
> do? :)

I suggest we discuss this a little more and draft a policy proposal.

Did anybody suggested to read  /usr/lib/debug/README.debug  which is
installed by libdb2*-dbg or liblockdev*-dbg packages?

| fpolacco@prosa.it    fpolacco@debian.org    gsm: +358 (0)40 707 2468
| 6F7267F5 fingerprint 57 16 C4 ED C9 86 40 7B 1A 69 A1 66 EC FB D2 5E
| fabrizio.polacco@nokia.com                   fab@pukki.ntc.nokia.com

Reply to: