qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/29] first version of mcdstub
@ 2023-10-06  9:05 Nicolas Eder
  2023-10-06  9:05 ` [PATCH v2 01/29] mcdstub initial commit, mcdstub file structure added Nicolas Eder
                   ` (30 more replies)
  0 siblings, 31 replies; 39+ messages in thread
From: Nicolas Eder @ 2023-10-06  9:05 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Christian.Boenig, Alex Bennée,
	Nicolas Eder

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 will be available soon Lauterbach's open source site
and will be linked to from inside this project in a future patch.
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/debug-common.c
and configured in debug/debug-gdb.c and debug/debug-mcd.c respectively.
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.

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

Signed-off-by: Nicolas Eder <nicolas.eder@lauterbach.com>

neder (29):
  mcdstub initial commit, mcdstub file structure added
  TCP chardev added, handshake with TRACE32 working
  TCP packet handling added
  queries for resets and triggers added
  queries for memory spaces and register groups added
  query for registers added
  query data preparation improved
  shared header file added, used for TCP packet data
  memory and register query data now stored per core
  handler for resets added
  query for the VM state added
  handler for reading registers added
  handler for reading memory added
  handler for single step added
  adapting to the qemu coding style
  deleting the mcdd startup option
  handler for breakpoints and watchpoints added
  making step and go handlers core-specific
  adding trigger ID handling for TRACE32
  cp register read/write added
  switching between secure and non-secure memory added
  transitioning to unsinged integers in TCP packets and removing
    MCD-API-specific terms
  moved all ARM code to the ARM mcdstub and added now commom header file
  step and go handlers now propperly perform global operations
  Doxygen documentation added
  moved all mcd related header files into include/mcdstub
  MCD stub entry added to maintainers file
  added description to out-commented gdb function
  introducing the DebugClass. It is used to abstract the gdb/mcd
    set_stop_cpu function.

 MAINTAINERS                          |   12 +
 debug/debug-common.c                 |   42 +
 debug/debug-gdb.c                    |   24 +
 debug/debug-mcd.c                    |   25 +
 gdbstub/meson.build                  |    4 +-
 gdbstub/softmmu.c                    |    4 +
 gdbstub/user.c                       |    2 +
 include/exec/gdbstub.h               |    5 +
 include/exec/mcdstub.h               |   12 +
 include/hw/boards.h                  |    1 +
 include/mcdstub/arm_mcdstub.h        |  139 ++
 include/mcdstub/mcd_shared_defines.h |  105 ++
 include/mcdstub/mcdstub.h            |  829 +++++++++++
 include/mcdstub/mcdstub_common.h     |   64 +
 include/mcdstub/syscalls.h           |    6 +
 include/qemu/debug.h                 |   19 +
 include/qemu/typedefs.h              |    2 +
 mcdstub/mcd_syscalls.c               |   30 +
 mcdstub/mcdstub.c                    | 1960 ++++++++++++++++++++++++++
 mcdstub/meson.build                  |   19 +
 meson.build                          |    1 +
 qemu-options.hx                      |   18 +
 softmmu/cpus.c                       |    9 +-
 softmmu/vl.c                         |   13 +
 target/arm/mcdstub.c                 |  559 ++++++++
 target/arm/meson.build               |    1 +
 26 files changed, 3902 insertions(+), 3 deletions(-)
 create mode 100644 debug/debug-common.c
 create mode 100644 debug/debug-gdb.c
 create mode 100644 debug/debug-mcd.c
 create mode 100644 include/exec/mcdstub.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/mcdstub/syscalls.h
 create mode 100644 include/qemu/debug.h
 create mode 100644 mcdstub/mcd_syscalls.c
 create mode 100644 mcdstub/mcdstub.c
 create mode 100644 mcdstub/meson.build
 create mode 100644 target/arm/mcdstub.c

-- 
2.34.1



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

