RISC-V and fake function debug info in the testsuite

Jim Wilson jimw@sifive.com
Sat Apr 13 00:17:00 GMT 2019


Some of the testsuite testcases construct debug info for functions
that don't exist using Dwarf::assemble.  This is causing trouble for
riscv64-linux.

The problem here is that we have two types of breakpoints, 2-byte and
4-byte.  The easy way to tell which one is safe to use is to read from
target memory.  But if we have debug info for a function that doesn't
exist, pointing at memory locations that don't exist, then reading
target memory at that address fails, causing the breakpoint command to
fail.

This feature can be turned off, and gdb forced to always use a 2-byte
or 4-byte breakpoint which does not require reading target memory.  I
tried this, and found that this fixed 46 testsuite failures in
gdb.cp/nsalias.exp and 1 testsuite failure in
gdb.dwarf2/inlined_subroutine-inheritance.exp.

The question is what to do next.  I don't want to turn this feature
off by default for the testsuite, as we should be testing it.  We
could modify the two testcases to add RISC-V specific support that
turns the feature off for these testcases.  We just need to send one
command to gdb at the start "set riscv use-compressed-breakopints on"
or off but not auto which is the default.  Or maybe there is a more
general way that we can fix this?

Jim



More information about the Gdb mailing list