From: Michel METZGER <michel.metzger@st.com>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Bad struct name in gdb with g++ 4.1.2
Date: Tue, 02 Nov 2010 18:43:00 -0000 [thread overview]
Message-ID: <5B4CE209869C6A4797F5FAA0B348F0A0D9EA8C20A7@SAFEX1MAIL1.st.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1103 bytes --]
Hi,
I'm having some issues with debugging an application compiled with g++ 4.1.2
The type names for structures appear in gdb as ".0", ".1", etc.
Here is a simple testcase:
foo.h
----------------------------------------------
typedef struct {
int bar;
char br;
} foo_t;
----------------------------------------------
foo.c
----------------------------------------------
#include "foo.h"
foo_t * global_foo_ptr;
int main(void) {
return 0;
}
----------------------------------------------
Compiled with
>g++4 -g -m32 foo.c -o test
GDB trace:
----------------------------------------------
(gdb) whatis global_foo_ptr
type = ._0 *
(gdb) ptype foo_t
No symbol "foo_t" in current context.
----------------------------------------------
>gdb --version
GNU gdb Red Hat Linux (6.3.0.0-1.162.el4rh)
>g++4 --version
g++4 (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44)
A more recent version of gdb (7.1) gives the same results.
A more recent version of gcc (4.5.1) gives the expected results.
Any idea?
Thanks for your help,
--
Michel Metzger.
[-- Attachment #2: gdb_struct_name.tar.gz --]
[-- Type: application/x-gzip, Size: 401 bytes --]
next reply other threads:[~2010-11-02 18:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-02 18:43 Michel METZGER [this message]
2010-11-02 19:37 ` Tom Tromey
2010-11-02 19:53 ` Michel METZGER
2010-11-15 20:29 ` Dodji Seketeli
2010-11-15 20:45 ` Michel METZGER
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5B4CE209869C6A4797F5FAA0B348F0A0D9EA8C20A7@SAFEX1MAIL1.st.com \
--to=michel.metzger@st.com \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox