MCPcopy Create free account
hub / github.com/aclements/libelfin / dump_tree

Function dump_tree

examples/dump-tree.cc:9–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7using namespace std;
8
9void
10dump_tree(const dwarf::die &node, int depth = 0)
11{
12 printf("%*.s<%" PRIx64 "> %s\n", depth, "",
13 node.get_section_offset(),
14 to_string(node.tag).c_str());
15 for (auto &attr : node.attributes())
16 printf("%*.s %s %s\n", depth, "",
17 to_string(attr.first).c_str(),
18 to_string(attr.second).c_str());
19 for (auto &child : node)
20 dump_tree(child, depth + 1);
21}
22
23int
24main(int argc, char **argv)

Callers 1

mainFunction · 0.85

Calls 3

to_stringFunction · 0.85
attributesMethod · 0.80
get_section_offsetMethod · 0.45

Tested by

no test coverage detected