List Info

Thread: Re: How to tell whether .o was compiled with -g option




Re: How to tell whether .o was compiled with -g option
country flaguser name
Sweden
2007-05-22 01:31:46
karlfreefriends.org (Karl Berry) wrote:
> I'm sure this is not 100% accurate (in either
direction), but it's one
> hint, anyway.

I was also going to give this answer, but did a quick test
first:

$ gcc -g -c -o hello_debug.o hello.c
$ gcc -c -o hello_no_debug.o hello.c
$ ls -al *.o
-rw-r--r--    1 henca    users        9056 May 22 08:24
hello_debug.o
-rw-r--r--    1 henca    users         776 May 22 08:25
hello_no_debug.o 
$ file *.o
hello_debug.o:    ELF 32-bit LSB relocatable, Intel 80386,
version 1
(SYSV), not stripped 
hello_no_debug.o: ELF 32-bit LSB relocatable, Intel 80386,
version 1
(SYSV), not stripped 
$ strip *.o $ ls -al *.o
-rw-r--r--    1 henca    users         496 May 22 08:25
hello_debug.o
-rw-r--r--    1 henca    users         496 May 22 08:25
hello_no_debug.o 
$ file *.o
hello_debug.o:    ELF 32-bit LSB relocatable, Intel 80386,
version 1
(SYSV), stripped 
hello_no_debug.o: ELF 32-bit LSB relocatable, Intel 80386,
version 1
(SYSV), stripped

So, there is more than the debug information that gets
stripped out from
an object file and being "not stripped" is no
guarantee for containing
debug information.

Unfortunately I have no better answer.

regards Henrik
-- 
The address in the header is only to prevent spam. My real
address is:
hc1(at)poolhem.se Examples of addresses which go to
spammers:
rootlocalhost postmasterlocalhost


Re: How to tell whether .o was compiled with -g option
country flaguser name
Germany
2007-05-22 01:52:13
Hello,

* Henrik Carlqvist wrote on Tue, May 22, 2007 at 08:31:46AM
CEST:
> karlfreefriends.org (Karl Berry) wrote:
> > I'm sure this is not 100% accurate (in either
direction), but it's one
> > hint, anyway.
> 
[...]
> So, there is more than the debug information that gets
stripped out from
> an object file and being "not stripped" is no
guarantee for containing
> debug information.

You can look at `objdump -h' output for presence of debug
sections.

Cheers,
Ralf



[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )