Unix Programming - To find whether the shared library is of 'debug' version??

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > July 2005 > To find whether the shared library is of 'debug' version??





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author To find whether the shared library is of 'debug' version??
qazmlp1209@rediffmail.com

2005-07-25, 6:07 pm

How exactly we can find out whether the shared library(.so) was
produced with 'debug' option(-g) set?

Loic Domaigne

2005-07-25, 6:07 pm

Salut,

> How exactly we can find out whether the shared library(.so) was
> produced with 'debug' option(-g) set?


use the "file" command. If the file is not stripped, then it includes
debugging symbols.

Cheers,
Loic.
Paul Pluzhnikov

2005-07-25, 6:07 pm

Loic Domaigne <loic-dev@gmx.net> writes:

>
> use the "file" command. If the file is not stripped, then it includes
> debugging symbols.


Huh?

$ gcc junk.c
$ file a.out
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped

Clearly the file was compiled *without* '-g', is not stripped,
and does *not* include debugging symbols.

To the OP: the answer is system-specific. What OS are you on?
Also note, that DSO could contain some files compiled with '-g',
and other files compiled without.

On Linux/Solaris, do 'objdump -g foo.so' or 'readelf -w' to see what
(if any) debug info is present.

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com