Re: [gentoo-dev] Split ELF Debug (default or not?)

2005-11-27 Thread Kevin F. Quinn
On 26/11/2005 13:55:25, Ned Ludd ([EMAIL PROTECTED]) wrote:
 On Sat, 2005-11-26 at 19:30 +0100, Bruno wrote:
 
  What's the advantage of splitting out the debug info to some extra 
  location instead of leaving it in the original binary (maybe smaller 
  foot-print in memory while the debugging info is not used), 
 
 Yes exactly a stripped binary will occupy less space in RAM.

I may be wrong, but I don't think this is true.  As I understand it,
debug sections aren't part of the PT_LOAD segments so the loader won't
load them into memory.

-- 
gentoo-dev@gentoo.org mailing list



Re: [gentoo-dev] Split ELF Debug (default or not?)

2005-11-27 Thread Ned Ludd
On Sun, 2005-11-27 at 10:53 +0100, Kevin F. Quinn wrote:
 On 26/11/2005 13:55:25, Ned Ludd ([EMAIL PROTECTED]) wrote:
  On Sat, 2005-11-26 at 19:30 +0100, Bruno wrote:
  
   What's the advantage of splitting out the debug info to some extra 
   location instead of leaving it in the original binary (maybe smaller 
   foot-print in memory while the debugging info is not used), 
  
  Yes exactly a stripped binary will occupy less space in RAM.
 
 I may be wrong, but I don't think this is true.  As I understand it,
 debug sections aren't part of the PT_LOAD segments so the loader won't
 load them into memory.

See the objcopy manpage. Look for the --only-keep-debug section.
The entire elf has to be mmaped before individual sections are mapped.


-- 
Ned Ludd [EMAIL PROTECTED]
Gentoo Linux

-- 
gentoo-dev@gentoo.org mailing list



Re: [gentoo-dev] Split ELF Debug (default or not?)

2005-11-27 Thread Ned Ludd
On Sat, 2005-11-26 at 23:42 +0200, Petteri Räty wrote:
 Ned Ludd wrote:
  Good afternoon,
  
  Would you be willing to give up space in $ROOT/usr/lib/debug for ELF
  executables by default in order to aid in better debugging by or do we
  want to only emit it when a FEATURE= is defined.
  
  Having a split debug pretty much obsoletes the need to add nostrip to
  your features in order to get debug info.
  
  Users wishing to not have debug info can simply add
  INSTALL_MASK=/usr/lib/debug ${INSTALL_MASK} to make.conf or the
  environment unless we make it FEATURE based.
  
  I'm in favor of it enabled per default but I'd like to know what you
  think and why. (advantages of on/off by default etc..)
  
 
 How useful is this debug information with -fomit-frame-pointer? From
 what I have read it makes debugging at least harder. I think most people
 have -fomit-frame-pointer in their CFLAGS so it should not be enabled by
 default if the debug info is not very useful any way.
 
 Regards,
 Petteri

-fomit-frame-pointer does indeed make certain aspects of debugging
harder but it does not moot the idea entirely.

-- 
Ned Ludd [EMAIL PROTECTED]
Gentoo Linux

-- 
gentoo-dev@gentoo.org mailing list



Re: [gentoo-dev] Split ELF Debug (default or not?)

2005-11-26 Thread Ned Ludd
On Sat, 2005-11-26 at 19:30 +0100, Bruno wrote:

[snip]

 What's the advantage of splitting out the debug info to some extra location 
 instead of leaving it in the original binary (maybe smaller foot-print in 
 memory while the debugging info is not used), 

Yes exactly a stripped binary will occupy less space in RAM.


 and what tools are compatible 
 with this external debug info?

gdb being the main one.

With tools like valgrind you can simply do.
LD_LIBRARY_PATH=/usr/lib/debug valgrind --foo

ELF is cool like that.


-- 
Ned Ludd [EMAIL PROTECTED]
Gentoo Linux

-- 
gentoo-dev@gentoo.org mailing list