qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 0/4] target/m68k: implement m68k "any instruction" trace mode


From: Mark Cave-Ayland
Subject: [PATCH 0/4] target/m68k: implement m68k "any instruction" trace mode
Date: Wed, 19 May 2021 15:29:13 +0100

This patchset implements the m68k "any instruction" tracing mode which is used
by the NetBSD kernel debugger to implement single-stepping. It is based upon
reading through the M68000 PRM and looking at how the ARM target handles both
gdbstub and architectural single-step exceptions.

With this patchset it becomes possible to single-step the NetBSD kernel using
the in-built kernel debugger:

Stopped in pid 0.1 (system) at  netbsd:cpu_Debugger+0x6:        unlk    a6
db> s
Stopped in pid 0.1 (system) at  netbsd:cpu_Debugger+0x8:        rts
db> 
Stopped in pid 0.1 (system) at  netbsd:main+0x2c:       jsr     kernel_lock_init
        [addr:0x1a38f6 ]
db> 
Stopped in pid 0.1 (system) at  netbsd:kernel_lock_init:        linkw   a6,#0
db> 
Stopped in pid 0.1 (system) at  netbsd:kernel_lock_init+0x4:    clrb    kernel_l
ock     [addr:0x33f400 ]
db> 
Stopped in pid 0.1 (system) at  netbsd:kernel_lock_init+0xa:    clrb    kernel_l
ock_dodebug     [addr:0x35b48c ]
db> 
Stopped in pid 0.1 (system) at  netbsd:kernel_lock_init+0x10:   unlk    a6
db> 
Stopped in pid 0.1 (system) at  netbsd:kernel_lock_init+0x12:   rts
db> c
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
[   1.0000000]     2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 
2016, 2017,
[   1.0000000]     2018, 2019, 2020 The NetBSD Foundation, Inc.  All rights 
reserved.
[   1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
[   1.0000000]     The Regents of the University of California.  All rights 
reserved.

[   1.0000000] NetBSD 9.1 (GENERIC) #0: Sun Oct 18 19:24:30 UTC 2020
... etc ...


Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

[q800-macos-upstream patchset series: 2]

Mark Cave-Ayland (4):
  target/m68k: introduce is_singlestepping() function
  target/m68k: call gen_raise_exception() directly if single-stepping in
    gen_jmp_tb()
  target/m68k: introduce gen_singlestep_exception() function
  target/m68k: implement m68k "any instruction" trace mode

 target/m68k/cpu.h       |  8 +++++++
 target/m68k/translate.c | 51 ++++++++++++++++++++++++++++++++++-------
 2 files changed, 51 insertions(+), 8 deletions(-)

-- 
2.20.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]