]> git.ipfire.org Git - thirdparty/elfutils.git/commit
eu-stacktrace [4/5]: src: add unwind origin diagnostics to eu-stack
authorSerhei Makarov <serhei@serhei.io>
Sat, 12 Oct 2024 19:26:06 +0000 (15:26 -0400)
committerSerhei Makarov <serhei@serhei.io>
Thu, 17 Oct 2024 23:31:29 +0000 (19:31 -0400)
commit7d2bafe1b5a4aacf245f93a3dec126a54925af12
tree88ffe8a27be64c6e742b6bfab641426045297157
parent77b38e21221f6beed586286110a8cb4927d21ac1
eu-stacktrace [4/5]: src: add unwind origin diagnostics to eu-stack

Since we obtain diagnostics about unwind method, another logical place
to show them is in eu-stack.

* src/stack.c (show_unwound_source): New global variable.
  (struct frame): Add unwound_source field.
  (frame_callback): Copy over unwound_source from Dwfl_Frame.
  (print_frame): Take unwound_source string and print it.
  (print_inline_frames): Take unwound_source argument and pass it on,
  except for subsequent frames where we pass the string "inline".
  (print_frames): Take unwound_source field from struct frame and pass
  it on.
  (parse_opt): Add --cfi-type,-c option to set show_unwound_source.
  (main): Ditto.
* tests/run-stack-i-test.sh: Add testcase for --cfi-type.

Signed-off-by: Serhei Makarov <serhei@serhei.io>
src/stack.c
tests/run-stack-i-test.sh