From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Subject: RFA: make it simpler to try debug_pubnames
Date: Thu, 31 Jul 2008 19:22:00 -0000 [thread overview]
Message-ID: <m3d4kt270q.fsf@fleche.redhat.com> (raw)
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;
next reply other threads:[~2008-07-31 19:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-31 19:22 Tom Tromey [this message]
2008-07-31 19:31 ` Tom Tromey
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=m3d4kt270q.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@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