Skip to content

first version of mcdstub

Nicolas Eder qemu-devel 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest18 patches 9 repliesIn review
  2. v417 patches 0 repliesSuperseded
  3. v320 patches 11 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v229 patches9 repliesSuperseded
v11 patch1 replySuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18gdbstub, mcdstub: file and build structure adapted to accomodate for the mcdstubMAINTAINERS debug/common/debug.c debug/common/meson.build +20 more+272 -41 reply
2/18gdbstub: hex conversion functions moved to cutils.hdebug/gdbstub/gdbstub.c debug/gdbstub/internals.h include/qemu/cutils.h+40 -351 reply
3/18gdbstub: GDBRegisterState moved to gdbstub.h so it can be used outside of the gdbstubdebug/gdbstub/gdbstub.c include/exec/gdbstub.h+8 -81 reply
4/18gdbstub: DebugClass added to system mode.debug/common/debug.c debug/common/meson.build debug/gdbstub/system.c +5 more+84 -12 replies
5/18mcdstub: memory helper functions addedinclude/exec/cpu-common.h include/exec/memory.h system/memory.c +1 more+49 -02 replies
6/18mcdstub: -mcd start option added, mcd specific defines addeddebug/mcdstub/mcdstub.c debug/mcdstub/meson.build debug/meson.build +4 more+445 -00 replies
7/18mcdstub: mcdserver initialization functions addeddebug/mcdstub/mcdstub.c+154 -00 replies
8/18cutils: qemu_strtou32 function addedinclude/qemu/cutils.h util/cutils.c+32 -00 replies
9/18mcdstub: TCP packet plumbing addeddebug/mcdstub/mcdstub.c+422 -00 replies
10/18mcdstub: open and close server functions addeddebug/mcdstub/mcdstub.c+214 -850 replies
11/18mcdstub: system and core queries addeddebug/mcdstub/arm_mcdstub.c debug/mcdstub/mcdstub.c debug/mcdstub/meson.build +3 more+717 -72 replies
12/18mcdstub: all core specific queries addeddebug/mcdstub/mcdstub.c+365 -00 replies
13/18mcdstub: go, step and break addeddebug/mcdstub/mcdstub.c+218 -00 replies
14/18mcdstub: state query addeddebug/mcdstub/mcdstub.c+44 -00 replies
15/18mcdstub: skeleton for reset handling addeddebug/mcdstub/mcdstub.c+46 -00 replies
16/18mcdstub: register access addeddebug/mcdstub/mcdstub.c+161 -00 replies
17/18mcdstub: memory access addeddebug/mcdstub/arm_mcdstub.c debug/mcdstub/mcdstub.c include/mcdstub/arm_mcdstub.h+246 -00 replies
18/18mcdstub: break/watchpoints addeddebug/mcdstub/mcdstub.c+150 -00 replies

Reviews trailers per patch

2 of 18 patches have a Reviewed-by or Acked-by.

PatchAlex Bennée
1/18R-b
2/18R-b
3/18
4/18
5/18
6/18
7/18
8/18
9/18
10/18
11/18
12/18
13/18
14/18
15/18
16/18
17/18
18/18

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 00/18] first version of mcdstub

SUMMARY
=======

This patch-set introduces the first version of the mcdstub. The mcdstub is a debug interface, which enables debugging QEMU using the MCD (Multi-Core Debug) API.
The mcdstub uses TCP to communicate with the host debug software. However, because MCD is merely an API, the TCP communication is not part of the MCD spec but specific to this project.

To translate between the MCD API and the TCP data stream coming from the mcdstub, the host has to use a shared library (.dll/.so).
Such a shared library is available at: https://gitlab.com/lauterbach/mcdrefsrv
The MCD API itself can be downloaded here: https://repo.lauterbach.com/sprint_mcd_api_v1_0.zip

QUICK START
===========

Attention: MCD is currently only supported for qemu-system-arm !

Three components are required to Debug QEMU via MCD:

1. qemu-system-arm (built with this patch series applied).
2. MCD shared library (translates between the MCD API and TCP data).
3. Host debugging software with support for the MCD API (e.g. Lauterbach TRACE32).

To activate the mcdstub, just use the "mcd" launch option in combination with a TCP port.

With the default TCP port 1235:

$ qemu-system-arm -M virt -cpu cortex-a15 -mcd default

With a custom TCP port:

$ qemu-system-arm -M virt -cpu cortex-a15 -mcd tcp::1235

QEMU will listen for an MCD host to connect to the specified port.

IMPORTANT CHANGES
=================

1. DebugClass:

