diff options
author | Chris Johns <chrisj@rtems.org> | 2018-08-07 09:08:25 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2018-08-07 09:11:29 +1000 |
commit | 317d85d71f4b156f6d99342700b8a0867058c4a4 (patch) | |
tree | 890e593d69a97ffd598e79ab3ce88ffc52a81763 /rtemstoolkit/rld-dwarf.cpp | |
parent | 99c90b3353bf5b638dcfd87803e4aaf02adf3219 (diff) |
rtemstoolkit/dwarf: Add types of inline. Report machine code size not span.
- Add the types of inlined functions to the interface.
- Return the machine code for each function and not the address span.
Diffstat (limited to '')
-rw-r--r-- | rtemstoolkit/rld-dwarf.cpp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/rtemstoolkit/rld-dwarf.cpp b/rtemstoolkit/rld-dwarf.cpp index 9cdd84a..e142c43 100644 --- a/rtemstoolkit/rld-dwarf.cpp +++ b/rtemstoolkit/rld-dwarf.cpp @@ -813,6 +813,28 @@ namespace rld return inline_ == DW_INL_inlined || inline_ == DW_INL_declared_inlined; } + function::inlined + function::get_inlined () const + { + inlined i = inl_not_inlined; + switch (inline_) + { + default: + case DW_INL_not_inlined: + break; + case DW_INL_inlined: + i = inl_inline; + break; + case DW_INL_declared_not_inlined: + i = inl_declared_not_inlined; + break; + case DW_INL_declared_inlined: + i = inl_declared_inlined; + break; + } + return i; + } + std::string function::call_file () const { @@ -831,7 +853,18 @@ namespace rld { size_t s = 0; if (!name_.empty () && has_machine_code ()) - s = pc_high () - pc_low (); + { + if (ranges_.empty ()) + s = pc_high () - pc_low (); + else + { + for (auto& r : ranges_.get ()) + { + if (!r.end () && !r.empty ()) + s += r.addr2 () - r.addr1 (); + } + } + } return s; } |