This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: How to build Debug version of glibc
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: "Chen (陈) Jun (军)" <chjfth at gmail dot com>
- Cc: libc-help at sourceware dot org
- Date: Mon, 8 Dec 2008 19:11:56 -0500
- Subject: Re: How to build Debug version of glibc
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=AcOhZrbZRp4RAy+ClODSnJqAkEO3PJ4R6flDoV9MwmE=; b=ICW45lS+w6rIoNAfsyLRb2Tih2/d8eUu7WK2glrNrzOSpvxF6+kkfoor2s02YnXjLL 0gw//u9S6JOGxp6DBs5rjGIuUhPvgAOu8xM+788NZ0xDPdHdF2Bj8cEU9ZFl2QTj6MwD NwNGiBhBjrEAXUeEk8EM8DQmd58cvhwyBp+XA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=YMo5Pe5DQYA7pJHmg5g4vHZQsoFMgKuwKePjPBBc+gAKatMC/WFfi6wLGd+Ozf0y88 WGUF67kIz1xfWhHVfKg7OxKyltiwEk3e6SlHwvKcTXPrfb10XwV/iiwsTOufYqDGIy/v nVHbGHL84c7gRljUp8p8VSL8hJQnFnwwEU8NA=
- References: <493C7979.7050900@gmail.com>
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.