From: dje@google.com (Doug Evans)
To: gdb-patches@sourceware.org
Subject: [RFA 2/4] Improve DWARF Type Unit performance
Date: Tue, 10 Jul 2012 08:09:00 -0000 [thread overview]
Message-ID: <20120710080913.82E3B1E1253@ruffy2.mtv.corp.google.com> (raw)
This patch in the series adds the notion of anonymous partial symtabs.
TU partial symtabs currently don't have a name, and this patch series
doesn't change that. They could if we looked at DW_AT_decl_file, but
I haven't found a compelling need for it (you can't, for example,
set a breakpoint on a type unit).
2012-07-09 Doug Evans <dje@google.com>
* psympriv.h (struct partial_symtab): New member "anonymous".
* psymtab.c (partial_map_symtabs_matching_filename): Ignore
anonymous psymtabs.
(map_symbol_filenames_psymtab): Ditto.
(expand_symtabs_matching_via_partial): Ditto.
(dump_psymtab): Update.
Index: psympriv.h
===================================================================
RCS file: /cvs/src/src/gdb/psympriv.h,v
retrieving revision 1.13
diff -u -p -r1.13 psympriv.h
--- psympriv.h 10 May 2012 19:54:45 -0000 1.13
+++ psympriv.h 10 Jul 2012 01:15:46 -0000
@@ -182,6 +182,10 @@ struct partial_symtab
unsigned char psymtabs_addrmap_supported;
+ /* True if the name of this partial symtab is not a source file name. */
+
+ unsigned char anonymous;
+
/* A flag that is temporarily used when searching psymtabs. */
ENUM_BITFIELD (psymtab_search_status) searched_flag : 2;
Index: psymtab.c
===================================================================
RCS file: /cvs/src/src/gdb/psymtab.c,v
retrieving revision 1.48
diff -u -p -r1.48 psymtab.c
--- psymtab.c 26 Jun 2012 20:14:02 -0000 1.48
+++ psymtab.c 10 Jul 2012 01:15:46 -0000
@@ -174,6 +174,10 @@ partial_map_symtabs_matching_filename (s
if (pst->user != NULL)
continue;
+ /* Anonymous psymtabs don't have a file name. */
+ if (pst->anonymous)
+ continue;
+
if (FILENAME_CMP (name, pst->filename) == 0
|| (!is_abs && compare_filenames_for_search (pst->filename,
name, name_len)))
@@ -973,8 +977,13 @@ dump_psymtab (struct objfile *objfile, s
struct gdbarch *gdbarch = get_objfile_arch (objfile);
int i;
- fprintf_filtered (outfile, "\nPartial symtab for source file %s ",
- psymtab->filename);
+ if (psymtab->anonymous)
+ fprintf_filtered (outfile, "\nAnonymous partial symtab ");
+ else
+ {
+ fprintf_filtered (outfile, "\nPartial symtab for source file %s ",
+ psymtab->filename);
+ }
fprintf_filtered (outfile, "(object ");
gdb_print_host_address (psymtab, outfile);
fprintf_filtered (outfile, ")\n\n");
@@ -1143,6 +1152,10 @@ map_symbol_filenames_psymtab (struct obj
if (ps->readin)
continue;
+ /* Anonymous psymtabs don't have a file name. */
+ if (ps->anonymous)
+ continue;
+
QUIT;
if (need_fullname)
fullname = psymtab_to_fullname (ps);
@@ -1377,8 +1390,13 @@ expand_symtabs_matching_via_partial
if (ps->user != NULL)
continue;
- if (file_matcher && ! (*file_matcher) (ps->filename, data))
- continue;
+ if (file_matcher)
+ {
+ if (ps->anonymous)
+ continue;
+ if (! (*file_matcher) (ps->filename, data))
+ continue;
+ }
if (recursively_search_psymtabs (ps, objfile, kind, name_matcher, data))
psymtab_to_symtab (ps);
next reply other threads:[~2012-07-10 8:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-10 8:09 Doug Evans [this message]
2012-07-10 16:49 ` Tom Tromey
2012-07-10 18:45 ` Doug Evans
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=20120710080913.82E3B1E1253@ruffy2.mtv.corp.google.com \
--to=dje@google.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