Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Setting up a debugging system?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
justinsb
n00b
n00b


Joined: 24 Jun 2002
Posts: 1

PostPosted: Mon Jun 24, 2002 11:24 am    Post subject: Setting up a debugging system? Reply with quote

I'm a competent programmer and when I come across a bug in the system, I'd like to fix it. So I'd like to have all the source code for my system installed locally and have all programs compiled with debug symbols. Trying to do this with a "conventional" distro is tricky; gentoo seems like the answer. But I can't quite get there....

1) I've added the -g option to CFLAGS so that compilation should include debug info, but how do I stop installed files being stripped of the debug information?
2) How do I get portage to keep the source code tree after compilation?
3) When/If I do find a bug and fix it in my local source tree, what is the correct procedure to follow with portage to build the changed version?
4) How would I then stop portage clobbering my changed code in the local source tree?

Any help would be much appreciated.

Thanks
Justin SB
Back to top
View user's profile Send private message
slik
n00b
n00b


Joined: 18 Apr 2002
Posts: 48
Location: Alberta, Canada

PostPosted: Tue Jun 25, 2002 7:38 pm    Post subject: Re: Setting up a debugging system? Reply with quote

justinsb wrote:

1) I've added the -g option to CFLAGS so that compilation should include debug info, but how do I stop installed files being stripped of the debug information?
2) How do I get portage to keep the source code tree after compilation?
3) When/If I do find a bug and fix it in my local source tree, what is the correct procedure to follow with portage to build the changed version?
4) How would I then stop portage clobbering my changed code in the local source tree?


1. see /usr/portage/eclass/debug.eclass
so you can probably put
Code:

DEBUG="yes"
RESTRICT="nostrip"

in your /etc/make.conf and make sure not to define -fomit-frame-pointer in your C(xx)FLAGS. -g -O2 -march=yourproc is probably best bet for debugging

2. see FEATURES in /etc/make.conf (at bottom)


3. use ebuild instead of emerge, see documetation

4. 2 should take care of it, but portage has been a bit flakey lately and I don't know which version would play best

if you get all this worked out, let me know! I want to set up a pure debug system on another partion sometime soon. It would be nice if you could specify that static libs be debugging and dynamic not (longer compile maybe, but hey) and then when developing, link statically and for everyday apps, full speed ahead. ccache may help greatly to reduce recompiling static libs too.
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Sun Aug 18, 2002 5:59 pm    Post subject: Reply with quote

From Bugs to Portage & Programming.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum