Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract module path info from DWARF #151

Closed
japaric opened this issue Aug 31, 2020 · 0 comments · Fixed by #167
Closed

extract module path info from DWARF #151

japaric opened this issue Aug 31, 2020 · 0 comments · Fixed by #167
Assignees
Labels
type: enhancement Enhancement or feature request

Comments

@japaric
Copy link
Member

japaric commented Aug 31, 2020

while doing #19 it seemed possible to also compute the module path (krate::module::function) of each log statement.
we could include that info in the probe-run output as a lighter version alternative to the full path (or as complementary info)

implementation notes:

  • while traversing the DIE (Debugging Information Entry) tree
  • when entering a DW_TAG_namespace node read the DW_AT_name attribute and use that as a segment; push that into a path
  • when leaving the DW_TAG_namespace node remove (pop) the segment you added to path
  • when you encounter a DEFMT_LOG_STATEMENT variable (a log statement) attach the current path to it
  • I recommend running dwarfdump on the firmware image you are working on to visualize the DIE tree
  • I'm unsure if DIE from other crates need special handling
@japaric japaric added the type: enhancement Enhancement or feature request label Aug 31, 2020
@japaric japaric self-assigned this Sep 7, 2020
japaric added a commit that referenced this issue Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Enhancement or feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant