Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* RISC-V and fake function debug info in the testsuite
@ 2019-04-13  0:17 Jim Wilson
  2019-04-13 18:18 ` Jim Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: Jim Wilson @ 2019-04-13  0:17 UTC (permalink / raw)
  To: gdb

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: RISC-V and fake function debug info in the testsuite
  2019-04-13  0:17 RISC-V and fake function debug info in the testsuite Jim Wilson
@ 2019-04-13 18:18 ` Jim Wilson
  0 siblings, 0 replies; 2+ messages in thread
From: Jim Wilson @ 2019-04-13 18:18 UTC (permalink / raw)
  To: gdb

On Fri, Apr 12, 2019 at 5:17 PM Jim Wilson <jimw@sifive.com> wrote:
> The question is what to do next.

On second thought, I realized I can fix it by wrapping the target
memory read in a try/catch.  I'm just not used to fixing problems that
way.  That defers the error from when we set the breakpoint to when we
try to run, at which point we get an error trying to write a
breakpoint instruction to an invalid address, which seems to be the
way that this works on other targets.  I already tried that and it
does fix the testsuite failures that I'm looking at.

Jim


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-13 18:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-13  0:17 RISC-V and fake function debug info in the testsuite Jim Wilson
2019-04-13 18:18 ` Jim Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox