public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [Bug tools/28043] New: Add LSDA decoding to eu-readelf
@ 2021-07-01 16:30 woodard at redhat dot com
  2021-07-01 16:53 ` [Bug tools/28043] " woodard at redhat dot com
  2021-07-07 14:34 ` mark at klomp dot org
  0 siblings, 2 replies; 3+ messages in thread
From: woodard at redhat dot com @ 2021-07-01 16:30 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=28043

            Bug ID: 28043
           Summary: Add LSDA decoding to eu-readelf
           Product: elfutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tools
          Assignee: unassigned at sourceware dot org
          Reporter: woodard at redhat dot com
                CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

One thing that is an important aspect of compatibility between libraries and
their consumers (apps and other libraries) are the exceptions thrown and
caught. Ideally you want to make sure that all exceptions that could be thrown
are properly caught

Unfortunately it is currently EXTREMELY difficult to look at an ELF file see
which exceptions are thrown or caught. That information is readily available in
the ELF file it just isn't being decoded. This forces a user to manually
interpret the ELF file and decode the LSDA by hand to list the types. This is
very likely above the level of most developers. It would be nice if eu-readelf
were able to decode the LSDA and print it in a human understandable form.

I propose a feature that does this:

eu-readelf --exceptions-thrown <elf_file>
eu-readelf --exceptions-caught <elf_file>

and maybe:

eu-readelf --exceptions

which effectively is the same as eu-readelf --exceptions-thrown
--exceptions-caught

So far the best descriptions of how to decode those sections that I have been
able to find are: 
https://www.airs.com/blog/archives/464 and
http://www.hexblog.com/wp-content/uploads/2012/06/Recon-2012-Skochinsky-Compiler-Internals.pdf
(start at about page 35)
The code that processes that section in GCC can be found in
gcc/libgcc/unwind-c.c that could be a good reference.

Once you have the LSDA decoding capabilities it may also be worthwhile to print
out the decoded fields when doing --debug-dump=frame and pretty print the
structures pointed to by the LSDA pointers.

There is a possibility that at least at times llvm generates a different
version of the LSDA and so for a fully functional tool you may also want to
decode any flavors of LSDA that llvm may generate as well.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tools/28043] Add LSDA decoding to eu-readelf
  2021-07-01 16:30 [Bug tools/28043] New: Add LSDA decoding to eu-readelf woodard at redhat dot com
@ 2021-07-01 16:53 ` woodard at redhat dot com
  2021-07-07 14:34 ` mark at klomp dot org
  1 sibling, 0 replies; 3+ messages in thread
From: woodard at redhat dot com @ 2021-07-01 16:53 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=28043

--- Comment #1 from Ben Woodard <woodard at redhat dot com> ---
Having code or maybe even an API that decodes the LSDA would also be helpful
for elfutils-libs users like libabigail as they work to resolve issues like:
https://sourceware.org/bugzilla/show_bug.cgi?id=28025

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tools/28043] Add LSDA decoding to eu-readelf
  2021-07-01 16:30 [Bug tools/28043] New: Add LSDA decoding to eu-readelf woodard at redhat dot com
  2021-07-01 16:53 ` [Bug tools/28043] " woodard at redhat dot com
@ 2021-07-07 14:34 ` mark at klomp dot org
  1 sibling, 0 replies; 3+ messages in thread
From: mark at klomp dot org @ 2021-07-07 14:34 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=28043

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mark at klomp dot org

--- Comment #2 from Mark Wielaard <mark at klomp dot org> ---
Note that eu-readelf already tries to decode the .gcc_exception_table when
using -e, --exception. And the .eh_frame decoding already does get the LSDA
pointer encoding from the CIE and should show the pointer for any CFI that has
one. But there is nothing that nicely ties them together.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-07 14:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-01 16:30 [Bug tools/28043] New: Add LSDA decoding to eu-readelf woodard at redhat dot com
2021-07-01 16:53 ` [Bug tools/28043] " woodard at redhat dot com
2021-07-07 14:34 ` mark at klomp dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).