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

Re: rpm and gdb

Mike Bresnahan wrote:

I am writing an application that will do something similar to the command "rpm -K <package>". To understand what steps are involved I want to step through the rpm code with gdb. To those ends I have compiled the rpm source with debugging symbols (-g) and ran the resulting executable inside gdb. However, I am seeing the following:

~/rpm-4.0.4: gdb rpm
GNU gdb Red Hat Linux (5.2-2)
Copyright 2002 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"...
(gdb) b rpmCheckSig
Breakpoint 1 at 0x8073241: file rpmchecksig.c, line 292.
(gdb) run -K /var/cache/apt/archives/kde_3.1.2-0.fdr.0.rh73_noarch.rpm
Starting program: /home/mike/rpm-4.0.4/rpm -K /var/cache/apt/archives/kde_3.1.2-0.fdr.0.rh73_noarch.rpm

Program received signal SIGTRAP, Trace/breakpoint trap.
Cannot remove breakpoints because program is no longer writable.
It might be running in another process.
Further execution is probably impossible.
0x40000a70 in ?? ()
(gdb) where
#0 0x40000a70 in ?? ()
Cannot access memory at address 0x0
(gdb) c
/var/cache/apt/archives/kde_3.1.2-0.fdr.0.rh73_noarch.rpm: md5 (GPG) NOT OK (MISSING KEYS: GPG#FF6382FA)

Program exited with code 01.

As can be seen, I am unable to set breakpoints. What do I have to do to make this work? Is this a gdb issue or a rpm issue?
Note that I get similar behavior when I run gdb on the normal /bin/rpm.

I am using:
Linux 2.4.18-27.7.x
RedHat 7.3
gcc (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
GNU gdb Red Hat Linux (5.2-2)
RPM version 4.0.4

Nod, trap while execing /usr/lib/rpm/rpmk through popt exec.

Try gdb /usr/lib/rpm/rpmk
(gdb) run -K

with breakpoints set as before.

73 de Jeff

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