end of thread, other threads:[~2023-10-13 16:54 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-06  9:05 [PATCH v2 00/29] first version of mcdstub Nicolas Eder
2023-10-06  9:05 ` [PATCH v2 01/29] mcdstub initial commit, mcdstub file structure added Nicolas Eder
2023-10-13 15:51   ` Alex Bennée
2023-10-06  9:05 ` [PATCH v2 02/29] TCP chardev added, handshake with TRACE32 working Nicolas Eder
2023-10-13 16:15   ` Alex Bennée
2023-10-06  9:05 ` [PATCH v2 03/29] TCP packet handling added Nicolas Eder
2023-10-06  9:05 ` [PATCH v2 04/29] queries for resets and triggers added Nicolas Eder
2023-10-06  9:05 ` [PATCH v2 05/29] queries for memory spaces and register groups added Nicolas Eder
2023-10-06  9:05 ` [PATCH v2 06/29] query for registers added Nicolas Eder
2023-10-13 16:38   ` Alex Bennée
2023-10-06  9:05 ` [PATCH v2 07/29] query data preparation improved Nicolas Eder
2023-10-06  9:05 ` [PATCH v2 08/29] shared header file added, used for TCP packet data Nicolas Eder
2023-10-06  9:05 ` [PATCH v2 09/29] memory and register query data now stored per core Nicolas Eder
2023-10-06  9:05 ` [PATCH v2 10/29] handler for resets added Nicolas Eder
2023-10-06  9:05 ` [PATCH v2 11/29] query for the VM state added Nicolas Eder
2023-10-06  9:05 ` [PATCH v2 12/29] handler for reading registers added Nicolas Eder
2023-10-13 16:40   ` Alex Bennée
2023-10-06  9:05 ` [PATCH v2 13/29] handler for reading memory added Nicolas Eder
2023-10-06  9:05 ` [PATCH v2 14/29] handler for single step added Nicolas Eder
2023-10-06  9:05 ` [PATCH v2 15/29] adapting to the qemu coding style Nicolas Eder
2023-10-06  9:05 ` [PATCH v2 16/29] deleting the mcdd startup option Nicolas Eder
2023-10-06  9:05 ` [PATCH v2 17/29] handler for breakpoints and watchpoints added Nicolas Eder
2023-10-06  9:05 ` [PATCH v2 18/29] making step and go handlers core-specific Nicolas Eder
2023-10-06  9:06 ` [PATCH v2 19/29] adding trigger ID handling for TRACE32 Nicolas Eder
2023-10-06  9:06 ` [PATCH v2 20/29] cp register read/write added Nicolas Eder
2023-10-06  9:06 ` [PATCH v2 21/29] switching between secure and non-secure memory added Nicolas Eder
2023-10-06  9:06 ` [PATCH v2 22/29] transitioning to unsinged integers in TCP packets and removing MCD-API-specific terms Nicolas Eder
2023-10-06  9:06 ` [PATCH v2 23/29] moved all ARM code to the ARM mcdstub and added now commom header file Nicolas Eder
2023-10-06  9:06 ` [PATCH v2 24/29] step and go handlers now propperly perform global operations Nicolas Eder
2023-10-06  9:06 ` [PATCH v2 25/29] Doxygen documentation added Nicolas Eder
2023-10-13 16:34   ` Alex Bennée
2023-10-06  9:06 ` [PATCH v2 26/29] moved all mcd related header files into include/mcdstub Nicolas Eder
2023-10-13 16:45   ` Alex Bennée
2023-10-06  9:06 ` [PATCH v2 27/29] MCD stub entry added to maintainers file Nicolas Eder
2023-10-13 16:46   ` Alex Bennée
2023-10-06  9:06 ` [PATCH v2 28/29] added description to out-commented gdb function Nicolas Eder
2023-10-06  9:06 ` [PATCH v2 29/29] introducing the DebugClass. It is used to abstract the gdb/mcd set_stop_cpu function Nicolas Eder
2023-10-06  9:50 ` [PATCH v2 00/29] first version of mcdstub Philippe Mathieu-Daudé
2023-10-13 16:47 ` Alex Bennée

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).