qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/20] first version of mcdstub
@ 2023-11-07 13:03 Nicolas Eder
  2023-11-07 13:03 ` [PATCH v3 01/20] mcdstub: initial file structure for new mcdstub created. -mcd QEMU startup option added. Functions for initializing the mcdstub added. Basic helper functions for processes/cpus in the mcdstub added Nicolas Eder
                   ` (21 more replies)
  0 siblings, 22 replies; 32+ messages in thread
From: Nicolas Eder @ 2023-11-07 13:03 UTC (permalink / raw)
  To: qemu-devel
  Cc: Nicolas Eder, Alex Bennée, Philippe Mathieu-Daudé,
	Christian Boenig

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>

Nicolas Eder (20):
  mcdstub: initial file structure for new mcdstub created. -mcd QEMU
    startup option added. Functions for initializing the mcdstub added.
    Basic helper functions for processes/cpus in the mcdstub added
  mcdstub gdbstub: new DebugClass and DebugState introduced. They are
    used to abstract the debugger details behind a QOM. This is
    currently used in the cpu_handle_guest_debug function
  gdbstub: moving code so that it can be easier accessed from outside
    the gdbstub: fromhex and tohex functions moved to a cutils header.
    GDBRegisterState moved to gdbstub.h
  mcdstub: added header with defines specific to the mcd tcp packet
    communication
  mcdstub: tcp packet processing added
  mcdstub: open/close server functions and trigger/reset data added.
    User for initial connection with an mcd client
  mcdstub: quitting QEMU via mcd command added
  mcdstub: query packet processing added and core/system querie added
  mcdstub: open/close core added. This includes core specific data
    preparation: memory spaces, register groups and registers. This data
    preparation is done in the arm mcdstub
  mcdstub: state query added: this query collects information about the
    state of a specific core. This commit also includes
    mcd_vm_state_change, which is called when the cpu state changes
    because it collects data for the query
  mcdstub: reset and trigger queries added
  mcdstub: missing parse_reg_xml function for parsing gdb register xml
    files added
  mcdstub: added queries for memory spaces, register groups and
    registers
  mcdstub: missing handle_query_state function added
  mcdstub: added go, break and step functionality and all corresponding
    functions
  mcdstub: function construct for resets added
  mcdstub: reading/writing registers added
  mcdstub: read/write to memory added: This also includes various helper
    functions in the QEMU memory code
  mcdstub: break/watchpoints added
  mcdstub: updated MAINTAINERS file and fully activated the mcdstub in
    the meson build system

 MAINTAINERS                          |   11 +
 debug/debug-common.c                 |   42 +
 debug/debug-gdb.c                    |   24 +
 debug/debug-mcd.c                    |   25 +
 gdbstub/gdbstub.c                    |    9 +-
 gdbstub/internals.h                  |   26 -
 gdbstub/meson.build                  |    4 +-
 gdbstub/system.c                     |    4 +
 gdbstub/user.c                       |    2 +
 include/cutils.h                     |   30 +
 include/exec/cpu-common.h            |    2 +
 include/exec/gdbstub.h               |   14 +-
 include/exec/memory.h                |    9 +
 include/hw/boards.h                  |    1 +
 include/mcdstub/arm_mcdstub.h        |  107 ++
 include/mcdstub/mcd_shared_defines.h |  108 ++
 include/mcdstub/mcdstub.h            |  893 ++++++++++++
 include/mcdstub/mcdstub_common.h     |   59 +
 include/qemu/debug.h                 |   19 +
 include/qemu/typedefs.h              |    2 +
 mcdstub/mcdstub.c                    | 1998 ++++++++++++++++++++++++++
 mcdstub/meson.build                  |   15 +
 meson.build                          |    1 +
 qemu-options.hx                      |   18 +
 system/cpus.c                        |    9 +-
 system/memory.c                      |   11 +
 system/physmem.c                     |   26 +
 system/vl.c                          |   13 +
 target/arm/mcdstub.c                 |  304 ++++
 target/arm/meson.build               |    1 +
 30 files changed, 3749 insertions(+), 38 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/cutils.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
 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] 32+ messages in thread

