LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   no debugging symbols found (not the simple case) (https://www.linuxquestions.org/questions/programming-9/no-debugging-symbols-found-not-the-simple-case-854679/)

soccertl 01-06-2011 01:53 PM

no debugging symbols found (not the simple case)
 
Hello all,

I wasn't sure where to put this so if I need to move it just let me know.

I have a strange problem that I cannot figure out. When I use gdb to debug our rpm-installed program, it says (no debugging symbols found) when it loads. Thing is, when I use nm on the program it can print the symbols, and even stranger is if I use gdb on the program before it is packed up by rpmbuild it loads the debug symbols just fine.

Our program is built via the standard make using:

CFLAGS=-g -Wall -pedantic

and as I mentioned I can debug the resulting program. After the build, I package it up using:

cmd="rpmbuild -v -bb ptsnmp.spec --define \"ver ${cmvc_release}\" --define \"rel ${cmvc_level}\" --define \"_topdir $rpmdir\""


When this package is installed via rpm, the binary on the machine shows all the debug info via nm, file shows it is not stripped:

pt_snmp: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GN
U/Linux 2.6.9, not stripped

yet when I try to debug it I get the no debugging symbols found.

This is really taxing my brain and I am sure I am just missing something, so if anyone has a clue as to what the problem could be I would appreciate it very much.

Thanks for any help.

ptader 01-07-2011 11:28 AM

Are the -devel or (-debuginfo if there is one) libraries installed on the new host?

soccertl 01-07-2011 11:59 AM

Quote:

Originally Posted by ptader (Post 4216588)
Are the -devel or (-debuginfo if there is one) libraries installed on the new host?

Not sure what those are. However, if I overlay the bin from my "made" directory, (the bin that is not in the package), I can debug fine. Are -devel and/or -debuginfo something specified in the spec file?

soccertl 01-07-2011 01:36 PM

ok, I found the bin from the package file was MUCH smaller, over 3x smaller in fact. So, I checked the logs and found:

+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/brp-python-bytecompile
+ /usr/lib/rpm/redhat/brp-java-repack-jars

So, even though it says the bin is not stripped using file it looks like it really might be. At least I assume that is what rpmbuild is doing in those calls. Is there a way to prevent rpmbuild from stripping the bins?

soccertl 01-07-2011 02:46 PM

Found the answer, I can use "%define __os_install_post %{nil}" to prevent the stripping. It now works like I want.


All times are GMT -5. The time now is 05:04 AM.