https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90901

            Bug ID: 90901
           Summary: Debug information broken when compiled with
                    gdwarf-split
           Product: gcc
           Version: 8.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rajpal.gusain at gmail dot com
  Target Milestone: ---

% g++ --version
g++ (GCC) 8.3.0

% gdb --version
GNU gdb (GDB) 8.3

% readelf --version
GNU readelf (GNU Binutils) 2.32

I couldn't reproduce this issue on a small test case which seems to work fine.
When I build executable with gdwarf-split option, it looks like debug
information is broken. And when I do the same but with Clang, I don't see any
issue with debug information.


Issue :
When I loaded my binary in gdb, it failed to put breakpoint with error message
like this

this=<error reading variable: DW_FORM_strp pointing outside of .debug_str
section [in module <filename>.dwo]>

I thought that I should check if there is any problem in debug information, and
I tried to read it using readelf and I got errors there too (pasted only few,
there are many more which seem to be similar)

readelf: Error:  Unknown macro opcode 8b seen
readelf: Error:  Unknown macro opcode c2 seen
readelf: Error:  Unknown macro opcode ec seen
readelf: Error:  Unknown macro opcode c7 seen
readelf: Error:  Unknown macro opcode 60 seen
readelf: Error:  Unknown macro opcode 5f seen
readelf: Error:  Unknown macro opcode ba seen
readelf: Error: DW_MACRO_start_file used, but no .debug_line offset provided.
readelf: Error:  Unknown macro opcode 8d seen
readelf: Error:  Unknown macro opcode 9e seen
readelf: Error:  Unknown macro opcode b6 seen
readelf: Error:  Unknown macro opcode e3 seen
readelf: Error:  Unknown macro opcode 92 seen
readelf: Error:  Unknown macro opcode cd seen
readelf: Error:  Unknown macro opcode 8d seen
readelf: Error:  Unknown macro opcode 2e seen
readelf: Error:  Unknown macro opcode bc seen
readelf: Error:  Unknown macro opcode 51 seen
readelf: Error: .debug_macro section not zero terminated
readelf: Error:  Unknown macro opcode c7 seen
readelf: Error:  Unknown macro opcode f9 seen
readelf: Error:  Unknown macro opcode e3 seen
readelf: Error:  Unknown macro opcode 2b seen
readelf: Error:  Unknown macro opcode f9 seen
readelf: Error: .debug_macro section not zero terminated

I'm not sure if information is good enough to nail down the issue. I'm happy to
provide more information if it helps fix this issue quickly.

Reply via email to