* RFA: make it simpler to try debug_pubnames
@ 2008-07-31 19:22 Tom Tromey
2008-07-31 19:31 ` Tom Tromey
0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2008-07-31 19:22 UTC (permalink / raw)
To: gdb-patches
I wanted to try the debug_pubnames support today, but when I enabled
this I found that it did not compile, and when I made it compile, it
caused an internal error.
This patch fixes the compilation error and the crash, and makes it
simple to try this code by introducing a new symbol, which is used
rather than "#if 0".
The reason I would like this in the repository is to make it simpler
for other folks to try this out.
Please check the comment before WANT_PUBNAMES. I am not sure this is
actually an accurate assessment; my searches didn't turn up anything
relevant.
Built on x86 F8. I did not regression-test this, because it does not
actually change any behavior.
Ok?
Tom
b/gdb/ChangeLog:
2008-07-31 Tom Tromey <tromey@redhat.com>
* dwarf2read.c (WANT_PUBNAMES): New define.
(dwarf2_build_psymtabs): Use WANT_PUBNAMES. Check
dwarf_aranges_section and dwarf_pubnames_section.
(dwarf2_build_psymtabs_easy): Use WANT_PUBNAMES. Initialize
cu_header.initial_length_size.
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 8f1062d..ac97cd7 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -69,6 +69,13 @@
can be used for any other data associated to the objfile (symbol
names, type names, location expressions to name a few). */
+/* Define this to 1 if you want to try out the debug_pubnames
+ support. This is disabled for the time being because it leads to a
+ change of behavior -- 'static' file-scoped variables are not
+ mentioned in debug_pubnames, but historically these do appear in
+ gdb's psymtab. */
+#define WANT_PUBNAMES 0
+
#if 0
/* .debug_info header for a compilation unit
Because of alignment constraints, this structure has padding and cannot
@@ -734,7 +741,7 @@ dwarf2_invalid_attrib_class_complaint (const char *arg1, const char *arg2)
static void dwarf2_locate_sections (bfd *, asection *, void *);
-#if 0
+#if WANT_PUBNAMES
static void dwarf2_build_psymtabs_easy (struct objfile *, int);
#endif
@@ -1258,8 +1265,8 @@ dwarf2_build_psymtabs (struct objfile *objfile, int mainline)
init_psymbol_list (objfile, 1024);
}
-#if 0
- if (dwarf_aranges_offset && dwarf_pubnames_offset)
+#if WANT_PUBNAMES
+ if (dwarf_aranges_section && dwarf_pubnames_section)
{
/* Things are significantly easier if we have .debug_aranges and
.debug_pubnames sections */
@@ -1275,7 +1282,7 @@ dwarf2_build_psymtabs (struct objfile *objfile, int mainline)
}
}
-#if 0
+#if WANT_PUBNAMES
/* Build the partial symbol table from the information in the
.debug_pubnames and .debug_aranges sections. */
@@ -1295,6 +1302,7 @@ dwarf2_build_psymtabs_easy (struct objfile *objfile, int mainline)
struct comp_unit_head cu_header;
unsigned int bytes_read;
+ cu_header.initial_length_size = 0;
entry_length = read_initial_length (abfd, pubnames_ptr, &cu_header,
&bytes_read);
pubnames_ptr += bytes_read;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: RFA: make it simpler to try debug_pubnames
2008-07-31 19:22 RFA: make it simpler to try debug_pubnames Tom Tromey
@ 2008-07-31 19:31 ` Tom Tromey
0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2008-07-31 19:31 UTC (permalink / raw)
To: gdb-patches
>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
Tom> Please check the comment before WANT_PUBNAMES. I am not sure this is
Tom> actually an accurate assessment; my searches didn't turn up anything
Tom> relevant.
... probably because I didn't read dwarf2_build_psymtabs_easy even
enough to realize it isn't doing anything. Sigh. Aside from the
comment, though, this would still be mildly handy.
Tom
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-31 19:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-31 19:22 RFA: make it simpler to try debug_pubnames Tom Tromey
2008-07-31 19:31 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox