* [commit]: dw2_expand_symtabs_with_filename: ignore type units
@ 2010-12-08 18:11 Doug Evans
2010-12-08 18:16 ` Doug Evans
2010-12-09 8:29 ` Yao Qi
0 siblings, 2 replies; 6+ messages in thread
From: Doug Evans @ 2010-12-08 18:11 UTC (permalink / raw)
To: gdb-patches
Hi.
fyi, I checked this in.
A supplemental patch is to rename expand_symtabs_with_filename.
expand_code_symtabs_with_filename?
Let me know if you want this change too.
Btw, prior to this patch "break main" on one program here
expanded gdb's memory usage by 2.5G. :-)
2010-12-08 Doug Evans <dje@google.com>
* symfile.h (quick_symbol_functions): Clarify usage of
expand_symtabs_with_filename.
* dwarf2read.c (dw2_expand_symtabs_with_filename): Only iterate over
comp units, not type units.
Index: symfile.h
===================================================================
RCS file: /cvs/src/src/gdb/symfile.h,v
retrieving revision 1.78
diff -u -p -r1.78 symfile.h
--- symfile.h 24 Nov 2010 19:01:51 -0000 1.78
+++ symfile.h 8 Dec 2010 17:23:17 -0000
@@ -209,7 +209,10 @@ struct quick_symbol_functions
void (*expand_all_symtabs) (struct objfile *objfile);
/* Read all symbol tables associated with OBJFILE which have the
- file name FILENAME. */
+ file name FILENAME.
+ This is for the purposes of examining code only, e.g., expand_line_sal.
+ The routine may ignore debug info that is known to not be useful with
+ code, e.g., DW_TAG_type_unit for dwarf debug info. */
void (*expand_symtabs_with_filename) (struct objfile *objfile,
const char *filename);
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.484
diff -u -p -r1.484 dwarf2read.c
--- dwarf2read.c 8 Dec 2010 17:31:52 -0000 1.484
+++ dwarf2read.c 8 Dec 2010 17:44:00 -0000
@@ -2323,8 +2323,13 @@ dw2_expand_symtabs_with_filename (struct
int i;
dw2_setup (objfile);
- for (i = 0; i < (dwarf2_per_objfile->n_comp_units
- + dwarf2_per_objfile->n_type_comp_units); ++i)
+
+ /* We don't need to consider type units here.
+ This is only called for examining code, e.g. expand_line_sal.
+ There can be an order of magnitude (or more) more type units
+ than comp units, and we avoid them if we can. */
+
+ for (i = 0; i < dwarf2_per_objfile->n_comp_units; ++i)
{
int j;
struct dwarf2_per_cu_data *per_cu = dw2_get_cu (i);
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [commit]: dw2_expand_symtabs_with_filename: ignore type units
2010-12-08 18:11 [commit]: dw2_expand_symtabs_with_filename: ignore type units Doug Evans
@ 2010-12-08 18:16 ` Doug Evans
2010-12-09 16:39 ` Tom Tromey
2010-12-09 8:29 ` Yao Qi
1 sibling, 1 reply; 6+ messages in thread
From: Doug Evans @ 2010-12-08 18:16 UTC (permalink / raw)
To: gdb-patches
On Wed, Dec 8, 2010 at 10:10 AM, Doug Evans <dje@google.com> wrote:
> Hi.
>
> fyi, I checked this in.
>
> A supplemental patch is to rename expand_symtabs_with_filename.
> expand_code_symtabs_with_filename?
> Let me know if you want this change too.
>
> Btw, prior to this patch "break main" on one program here
> expanded gdb's memory usage by 2.5G. :-)
>
> 2010-12-08 Doug Evans <dje@google.com>
>
> * symfile.h (quick_symbol_functions): Clarify usage of
> expand_symtabs_with_filename.
> * dwarf2read.c (dw2_expand_symtabs_with_filename): Only iterate over
> comp units, not type units.
btw, for future reference,
TUs (DW_TAG_type_unit) can share line tables.
E.g. a program may have 95000 TUs but there may be only 5000 line
tables for all of them.
There may be more work that's needed here, and going forward we'll
want to support such sharing.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [commit]: dw2_expand_symtabs_with_filename: ignore type units
2010-12-08 18:11 [commit]: dw2_expand_symtabs_with_filename: ignore type units Doug Evans
2010-12-08 18:16 ` Doug Evans
@ 2010-12-09 8:29 ` Yao Qi
2010-12-09 15:43 ` Doug Evans
1 sibling, 1 reply; 6+ messages in thread
From: Yao Qi @ 2010-12-09 8:29 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb-patches
On 12/09/2010 02:10 AM, Doug Evans wrote:
> + The routine may ignore debug info that is known to not be useful with
Shall we use "not to be" or "to not be" in comments above?
--
Yao (é½å°§)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [commit]: dw2_expand_symtabs_with_filename: ignore type units
2010-12-09 8:29 ` Yao Qi
@ 2010-12-09 15:43 ` Doug Evans
0 siblings, 0 replies; 6+ messages in thread
From: Doug Evans @ 2010-12-09 15:43 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
On Thu, Dec 9, 2010 at 12:29 AM, Yao Qi <yao@codesourcery.com> wrote:
> On 12/09/2010 02:10 AM, Doug Evans wrote:
>> + The routine may ignore debug info that is known to not be useful with
>
> Shall we use "not to be" or "to not be" in comments above?
I like the current wording.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [commit]: dw2_expand_symtabs_with_filename: ignore type units
2010-12-08 18:16 ` Doug Evans
@ 2010-12-09 16:39 ` Tom Tromey
2010-12-14 4:03 ` Doug Evans
0 siblings, 1 reply; 6+ messages in thread
From: Tom Tromey @ 2010-12-09 16:39 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb-patches
>>>>> "Doug" == Doug Evans <dje@google.com> writes:
Doug> TUs (DW_TAG_type_unit) can share line tables.
Doug> E.g. a program may have 95000 TUs but there may be only 5000 line
Doug> tables for all of them.
Doug> There may be more work that's needed here, and going forward we'll
Doug> want to support such sharing.
Could you file a bug report for this?
thanks,
Tom
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [commit]: dw2_expand_symtabs_with_filename: ignore type units
2010-12-09 16:39 ` Tom Tromey
@ 2010-12-14 4:03 ` Doug Evans
0 siblings, 0 replies; 6+ messages in thread
From: Doug Evans @ 2010-12-14 4:03 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
On Thu, Dec 9, 2010 at 8:38 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Doug" == Doug Evans <dje@google.com> writes:
>
> Doug> TUs (DW_TAG_type_unit) can share line tables.
> Doug> E.g. a program may have 95000 TUs but there may be only 5000 line
> Doug> tables for all of them.
> Doug> There may be more work that's needed here, and going forward we'll
> Doug> want to support such sharing.
>
> Could you file a bug report for this?
[just closing this thread]
I've caught all the cases I'm aware of in .gdb_index support, so I'm
going to skip the bug report for now.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-12-14 4:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-08 18:11 [commit]: dw2_expand_symtabs_with_filename: ignore type units Doug Evans
2010-12-08 18:16 ` Doug Evans
2010-12-09 16:39 ` Tom Tromey
2010-12-14 4:03 ` Doug Evans
2010-12-09 8:29 ` Yao Qi
2010-12-09 15:43 ` Doug Evans
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox