This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Why type = <data variable, no debug info>?
- From: Brian Dessent <brian at dessent dot net>
- To: gdb at sourceware dot org
- Date: Fri, 20 Oct 2006 20:51:10 -0700
- Subject: Re: Why type = <data variable, no debug info>?
- References: <200610210620.24201.munzirtaha@gmail.com>
- Reply-to: gdb at sourceware dot org
"Munzir Taha (???? ??)" wrote:
>
> Hi, in this small program logic tells me that errno and n should have the same
> value displayed in gdb. Am I missing something obvious?
You're probably running into the fact that on modern glibc errno is a
TLS symbol, not a regular one. This means it can take on a different
value in each thread, and thus is accessed through an indirection.
You might get better debugging ability if you compile with -ggdb3
instead of just -g, which gives gdb some additional information. I
believe that without any debug information in the binary, gdb cannot do
anything about TLS symbols, but I'm not sure. See also the proposed
patch <http://sourceware.org/ml/gdb-patches/2006-08/threads.html#00187>
and/or <https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=185337>.
Brian