* [RFA 2/4] Improve DWARF Type Unit performance
@ 2012-07-10 8:09 Doug Evans
2012-07-10 16:49 ` Tom Tromey
0 siblings, 1 reply; 3+ messages in thread
From: Doug Evans @ 2012-07-10 8:09 UTC (permalink / raw)
To: gdb-patches
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);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA 2/4] Improve DWARF Type Unit performance
2012-07-10 8:09 [RFA 2/4] Improve DWARF Type Unit performance Doug Evans
@ 2012-07-10 16:49 ` Tom Tromey
2012-07-10 18:45 ` Doug Evans
0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2012-07-10 16:49 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb-patches
>>>>> "Doug" == Doug Evans <dje@google.com> writes:
Doug> 2012-07-09 Doug Evans <dje@google.com>
Doug> * psympriv.h (struct partial_symtab): New member "anonymous".
Doug> * psymtab.c (partial_map_symtabs_matching_filename): Ignore
Doug> anonymous psymtabs.
Doug> (map_symbol_filenames_psymtab): Ditto.
Doug> (expand_symtabs_matching_via_partial): Ditto.
Doug> (dump_psymtab): Update.
Does read_psymtabs_with_filename need to check 'anonymous'?
It wasn't clear to me.
Other that that, this patch looks good to me.
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA 2/4] Improve DWARF Type Unit performance
2012-07-10 16:49 ` Tom Tromey
@ 2012-07-10 18:45 ` Doug Evans
0 siblings, 0 replies; 3+ messages in thread
From: Doug Evans @ 2012-07-10 18:45 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
On Tue, Jul 10, 2012 at 9:48 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Doug" == Doug Evans <dje@google.com> writes:
>
> Doug> 2012-07-09 Doug Evans <dje@google.com>
> Doug> * psympriv.h (struct partial_symtab): New member "anonymous".
> Doug> * psymtab.c (partial_map_symtabs_matching_filename): Ignore
> Doug> anonymous psymtabs.
> Doug> (map_symbol_filenames_psymtab): Ditto.
> Doug> (expand_symtabs_matching_via_partial): Ditto.
> Doug> (dump_psymtab): Update.
>
> Does read_psymtabs_with_filename need to check 'anonymous'?
> It wasn't clear to me.
>
> Other that that, this patch looks good to me.
Yes indeed. Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-07-10 18:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-10 8:09 [RFA 2/4] Improve DWARF Type Unit performance Doug Evans
2012-07-10 16:49 ` Tom Tromey
2012-07-10 18:45 ` Doug Evans
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox