This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
[RFC] Mixing 32-bit and 64-bit DWARF format
- From: Mark Kettenis <kettenis at gnu dot org>
- To: gdb at sources dot redhat dot com
- Date: Sun, 17 Oct 2004 18:21:00 +0200 (CEST)
- Subject: [RFC] Mixing 32-bit and 64-bit DWARF format
I've recently got hold of an SGI O2, so I'm working on porting GDB to
OpenBSD/sgi (a.k.a. OpenBSD/mips64). In doing so, I discovered that
GDB doesn't really like the mixing of 32-bit and 64-bit DWARF format
inside a single compilation unit. Unfortunately mixing those two is
what the current OpenBSD/sgi toolchain does; I've got a 32-bit
.dwarf_info section and a 64-bit .dwarf_line section. This makes GDB
crash.
Now the DWARF Version 3 draft clearly states that this is a bug:
The 32-bit and 64-bit DWARF format conventions must not be
intermixed within a single compilation unit.
So I'll try to get the OpenBSD/sgi toolchain fixed. However, GDB
shouldn't crash on bogus input, so something should be done about it.
I can see two options:
1) Make this an error() such that GDB refuses to load the file.
2) Make GDB complain() and continue to read the section according to
the format specified by the initial_length of the section.
I'm leaning towards the second option (be liberal in what you accept),
but if no-one has stumbled across this before on other systems the
first option would be acceptable too (since I can fix OpenBSD/sgi
before the official release).
Optinions?
Mark