This patch-set introduces the DebugClass to the QOM, which is used to abstract GDB/MCD specific debugger details.
It is declared in include/qemu/debug.h, defined in debug/common/debug.c It currently only offers one function: set_stop_cpu, which gets called in cpu_handle_guest_debug in softmmu/cpus.c.
In the future, other functions could be moved from the mcd/gdbstub to the DebugClass.

2. mcd launch option:

This patch-set introduces the mcd launch option to QEMU. The quick start section describes how to use it.

3. MCD debugging features:

* Go, break, step
* Read/write memory (user space only)
* Read/write registers (GPR and CP)
* Set breakpoints and watchpoints.

=================

Nicolas Eder (18):
gdbstub, mcdstub: file and build structure adapted to accomodate for
the mcdstub
gdbstub: hex conversion functions moved to cutils.h
gdbstub: GDBRegisterState moved to gdbstub.h so it can be used outside
of the gdbstub
gdbstub: DebugClass added to system mode.
mcdstub: memory helper functions added
mcdstub: -mcd start option added, mcd specific defines added
mcdstub: mcdserver initialization functions added
cutils: qemu_strtou32 function added
mcdstub: TCP packet plumbing added
mcdstub: open and close server functions added
mcdstub: system and core queries added
mcdstub: all core specific queries added
mcdstub: go, step and break added
mcdstub: state query added
mcdstub: skeleton for reset handling added
mcdstub: register access added
mcdstub: memory access added
mcdstub: break/watchpoints added

 MAINTAINERS                              |   11 +-
 debug/common/debug.c                     |   51 +
 debug/common/meson.build                 |    1 +
 {gdbstub => debug/gdbstub}/gdbstub.c     |   27 +-
 {gdbstub => debug/gdbstub}/internals.h   |   26 -
 {gdbstub => debug/gdbstub}/meson.build   |    0
 {gdbstub => debug/gdbstub}/syscalls.c    |    0
 {gdbstub => debug/gdbstub}/system.c      |   18 +
 {gdbstub => debug/gdbstub}/trace-events  |    0
 debug/gdbstub/trace.h                    |    1 +
 {gdbstub => debug/gdbstub}/user-target.c |    0
 {gdbstub => debug/gdbstub}/user.c        |    0
 debug/mcdstub/arm_mcdstub.c              |  289 +++
 debug/mcdstub/mcdstub.c                  | 2481 ++++++++++++++++++++++
 debug/mcdstub/meson.build                |   12 +
 debug/meson.build                        |    3 +
 gdbstub/trace.h                          |    1 -
 include/exec/cpu-common.h                |    3 +
 include/exec/gdbstub.h                   |    8 +
 include/exec/memory.h                    |    9 +
 include/hw/boards.h                      |    1 +
 include/mcdstub/arm_mcdstub.h            |  118 +
 include/mcdstub/mcd_shared_defines.h     |  132 ++
 include/mcdstub/mcdstub.h                |  165 ++
 include/mcdstub/mcdstub_common.h         |   83 +
 include/qemu/cutils.h                    |   32 +
 include/qemu/debug.h                     |   38 +
 include/qemu/typedefs.h                  |    2 +
 meson.build                              |    4 +-
 qemu-options.hx                          |   18 +
 system/cpus.c                            |    9 +-
 system/memory.c                          |   11 +
 system/physmem.c                         |   26 +
 system/vl.c                              |   13 +
 util/cutils.c                            |   30 +
 35 files changed, 3575 insertions(+), 48 deletions(-)
 create mode 100644 debug/common/debug.c
 create mode 100644 debug/common/meson.build
 rename {gdbstub => debug/gdbstub}/gdbstub.c (98%)
 rename {gdbstub => debug/gdbstub}/internals.h (92%)
 rename {gdbstub => debug/gdbstub}/meson.build (100%)
 rename {gdbstub => debug/gdbstub}/syscalls.c (100%)
 rename {gdbstub => debug/gdbstub}/system.c (97%)
 rename {gdbstub => debug/gdbstub}/trace-events (100%)
 create mode 100644 debug/gdbstub/trace.h
 rename {gdbstub => debug/gdbstub}/user-target.c (100%)
 rename {gdbstub => debug/gdbstub}/user.c (100%)
 create mode 100644 debug/mcdstub/arm_mcdstub.c
 create mode 100644 debug/mcdstub/mcdstub.c
 create mode 100644 debug/mcdstub/meson.build
 create mode 100644 debug/meson.build
 delete mode 100644 gdbstub/trace.h
 create mode 100644 include/mcdstub/arm_mcdstub.h
 create mode 100644 include/mcdstub/mcd_shared_defines.h
 create mode 100644 include/mcdstub/mcdstub.h
 create mode 100644 include/mcdstub/mcdstub_common.h
 create mode 100644 include/qemu/debug.h
Signature · 1 line
2.34.1