[PATCH V5] PowerPC: fix for gdb.base/eh_return.exp

Carl Love cel@us.ibm.com
Wed Jun 8 15:33:46 GMT 2022


Will, Pedro, Kevin, GDB maintainers:

I have made the additional fixes to the comments and the setting of the
clang options as mentioned by Will in version 4.  I do not have an
environment where gdb can be built with clang.  But I did check that
the clang options are properly passed to the compile command. 
Unfortunately, extensive testing of gdb built with XLC and clang are
beyond the scope of this patch as I do not have access to such systems.

Per the comments from Kevin, the patch was updated to check for the gcc
and xlc compilers on PowerPC.  The patch was also tested and verified
on AIX which uses the gcc compiler to build gdb.  The attempt to build
gdb using the xlc compiler fails due to unrelated compiler errors.  The
xlc options to disable the Traceback Table was verified but that was
it.

I have updated the patch per the comments from Will.  The new version
of the patch uses a PowerPC specific gcc option to suppress the
generation of the Traceback Table information.  The Traceback
information for this function is contained in the .long statements
following the last instruction in the function.  The Traceback table
consists of a series of bit fields.  The assembler tries to interpret
the Traceback Table as instructions.  If the bits in the Traceback
Table happen to match a known instruction, the assembler will print a
bogus instruction, otherwise the assembler just prints the bits using
the .long statement.  Unfortunately, the disassembler does not know how
to locate the Traceback Table information at the end of a function.

With this patch, the Traceback Table is disabled, so the last
instruction of the function is accurately found.  Previously, the break
point was set at the last .long statement which gdb will never reach. 
The test now passes as gdb successfully executes to the identified last
instruction.

Note, the use of the gcc mtraceback option is not valid on other
architectures.

I have tested the patch on Linux Power 10 with gcc, AIX with the gcc
and Intel with gcc.

Please let me know if this patch is acceptable.  Thanks for the input
and help with the patch.

                          Carl Love

------------------------------------------------------------------



More information about the Gdb-patches mailing list