target-ppc: gdbstub breakpoints get stuck in an infinite loop on next/continue
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 75 lines
Hi all,
I've just noticed the above regression in git master whilst trying to debug something in openbios-ppc via QEMU's gdbstub. Reproduction here is fairly easy using a debug build of OpenBIOS which I've uploaded to
https://www.ilande.co.uk/tmp/qemu/openbios-qemu.elf.nostrip for people to test against../qemu-system-ppc -bios openbios-qemu.elf.nostrip -s -S
The infinite loop can be seen by adding a breakpoint to the OpenBIOS
boot()function using gdb as below:$ powerpc-linux-gdb obj-ppc/openbios-qemu.elf.nostrip GNU gdb (GDB) 7.9.1 Copyright (C) 2015 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=powerpc-linux". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from obj-ppc/openbios-qemu.elf.nostrip...done. (gdb) target remote :1234 Remote debugging using :1234vector.0x100 () at
/home/build/src/openbios/openbios.git/openbios/arch/ppc/qemu/start.S:284
284 b_entry(gdb) b boot
Breakpoint 1 at
0xfff0bc00: file/home/build/src/openbios/openbios.git/openbios/arch/ppc/qemu/main.c, line 75.(gdb) c
Continuing.Program received signal SIGTRAP, Trace/breakpoint trap.
0xfff0bbfcin boot () at/home/build/src/openbios/openbios.git/openbios/arch/ppc/qemu/main.c:74
74 {
(gdb) nAt this point the gdb session hangs whilst the GTK window title is constantly switching between paused/unpaused.
A session with git bisect shows the bug was introduced with the following commit:
bd6fefe71cec5a0c7d2be4ac96307f25db56abf9is the first bad commit commitbd6fefe71cec5a0c7d2be4ac96307f25db56abf9Author: Benjamin Herrenschmidt <[email protected]> Date: Wed Jul 27 16:56:32 2016 +1000ppc: Make
tlb_fill()use new exception helperSigned-off-by Benjamin Herrenschmidt <[email protected]>Signed-off-by David Gibson <[email protected]>:040000 040000
3494b2d68eef71c8f7c7d4e57c5ff715146028b200849bf5889d8ee5b5ce633122b7aedf4a734372M linux-user
:040000 04000032b1a8078a44c44e6bfd2184061b6da553cfc82158afefec7a9fc5380fb408758a11dbe749010b97M target-ppc
Quoted 3 lines
ATB,
Mark.
Excellent job. I thought it was something I was doing wrong when I tried to debug OpenBIOS using gdb.