public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [Dwarf Patch] Improve pubnames and pubtypes generation. (issue 6197069)
@ 2012-05-18 23:34 saugustine
  2012-05-19 15:21 ` Jason Merrill
  0 siblings, 1 reply; 14+ messages in thread
From: saugustine @ 2012-05-18 23:34 UTC (permalink / raw)
  To: jason.merrill; +Cc: gcc-patches, reply

Hi Jasaon,

Thanks so much for reviewing this patch. I realize it is a lot to see.

The motivation and new dwarf attributes and tags all stem from the debug
fission project as described at http://gcc.gnu.org/wiki/DebugFission. I
have several more patches dealing with fission coming.

Fission has been discussed in the Dwarf standardization meetings.

Thanks again, I am happy to make the changes you deem necessary.


http://codereview.appspot.com/6197069/diff/1/gcc/dwarf2out.c
File gcc/dwarf2out.c (left):

http://codereview.appspot.com/6197069/diff/1/gcc/dwarf2out.c#oldcode22231
gcc/dwarf2out.c:22231: FOR_EACH_VEC_ELT (pubname_entry, pubtype_table,
i, p)
On 2012/05/18 22:39:18, Jason Merrill wrote:
> You don't seem to have added anything to output_pubnames to avoid
emitting
> entries for pruned types.

The code I removed doesn't deal with omitting individual entries.
Instead, it decides whether to emit the pubtypes section at all--if it
is empty, then don't emit it. Pruned entries are handled as they always
were in output_pubnames.

What this code did was to check if the pubtypes section was emptied via
pruning. If it was, then don't emit it.

However, now that there is the DW_AT_GNU_pubtypes attribute that points
to the section, we need to emit the label no matter what. The presence
of this attribute helps the consumer know the difference between "No
pubtypes were present in the source" and "The compiler didn't generate
pubtypes."

http://codereview.appspot.com/6197069/diff/1/gcc/dwarf2out.c
File gcc/dwarf2out.c (right):

http://codereview.appspot.com/6197069/diff/1/gcc/dwarf2out.c#newcode8070
gcc/dwarf2out.c:8070: add_AT_lineptr (die, DW_AT_GNU_pubnames,
debug_pubnames_section_label);
On 2012/05/18 22:39:18, Jason Merrill wrote:
> What are these attributes for?  Is there a proposal to add them?
pubnames/types
> are used for lookup from a name to a DIE, so there seems to be no
reason to have
> a pointer the other way.

The entire motivation for this patch, including the proposed new
attributes is at:

http://gcc.gnu.org/wiki/DebugFission

In particular, the section titled, "Building a GDB Index".
(Unfortunately, there isn't an anchor to that section easily linkable.)
This was discussed at the past couple of dwarf standardization meetings.

http://codereview.appspot.com/6197069/diff/1/gcc/dwarf2out.c#newcode8162
gcc/dwarf2out.c:8162: || is_cu_die (die->die_parent) || is_namespace_die
(die->die_parent))
On 2012/05/18 22:39:18, Jason Merrill wrote:
> The DWARF standard says that pubnames is for names with global scope;
this
> change would add namespace-scope statics as well.

I am matching what gold and gdb do when building the gdb index. I
suppose Cary will need to add this subtle change to the proposal, and I
can also guard it with "dwarf_split_debug_info".

http://codereview.appspot.com/6197069/diff/1/gcc/dwarf2out.c#newcode9177
gcc/dwarf2out.c:9177: add_pubtype (type, base_type_result);
On 2012/05/18 22:39:18, Jason Merrill wrote:
> Why do we need pubtype entries for base types?

Same as above--to make these addable to the index, which in turn makes
gdb faster. I'll add this to the note to Cary.

http://codereview.appspot.com/6197069/diff/1/gcc/dwarf2out.c#newcode19010
gcc/dwarf2out.c:19010: /* Bypass dwarf2_name's check for DECL_NAMELESS.
*/
On 2012/05/18 22:39:18, Jason Merrill wrote:
> Why bypass the DECL_NAMELESS check?

So objects within anonymous namespaces get pubnames:

namespace { void some_function...


> Can you point me at discussion about adding enumerators and namespaces
to
> pubnames?  Historically it has just been for things with addresses
(the standard
> says "objects and functions").

This is all about making every name gdb might need public. Yet another
note to add to the proposal, I suppose. I will see to it that Cary does.

http://codereview.appspot.com/6197069/

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: [Dwarf Patch] Improve pubnames and pubtypes generation. (issue 6197069)
@ 2012-06-07 21:47 saugustine
  0 siblings, 0 replies; 14+ messages in thread
From: saugustine @ 2012-06-07 21:47 UTC (permalink / raw)
  To: jason.merrill, ccoutant, jason; +Cc: gcc-patches, reply

On 2012/06/01 17:58:41, saugustine wrote:
> The enclosed patch updates the earlier patch to address all of the
feedback I
> have gotten regarding generating pubnames. It fixes the offset problem
in
> the pubtypes table; switches DW_AT_pubtypes to a flag and so on.

> It also adds and documents a new option "-g[no-]pubtypes" which allows
users
> to generate pubtypes even if the target disables them by default.

> Tested with bootstrap and running the test_pubnames_and_indices.py
script
> recently contributed to the GDB project.


Ping? I have another patch that depends on this one coming.

http://codereview.appspot.com/6197069/

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: [Dwarf Patch] Improve pubnames and pubtypes generation. (issue 6197069)
@ 2012-05-18 22:39 jason.merrill
  0 siblings, 0 replies; 14+ messages in thread
From: jason.merrill @ 2012-05-18 22:39 UTC (permalink / raw)
  To: saugustine; +Cc: gcc-patches, reply

This patch makes a lot of changes to the behavior of .debug_pubnames
that I haven't seen any discussion of, and that don't seem obvious to
me.  Can you point me at discussion threads?


http://codereview.appspot.com/6197069/diff/1/gcc/dwarf2out.c
File gcc/dwarf2out.c (left):

http://codereview.appspot.com/6197069/diff/1/gcc/dwarf2out.c#oldcode22231
gcc/dwarf2out.c:22231: FOR_EACH_VEC_ELT (pubname_entry, pubtype_table,
i, p)
You don't seem to have added anything to output_pubnames to avoid
emitting entries for pruned types.

http://codereview.appspot.com/6197069/diff/1/gcc/dwarf2out.c
File gcc/dwarf2out.c (right):

http://codereview.appspot.com/6197069/diff/1/gcc/dwarf2out.c#newcode8070
gcc/dwarf2out.c:8070: add_AT_lineptr (die, DW_AT_GNU_pubnames,
debug_pubnames_section_label);
What are these attributes for?  Is there a proposal to add them?
pubnames/types are used for lookup from a name to a DIE, so there seems
to be no reason to have a pointer the other way.

http://codereview.appspot.com/6197069/diff/1/gcc/dwarf2out.c#newcode8162
gcc/dwarf2out.c:8162: || is_cu_die (die->die_parent) || is_namespace_die
(die->die_parent))
The DWARF standard says that pubnames is for names with global scope;
this change would add namespace-scope statics as well.

http://codereview.appspot.com/6197069/diff/1/gcc/dwarf2out.c#newcode9177
gcc/dwarf2out.c:9177: add_pubtype (type, base_type_result);
Why do we need pubtype entries for base types?

http://codereview.appspot.com/6197069/diff/1/gcc/dwarf2out.c#newcode19010
gcc/dwarf2out.c:19010: /* Bypass dwarf2_name's check for DECL_NAMELESS.
*/
Why bypass the DECL_NAMELESS check?

Can you point me at discussion about adding enumerators and namespaces
to pubnames?  Historically it has just been for things with addresses
(the standard says "objects and functions").

http://codereview.appspot.com/6197069/

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-06-07 21:26 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-18 23:34 [Dwarf Patch] Improve pubnames and pubtypes generation. (issue 6197069) saugustine
2012-05-19 15:21 ` Jason Merrill
2012-05-21 18:40   ` Cary Coutant
2012-05-22 17:20     ` Jason Merrill
2012-05-22 17:27       ` Sterling Augustine
2012-05-22 17:49       ` Cary Coutant
2012-05-22 18:46         ` Jason Merrill
2012-05-22 20:05           ` Cary Coutant
2012-05-22 21:56             ` Jakub Jelinek
2012-05-29 22:55             ` Cary Coutant
2012-05-30 17:52               ` Cary Coutant
2012-05-30 18:16                 ` Jason Merrill
  -- strict thread matches above, loose matches on Subject: below --
2012-06-07 21:47 saugustine
2012-05-18 22:39 jason.merrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).