Thread: Debuging RPMs

Debuging RPMs

From
"Adam H. Pendleton"
Date:
To start off let me just say how well the pgAdmin3 RPMs build and
install on all my RH systems now!  Good work!!  I've run into a problem,
however, and I don't know if it's something that I am doing wrong, or if
there is a problem with the way the RPMs are built.  When trying to
debug the pgadmin3 exectuable that gets installed with the RPM (this is
on RedHat), gdb reports that there are now debug symbols in the executable.

[fmonkey@ahplinux fmonkey]$ gdb pgadmin3
GNU gdb Red Hat Linux (5.3.90-0.20030710.41rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
(no debugging symbols found)...Using host libthread_db library
"/lib/tls/libthread_db.so.1".
(no debugging symbols found)...
(gdb)

There is a debuginfo package installed:

[fmonkey@ahplinux fmonkey]$ rpm -qa pgadmin3*
pgadmin3-1.1.0-cvs20031014
pgadmin3-debuginfo-1.1.0-cvs20031014
[fmonkey@ahplinux fmonkey]$

and the debuginfo file exists:

[fmonkey@ahplinux fmonkey]$ ls -l /usr/lib/debug/usr/bin/pgadmin3.debug
-rwxr-xr-x    1 root     root      1284116 Oct 21 09:00
/usr/lib/debug/usr/bin/pgadmin3.debug
[fmonkey@ahplinux fmonkey]$

Running gdb, specifying the symbol file explicitly doesn't change the
behavior.  Loooking at the SPEC file, I see that 'configure' is run with
the '--enable-debug' option, but that later int he SPEC file, the
following command is run:

strip --strip-debug %{buildroot}/%{_bindir}/%{name}

Removing this command from the SPEC file allows the RPM to build with
the proper debug information.  I don't know how the old RH systems work,
but on mine, the /usr/bin/pgadmin3 file gets stripped, and all the debug
information gets stored in a separate file, so we get the benefit of the
stripped executable, but the advantage of being able to distribute a
pgadmin3-debuginfo RPM for debugging users.

ahp








Re: Debuging RPMs

From
Jean-Michel POURE
Date:
Le Mardi 21 Octobre 2003 15:34, Adam H. Pendleton a écrit :
> When trying to
> debug the pgadmin3 exectuable that gets installed with the RPM (this is
> on RedHat), gdb reports that there are now debug symbols in the executable.

Dear Adam,

RH9 stips off debugging symbols by default.

For consistency, I stripped Mandrake and Suse builds too using:
strip --strip-debug %{buildroot}/%{_bindir}/%{name}

Maybe I can unset the default stripping in RH and then remove this line. But
will you be able to debug enough knowing that wxWindows is stripped too?

This is a real problem. Tell me what I should do...
Best regards, Jean-Michel