This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to build Debug version of glibc


On Sun, Dec 7, 2008 at 8:33 PM, "Chen (陈) Jun (军)" <chjfth@gmail.com> wrote:
> Hi everyone, I'm new to this mailing list. Happy to see this mailing list
> for helping average glibc users, There wasn't such a list one year before,
> was it?

Thanks! The list is new. It was created on April 22, 2008.

> As I know, most, if not all, Linux distributions ship with Release version
> of glibc, so I can not debug into the libc dll. I tried it with KDbg in SuSE
> Linux 10.1, so I know this.

That is correct, most distributions ship system libraries stripped of
debug information. However, your distro should also provide a version
with debug symbols. For example on debian the 'libc6-dbg' package
contains all of the unstripped libraries.

> Now I wish to build a Debug version of glibc myself, but the INSTALL file in
> glibc's source archive says almost nothing about "building a debug version".
> Can any glibc guru here tell me the correct way to:
>
> 1. Build a debug version and install it on a existing Linux system.
> 2.When calling gcc to link an executable, e.g. `` gcc -o hello hello.o '' ,
> How to make gcc link that debug version of glibc to hello.

To build a debug version of glibc you must build with debugging
enabled e.g. CFLAGS="-O2 -g" and CPPFLAGS="-O2 -g".

> Some more questions I'm interested:
>
> 1. For glibc developers themselves, do they build debug versions of glibc?

I build glibc with the above makefile flags.

> 2. If they do, how do they debug it, use command line gdb, or a GUI frontend
> of gdb? If later, which do they use?

I primarily use command-line gdb to debug glibc.

Cheers,
Carlos.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]