options to sort
martin-paul opened this issue · comments
Hi,
first of all thanks for the great tool - it helps investigating the DWARF structure.
It is neverthelss quite hard to navigate in a bigger dwarf file. A major improvement for navigating the DIEs would be the possibility to give the option to sort also by name instead of debug_info address (applicable for all hierarchy levels simulatnously)
Please clarify the "all levels" thing. Do you mean - ignore the tree hierarchy and just list the DIEs with a name in sorted order?
Also, most DIEs don't have a name.
What's your business case, anyway? Are you having trouble finding a particular function or class? That's what sorting is for.
with all level sorting i mean sort within each hierarchy level:
if the current structure would look like this
test.cpp
- DW_TAG_namespace:std
main.cpp
- DW_TAG_namespace: std
** DW_TAG_imported_module
** DW_TAG_const_type - DW_TAG_const_type
after sorting within all hierarchy levels would look like:
main.cpp
- DW_TAG_const_type
- DW_TAG_namespace: std
** DW_TAG_const_type
** DW_TAG_imported_module
test.cpp
- DW_TAG_namespace:std
I am currently writing a dwarf parser & extractor in java. Your tool helps me investigating bugs 👍 but when i check for a larger DWARF file and check for certain DIEs, it can take quite a while to naviagate to the element of interest (at later stages of my tool, the relative CU addresses are no longer accessible so i need to rely on for example on TAG + filename + namespace + name)
I see what you mean. I misunderstood, thought you meant sorting by the name attribute, but it looks what you're after is sorting by DIE tag, then by name.
It's possible, give me a couple of days. I'll probably decouple sorting CUs in the file from sorting DIEs - there's an obvious, natural sorting order for CUs, and it makes sense to make them sorted by default.
That said, if sorted, a typical CU child set would have a bunch of array_types, then base_types, then const_types, and so forth. I hope that's what you're looking for :)
yes exactly, thanks in advance ! :)
Published, please take a look.
works like a charm - thanks a lot sevaa ! :)