public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/11465] New: Crash on NULL TYPE_FIELD_TYPE
@ 2010-04-01 19:56 jan dot kratochvil at redhat dot com
2010-04-01 19:57 ` [Bug symtab/11465] " jan dot kratochvil at redhat dot com
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2010-04-01 19:56 UTC (permalink / raw)
To: gdb-prs
This bugreport assumes this patch is reverted.
Going to revert this patch now.
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/dwarf2read.c.diff?cvsroot=src&r1=1.376&r2=1.377
With the patch it does not crash but it has incorrect behavior(*).
This reproducer would crash:
cat <<HERE | g++ -c -o x.o -g -x c++ -; gdb -nx -readnow ./x.o
namespace N {
class C {
public:
typedef void (*t) (C);
void m (t);
};
typedef C::t u;
};
N::u f;
HERE
Attaching it in .s form to overcome possible g++ differences.
It is due to dwarf2_physname() accessing unfinished types being read-in,
dwarf2_physname() is not in FSF gdb-7.1 but it is now in FSF GDB HEAD.
=> It is a regression of current FSF GDB HEAD agains FSF GDB 7.1.
(*) The incorrect behavior with that first patch included can be shown on:
------------------------------------------------------------------------------
namespace N {
class C {
public:
typedef void (*t) (C);
C (t) {}
};
typedef C::t u;
u f;
C c (f);
class CC {
public:
CC (int) {}
} cc (1);
};
int
main ()
{
return 0;
}
------------------------------------------------------------------------------
gcc-4.4.3-4.fc12.x86_64 and g++ (GCC) 4.4.4 20100401 (prerelease)
(gdb) p N::c.C
Cannot take address of method C.
(gdb) p N::cc.CC
$1 = {void (N::CC *, int)} 0x4005c4 <N::CC::CC(int)>
It is because internally GDB at line
fnp->physname = physname ? physname : "";
detects
"N::C::C(void (*)())"
"N::CC::CC(int)"
where "()" should be "(C)".
------------------------------------------------------------------------------
g++ (GCC) 4.5.0 20100401 (experimental)
(gdb) p N::c.C
$1 = {void (N::C *, N::C::t)} 0x400516 <N::C::C(N::C::t)>
(gdb) p N::cc.CC
$2 = {void (N::CC *, int)} 0x400524 <N::CC::CC(int)>
looks correct but still it does not work:
(gdb) ptype N::C::t
type = void (*)(void)
--
Summary: Crash on NULL TYPE_FIELD_TYPE
Product: gdb
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: symtab
AssignedTo: unassigned at sourceware dot org
ReportedBy: jan dot kratochvil at redhat dot com
CC: gdb-prs at sourceware dot org,keiths at redhat dot com
GCC target triplet: x86_64-unknown-linux-gnu
http://sourceware.org/bugzilla/show_bug.cgi?id=11465
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-04-12 19:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-01 19:56 [Bug symtab/11465] New: Crash on NULL TYPE_FIELD_TYPE jan dot kratochvil at redhat dot com
2010-04-01 19:57 ` [Bug symtab/11465] " jan dot kratochvil at redhat dot com
2010-04-02 9:37 ` jan dot kratochvil at redhat dot com
2010-04-12 19:33 ` keiths at redhat dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).