proc/gdbserial: do not return floating point regs when not requested (#1497)

Fixes #1493
This commit is contained in:
Alessandro Arzilli
2019-02-26 17:53:45 +01:00
committed by Derek Parker
parent 0e1c742787
commit 14aeea2bd9
11 changed files with 47 additions and 18 deletions

View File

@ -847,3 +847,19 @@ func TestTruncateStacktrace(t *testing.T) {
}
})
}
func TestIssue1493(t *testing.T) {
// The 'regs' command without the '-a' option should only return
// general purpose registers.
withTestTerminal("continuetestprog", t, func(term *FakeTerminal) {
r := term.MustExec("regs")
nr := len(strings.Split(r, "\n"))
t.Logf("regs: %s", r)
ra := term.MustExec("regs -a")
nra := len(strings.Split(ra, "\n"))
t.Logf("regs -a: %s", ra)
if nr > nra/2 {
t.Fatalf("'regs' returned too many registers (%d) compared to 'regs -a' (%d)", nr, nra)
}
})
}