LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-06-2011, 01:53 PM   #1
soccertl
LQ Newbie
 
Registered: Jan 2011
Posts: 4

Rep: Reputation: 0
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.
 
Old 01-07-2011, 11:28 AM   #2
ptader
LQ Newbie
 
Registered: Jan 2011
Location: Chicago, Il. USA
Distribution: Ubuntu
Posts: 4

Rep: Reputation: 0
Are the -devel or (-debuginfo if there is one) libraries installed on the new host?
 
Old 01-07-2011, 11:59 AM   #3
soccertl
LQ Newbie
 
Registered: Jan 2011
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ptader View Post
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?
 
Old 01-07-2011, 01:36 PM   #4
soccertl
LQ Newbie
 
Registered: Jan 2011
Posts: 4

Original Poster
Rep: Reputation: 0
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?
 
Old 01-07-2011, 02:46 PM   #5
soccertl
LQ Newbie
 
Registered: Jan 2011
Posts: 4

Original Poster
Rep: Reputation: 0
Found the answer, I can use "%define __os_install_post %{nil}" to prevent the stripping. It now works like I want.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
gdb (no debugging symbols found) knobby67 Programming 2 01-23-2011 09:41 PM
[SOLVED] Segmentation fault in 6.62 - stripping debugging symbols DougCM Linux From Scratch 1 12-07-2010 08:29 AM
Is a there general method to segregate debugging symbols in Slackware packages? Shingoshi Slackware 7 03-27-2009 08:15 PM
can't get debugging symbols when using automake ta0kira Programming 1 10-23-2008 08:52 PM
gdb debugging assembly with no symbols Four Programming 5 10-01-2008 08:47 PM


All times are GMT -5. The time now is 10:35 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration