Mark Wielaard [Wed, 30 Mar 2011 10:44:14 +0000 (12:44 +0200)]
dwarflint: Allow DW_AT_ranges with const form, as gnu version 2 extension.
Without -gstrict-dwarf gcc allows usage of attributes from
later versions. One strange case is DW_AT_ranges in version 2
since that version doesn't actually define a rangelistptr
class. This case is added in the form_allowed override for dwarf_gnu,
for version 2. In gnu mode form_allowed checks both variants, source
and extension, in no-gnu mode, only the latest is allowed.
Mark Wielaard [Wed, 30 Mar 2011 15:09:17 +0000 (17:09 +0200)]
Add DW_AT_GNU_call attributes to dwarf-knowledge.cc.
DW_AT_GNU_call_site_value, DW_AT_GNU_call_site_data_value,
DW_AT_GNU_call_site_target and DW_AT_GNU_call_site_target_clobbered
describe locations. DW_AT_GNU_tail_call, DW_AT_GNU_all_tail_call_sites,
DW_AT_GNU_all_call_sites and DW_AT_GNU_all_source_call_sites are flags.
Petr Machata [Mon, 28 Mar 2011 22:54:48 +0000 (00:54 +0200)]
dwarflint: Add filtering of duplicate messages
- we use the first string component of stream implementation of wr_message
as a key to decide whether we've seen the message before. Most of the
messages use streams, is why it's like that. When (if) we get back to
formatting strings, that string should be even better key, because there
will be less chance for compiler to do duplicate elimination etc.
Petr Machata [Thu, 24 Mar 2011 16:44:12 +0000 (17:44 +0100)]
dwarflint: Add check_die_tree pass for generic per-DIE checks
- add reg_die_check for registering per-DIE check passes
- turn check_registrar into a template to allow reuse among reg<> and
reg_die_check<>
- the per-DIE checking magic is in check_die_tree.hh
- hide most of checks.hh into dwarflint.cc. That has little to do
with per-DIE checks as such, but was a necessary cleanup
Mark Wielaard [Tue, 22 Mar 2011 22:03:31 +0000 (23:03 +0100)]
Add support for call_site and entry_value to dwarf.h and readelf.
New tags DW_TAG_GNU_call_site and DW_TAG_GNU_call_site_parameter.
New attributes DW_AT_GNU_call_site_value,
DW_AT_GNU_call_site_data_value, DW_AT_GNU_call_site_target,
DW_AT_GNU_call_site_target_clobbered, DW_AT_GNU_tail_call,
DW_AT_GNU_all_tail_call_sites, DW_AT_GNU_all_call_sites,
and DW_AT_GNU_all_source_call_sites.
New operation DW_OP_GNU_entry_value.
Mark Wielaard [Fri, 18 Feb 2011 19:16:03 +0000 (20:16 +0100)]
Calculate reference hash before finalizing, store in die_info.
Follows whole reference chain (ignoring children) and combines
local references of all dies found. Reduces number of attr_set
collisions a lot. Unfortunately there are circular reference
chains for some larger c++ programs. That was unexpected.
Needs cycle detection to figure out what is going on.
Mark Wielaard [Thu, 20 Jan 2011 15:23:48 +0000 (16:23 +0100)]
Turn copier::entry into a value_reference so what_space works on it.
copier::entry is used as a value_reference when an attr_value has a
dangling reference to a DIE not yet built in the output. So make sure
its type matches that usage.
Mark Wielaard [Thu, 20 Jan 2011 14:28:59 +0000 (15:28 +0100)]
Introduce local_hash for dwarf_output debug_info_die.
Very simplistic local_hash implementation. Just takes tag name,
attributes and children sizes into account. But is good enough to
make all the dwarf_edit_output tests pass. Some dwarfcmp-test-self
tests fail though. it also generates a significant number of
collissions for the dwarf_output_collector attr_sets.
Petr Machata [Thu, 10 Mar 2011 15:03:18 +0000 (16:03 +0100)]
dwarflint: Fix "die chain not terminated by a null entry" for CU DIE
- CU DIE is not part of DIE chain, it's a singleton (with optional null
entries following it as padding)
- consequently, don't emit this message for CU DIE, and change it to full
error for all other cases
Petr Machata [Thu, 3 Mar 2011 16:02:47 +0000 (17:02 +0100)]
dwarflint: Be lazy when looking into CU headers for check_debug_abbrev
- And so don't complain that we have no headers in cases where we have
no abbrevs either.
- Also consider no abbrevs a message, not an error
- Add a test case for the same
Petr Machata [Thu, 3 Mar 2011 13:24:27 +0000 (14:24 +0100)]
dwarflint: Fix all-dies-it
- Account for the case that die.has_children and at the same time
die.children().begin() == die.children().end()
- Change the algorithm to iterate DIEs acually in pre-order
- Add a test case