This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

dwarf_edit with ref-maker


I've got dwarf_edit copy-construction working well with references.
This uses the "ref maker" (c++/dwarf_ref_maker), which is a cousin
of the ref tracker.  The basic dwarf_ref_maker that supports this
kind of copying is simple (and doesn't use the tracker machinery),
it just holds onto back-pointers to in all reference attributes
until the whole DIE tree is copied to fill in the correspondences
between from-file DIEs and copied-file DIEs.

As with dwarf_edit in general, that is the simplest-case prototype
for what will be fancier in dwarf_output.  The idea is the collector
will be a combination of ref tracker and ref maker, able to identify
refs to identical DIEs to consolidate.

Getting the dwarf_edit construction all really right involved some
more rejiggering of the innards.  It's gone back to dwarf_output not
compiling (commented out in dwarfcmp), but I will attack that next.

For testing, -T is happy now, and if we believe the ref tracker is
working for real file-file comparisons then -T indicates that the
ref maker for building dwarf_edit is working right too (including
circularities et al).

I've also tweaked tests/dwarf-print (in printing code all shared with
tests/dwarf_edit) so it can be used for a bit more testing of this
stuff.  Making that work revealed some missing bits in various places
and broken bits in the location list accessors, so I've fixed those.
The xmlish printing is done in a generically-consistent way so that it
should look the same for any of the different implementation objects.
Those tests will take --{edit,output} to do a copy-construction and
print the copy, testing either implementation.  Those should match the
output you get from the same test with --sort-attrs, i.e. the input
object but with attribute order canonicalized for display.  
So you could e.g.:
	diff -u <(dwarf-print --sort-attrs foo) <(dwarf-print --output foo)
Presumably that is slower than dwarfcmp doing it, but atm -T always
does umpteen copies of the test so it may well be slower than printing
text and diff'ing.  I figure it will be handy for debugging to eyeball
any differences dwarf-print --{edit,output} produces from the original
when the output objects are going wrong.


Thanks,
Roland

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]