end of thread, other threads:[~2023-11-29 16:32 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-07 13:03 [PATCH v3 00/20] first version of mcdstub Nicolas Eder
2023-11-07 13:03 ` [PATCH v3 01/20] mcdstub: initial file structure for new mcdstub created. -mcd QEMU startup option added. Functions for initializing the mcdstub added. Basic helper functions for processes/cpus in the mcdstub added Nicolas Eder
2023-11-29 15:23   ` Alex Bennée
2023-11-07 13:03 ` [PATCH v3 02/20] mcdstub gdbstub: new DebugClass and DebugState introduced. They are used to abstract the debugger details behind a QOM. This is currently used in the cpu_handle_guest_debug function Nicolas Eder
2023-11-07 13:03 ` [PATCH v3 03/20] gdbstub: moving code so that it can be easier accessed from outside the gdbstub: fromhex and tohex functions moved to a cutils header. GDBRegisterState moved to gdbstub.h Nicolas Eder
2023-11-29 15:51   ` Alex Bennée
2023-11-07 13:03 ` [PATCH v3 04/20] mcdstub: added header with defines specific to the mcd tcp packet communication Nicolas Eder
2023-11-29 16:02   ` Alex Bennée
2023-11-07 13:03 ` [PATCH v3 05/20] mcdstub: tcp packet processing added Nicolas Eder
2023-11-08 14:33   ` Philippe Mathieu-Daudé
2023-11-13  9:18     ` nicolas.eder
2023-11-29 16:25   ` Alex Bennée
2023-11-07 13:03 ` [PATCH v3 06/20] mcdstub: open/close server functions and trigger/reset data added. User for initial connection with an mcd client Nicolas Eder
2023-11-07 13:03 ` [PATCH v3 07/20] mcdstub: quitting QEMU via mcd command added Nicolas Eder
2023-11-07 13:03 ` [PATCH v3 08/20] mcdstub: query packet processing added and core/system querie added Nicolas Eder
2023-11-07 13:03 ` [PATCH v3 09/20] mcdstub: open/close core added. This includes core specific data preparation: memory spaces, register groups and registers. This data preparation is done in the arm mcdstub Nicolas Eder
2023-11-07 13:03 ` [PATCH v3 10/20] mcdstub: state query added: this query collects information about the state of a specific core. This commit also includes mcd_vm_state_change, which is called when the cpu state changes because it collects data for the query Nicolas Eder
2023-11-07 13:03 ` [PATCH v3 11/20] mcdstub: reset and trigger queries added Nicolas Eder
2023-11-07 13:03 ` [PATCH v3 12/20] mcdstub: missing parse_reg_xml function for parsing gdb register xml files added Nicolas Eder
2023-11-07 13:03 ` [PATCH v3 13/20] mcdstub: added queries for memory spaces, register groups and registers Nicolas Eder
2023-11-07 13:03 ` [PATCH v3 14/20] mcdstub: missing handle_query_state function added Nicolas Eder
2023-11-07 13:03 ` [PATCH v3 15/20] mcdstub: added go, break and step functionality and all corresponding functions Nicolas Eder
2023-11-07 13:03 ` [PATCH v3 16/20] mcdstub: function construct for resets added Nicolas Eder
2023-11-07 13:03 ` [PATCH v3 17/20] mcdstub: reading/writing registers added Nicolas Eder
2023-11-07 13:03 ` [PATCH v3 18/20] mcdstub: read/write to memory added: This also includes various helper functions in the QEMU memory code Nicolas Eder
2023-11-07 13:03 ` [PATCH v3 19/20] mcdstub: break/watchpoints added Nicolas Eder
2023-11-07 13:03 ` [PATCH v3 20/20] mcdstub: updated MAINTAINERS file and fully activated the mcdstub in the meson build system Nicolas Eder
2023-11-29 16:31   ` Alex Bennée
2023-11-08 14:27 ` [PATCH v3 00/20] first version of mcdstub Philippe Mathieu-Daudé
2023-11-13  9:20   ` nicolas.eder
2023-11-29 14:44 ` Alex Bennée
2023-11-29 15:01   ` nicolas.eder

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