[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/28044] New: Add LSDA decoding to readelf

From: woodard at redhat dot com
Subject: [Bug binutils/28044] New: Add LSDA decoding to readelf
Date: Thu, 01 Jul 2021 17:34:42 +0000


            Bug ID: 28044
           Summary: Add LSDA decoding to readelf
           Product: binutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: woodard at redhat dot com
  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 readelf
were able to decode the LSDA and print it in a human understandable form.

I propose a feature that does this:

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

and maybe:

readelf --exceptions

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

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
(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=frames 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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]