qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] target/ppc: gdbstub single-step broken since TranslatorOps conversion
@ 2018-06-29 12:17 Mark Cave-Ayland
  2018-06-29 18:18 ` Emilio G. Cota
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Cave-Ayland @ 2018-06-29 12:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc@nongnu.org, Emilio G. Cota, Richard Henderson

Hi all,

Whilst trying to debug an issue in OpenBIOS, I noticed that the gdbstub 
single-step functionality was broken which I bisected down to this commit:


$ git bisect bad
b0c2d5213a14f8b9d44096ee879a5d7f10fbc505 is the first bad commit
commit b0c2d5213a14f8b9d44096ee879a5d7f10fbc505
Author: Emilio G. Cota <cota@braap.org>
Date:   Thu Feb 15 14:51:49 2018 -0500

     target/ppc: convert to TranslatorOps

     A few changes worth noting:

     - Didn't migrate ctx->exception to DISAS_* since the exception field is
       in many cases architecturally relevant.

     - Moved the cross-page check from the end of translate_insn to 
tb_start.

     - Removed the exit(1) after a TCG temp leak; changed the fprintf 
there to
       qemu_log.

     Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
     Signed-off-by: Emilio G. Cota <cota@braap.org>
     Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


The reproducer is fairly easy:

1) Grab a debug-enabled OpenBIOS from 
http://www.ilande.co.uk/tmp/qemu/openbios-qemu.elf.nostrip.

2) Launch QEMU as follows:

./qemu-system-ppc -M mac99 -bios openbios-qemu.elf.nostrip -nographic -s -S

3) From a separate session:

$ powerpc-linux-gdb openbios-qemu.elf.nostrip
GNU gdb (GDB) 8.1
Copyright (C) 2018 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-pc-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) b ob_pci_init
Breakpoint 1 at 0xfff25c58: file 
/home/build/src/openbios/openbios.git/openbios/drivers/pci.c, line 2020.
(gdb) target remote :1234
Remote debugging using :1234
warning: (Internal error: pc 0xfff00100 in read in psymtab, but not in 
symtab.)

warning: (Internal error: pc 0xfff00100 in read in psymtab, but not in 
symtab.)

warning: (Internal error: pc 0xfff00100 in read in psymtab, but not in 
symtab.)

warning: (Internal error: pc 0xfff00100 in read in psymtab, but not in 
symtab.)

warning: (Internal error: pc 0xfff00100 in read in psymtab, but not in 
symtab.)

vector.0x100 () at 
/home/build/src/openbios/openbios.git/openbios/arch/ppc/qemu/start.S:284
284             b       _entry
warning: (Internal error: pc 0xfff00100 in read in psymtab, but not in 
symtab.)

warning: (Internal error: pc 0xfff00100 in read in psymtab, but not in 
symtab.)

warning: (Internal error: pc 0xfff00100 in read in psymtab, but not in 
symtab.)

warning: (Internal error: pc 0xfff00100 in read in psymtab, but not in 
symtab.)

(gdb) c
Continuing.

Breakpoint 1, ob_pci_init () at 
/home/build/src/openbios/openbios.git/openbios/drivers/pci.c:2020
2020        pci_config_t config = {}; /* host bridge */
(gdb) n
2021        phandle_t phandle_host = 0, intc;
(gdb) n
2025        activate_device("/");
(gdb) n

(hangs)


Hitting CTRL-C sometimes allows the single-step to continue but raises a 
SIGINT at address 0x400 which is in the CPU exception table.


ATB,

Mark.

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

end of thread, other threads:[~2018-06-29 18:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-29 12:17 [Qemu-devel] target/ppc: gdbstub single-step broken since TranslatorOps conversion Mark Cave-Ayland
2018-06-29 18:18 ` Emilio G. Cota
2018-06-29 18:38   ` Mark Cave-Ayland
2018-06-29 18:56     ` Emilio G. Cota

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).