[Bug default/19621] New: Add a way to detect if debug info is empty/missing for the command-line tools

michi.henning at canonical dot com sourceware-bugzilla@sourceware.org
Fri Jan 1 00:00:00 GMT 2016


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

            Bug ID: 19621
           Summary: Add a way to detect if debug info is empty/missing for
                    the command-line tools
           Product: libabigail
           Version: unspecified
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: default
          Assignee: dodji at redhat dot com
          Reporter: michi.henning at canonical dot com
                CC: libabigail at sourceware dot org
  Target Milestone: ---

I'm pasting some test from the mailing list discussion below. It would be
really nice to have a way to find out whether I'm accidentally running the tool
against libs that weren't compiled with -g.

One thing to keep in mind that the exit status will rapidly run out of bits, so
it might be worth thinking about some other way to communicate such details to
the caller.

---------

One thing I have to deal with is that the unit tests may be run with release
mode locally, in which case the binaries are compiled without -g.

I can run abidw on the shared lib, but the ABI dump that is generated doesn’t
contain any useful info for doing a real ABI compliance test. When I run

   abidiff baseline_with_debug_dump current_without_debug_dump

abidiff tells me that everything is fine. This is awkward because it gives me a
possibly false negative. The code that was compiled might indeed break the ABI
but, because it was compiled without -g, abidiff gives the wrong answer.

Currently, I’m using this as a work-around:
# If the current lib doesn't contain debug info, we can't run the test.
info_file=$(mktemp)
readelf --debug-dump=info @CMAKE_BINARY_DIR@/${libname}.so >$info_file
[ $? -ne 0 ] && exit 1
[ -s $info_file ]
no_debug_info=$?
rm -f $info_file
[ $no_debug_info -eq 1 ] && {
   echo "${progname}: Skipping ABI test because ${libname}.so was compiled
without -g"
   exit 0
}

But this is quite awkward and costly, and I need to drag binutils into my
build, which I otherwise wouldn’t need.

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


More information about the Libabigail mailing list