Skip to content

gdbstub: Build once on various targets (single-binary)

Philippe Mathieu-Daudé qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest50 patches 59 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/50target/ppc: Move user_only_helper.c to target_user_arch[] source settarget/ppc/meson.build+5 -11 reply
2/50target/ppc: Remove PPC_DEBUG_SPR left-over commenttarget/ppc/cpu_init.c+0 -11 reply
3/50target/i386: Inline GDB_FORCE_64 definitiontarget/i386/gdbstub.c+1 -71 reply
4/50target/avr: Fix typo in gdb-xml feature namegdb-xml/avr-cpu.xml+1 -11 reply
5/50target/alpha: Document gdbstub register indexestarget/alpha/gdbstub.c+12 -131 reply
6/50target/riscv: Extract monitor-related code to monitor.ctarget/riscv/monitor.c target/riscv/riscv-qmp-cmds.c+148 -1502 replies
7/50target/ppc: Fix CPUClass::gdb_num_core_regs valuegdbstub/gdbstub.c target/ppc/cpu_init.c+3 -12 replies
8/50target/ppc: Remove dead code depending on USE_APPLE_GDBtarget/ppc/cpu.h target/ppc/cpu_init.c target/ppc/gdbstub.c+0 -1331 reply
9/50gdbstub: Always infer gdb_num_core_regs when using XML filegdbstub/gdbstub.c include/hw/core/cpu.h target/alpha/cpu.c +2 more+3 -81 reply
10/50target/sparc: Introduce sparc_cpu_register_gdb_regs() stubtarget/sparc/cpu.c target/sparc/cpu.h target/sparc/gdbstub.c+12 -01 reply
11/50target/sparc: Restore 'gdb-xml/sparc64-cp0.xml'configs/targets/sparc64-linux-user.mak configs/targets/sparc64-softmmu.mak gdb-xml/sparc64-core.xml +2 more+130 -901 reply
12/50target/sparc: Restore 'gdb-xml/sparc64-fpu.xml'configs/targets/sparc64-linux-user.mak configs/targets/sparc64-softmmu.mak gdb-xml/sparc64-core.xml +2 more+119 -821 reply
13/50target/sparc: Restore 'gdb-xml/sparc64-cpu.xml'configs/targets/sparc64-linux-user.mak configs/targets/sparc64-softmmu.mak gdb-xml/sparc64-cpu.xml +1 more+5 -51 reply
14/50target/sparc: Expose gdbstub registers to sparc32plus targetconfigs/targets/sparc32plus-linux-user.mak+1 -01 reply
15/50target/sparc: Expose gdbstub registers to sparc32 targetsconfigs/targets/sparc-linux-user.mak configs/targets/sparc-softmmu.mak gdb-xml/sparc32-cp0.xml +4 more+113 -61 reply
16/50monitor/hmp: Handle gdb-xml exposed registers via gdb_get_register()monitor/hmp.c+46 -30 replies
17/50target/sparc: Remove MonitorDef register entries available via gdbstubtarget/sparc/monitor.c+0 -1071 reply
18/50target/i386: Remove MonitorDef register entries available via gdbstubtarget/i386/monitor.c+0 -391 reply
19/50target/m68k: Remove MonitorDef register entries available via gdbstubtarget/m68k/monitor.c+0 -181 reply
20/50target/ppc: Remove MonitorDef register entries available via gdbstubtarget/ppc/ppc-qmp-cmds.c+0 -1321 reply
21/50target/ppc: Extract monitor-related code to monitor.ctarget/ppc/meson.build target/ppc/monitor.c target/ppc/ppc-qmp-cmds.c+43 -151 reply
22/50target/or1k: Use XML register definitions from GDBconfigs/targets/or1k-linux-user.mak configs/targets/or1k-softmmu.mak gdb-xml/or1k-core.xml +1 more+68 -11 reply
23/50target/riscv: Remove empty target_monitor_defs() symboltarget/riscv/monitor.c+0 -133 replies
24/50target/sparc: Factor sparc_cpu_gdb_write_register() outtarget/sparc/gdbstub.c+13 -141 reply
25/50target/ppc: Replace ldtul_p() -> ldn_p()target/ppc/gdbstub.c+11 -111 reply
26/50target/mips: Replace ldtul_p() -> ldn_p()target/mips/gdbstub.c+8 -61 reply
27/50target/riscv: Replace ldtul_p() -> ldn_p()target/riscv/gdbstub.c+8 -63 replies
28/50target/riscv: Remove unnecessary target_ulong type usestarget/riscv/gdbstub.c+4 -43 replies
29/50target/i386: Replace ldtul_p() -> ldn_p()target/i386/gdbstub.c+3 -21 reply
30/50target/i386: Expand 64-bit definitions when TARGET_LONG_BITS == 64target/i386/gdbstub.c+6 -41 reply
31/50gdbstub: Remove ldtul*() macrosinclude/gdbstub/helpers.h+0 -61 reply
32/50target/alpha: Expand gdb_get_regl() -> gdb_get_reg64()target/alpha/gdbstub.c+1 -11 reply
33/50target/hexagon: Expand gdb_get_regl() -> gdb_get_reg32()target/hexagon/gdbstub.c+6 -62 replies
34/50target/rx: Expand gdb_get_regl() -> gdb_get_reg32()target/rx/gdbstub.c+10 -101 reply
35/50target/sh4: Expand gdb_get_regl() -> gdb_get_reg32()target/sh4/gdbstub.c+16 -161 reply
36/50target/sparc: Expand gdb_get_regl() in gdb_get_rega()target/sparc/gdbstub.c+6 -31 reply
37/50gdbstub/helpers: Convert gdb_get_regl() macro to inlined helperinclude/gdbstub/helpers.h+14 -81 reply
38/50target/microblaze: Build 'gdbstub.c' once for system binariestarget/microblaze/meson.build+9 -21 reply
39/50target/sh4: Build 'monitor.c' once for system binariestarget/sh4/meson.build+5 -31 reply
40/50target/sh4: Build 'gdbstub.c' once for system binariestarget/sh4/meson.build+5 -11 reply
41/50target/or1k: Rename 'openrisc' -> 'or1k' in meson.buildtarget/or1k/meson.build+7 -71 reply
42/50target/or1k: Build 'gdbstub.c' once for system single binarytarget/or1k/meson.build+9 -21 reply
43/50target/alpha: Build 'gdbstub.c' once for system single binarytarget/alpha/meson.build+10 -41 reply
44/50target/avr: Build 'gdbstub.c' once for system single binarytarget/avr/meson.build+4 -11 reply
45/50target/loongarch: Build 'gdbstub.c' once for system single binarytarget/loongarch/meson.build+8 -11 reply
46/50target/m68k: Build 'gdbstub.c' once for system single binarytarget/m68k/meson.build+8 -11 reply
47/50target/rx: Build 'gdbstub.c' once for system single binarytarget/rx/meson.build+4 -21 reply
48/50target/s390x: Build 'gdbstub.c' once for system single binarytarget/s390x/meson.build+2 -11 reply
49/50target/tricore: Build 'gdbstub.c' once for system single binarytarget/tricore/meson.build+7 -31 reply
50/50DONOTREVIEW Revert "target/loongarch: Build 'gdbstub.c' once"target/loongarch/meson.build+1 -81 reply

Reviews trailers per patch

All 50 patches have a Reviewed-by or Acked-by.

PatchDr. David Alan GilbertPierrick BouvierBrian CainDaniel Henrique BarbozaChao Liu
1/50R-b
2/50R-b
3/50R-b
4/50R-b
5/50R-b
6/50R-b R-b
7/50R-b
8/50R-b
9/50R-b
10/50R-b
11/50R-b
12/50R-b
13/50R-b
14/50R-b
15/50R-b
16/50R-b
17/50R-b
18/50R-b
19/50R-b
20/50R-b
21/50R-b
22/50R-b
23/50R-b R-b R-b
24/50R-b
25/50R-b
26/50R-b
27/50R-b R-b R-b
28/50R-b R-b R-b
29/50R-b
30/50R-b
31/50R-b
32/50R-b
33/50R-b R-b
34/50R-b
35/50R-b
36/50R-b
37/50R-b
38/50R-b
39/50R-b
40/50R-b
41/50R-b
42/50R-b
43/50R-b
44/50R-b
45/50R-b
46/50R-b
47/50R-b
48/50R-b
49/50R-b
50/50R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v2 thread

Cover letter [PATCH v2 00/50] gdbstub: Build once on various targets (single-binary)

This series absorbed "monitor/hmp: Automatically handle gdb-xml exposed registers", thus version 2. Previous cover:

MonitorDef registers parsing is one of the oldest APIs in QEMU, thus predates gdbstub and XML register files. The latters are maintained by the GDB/binutils project and are more up-to-date. Getting the target register list from them allows to expose all accessible registers to the HMP commands.

This series adds gdb_get_register() to monitor to use XML generated registers, and remove the legacy MonitorDef entries which became unreachable.

First we need to have the SPARC target better follow the gdb-xml API.

On top of that we remove more TARGET_LONG_BITS uses, replacing ldtul_p() -> ldn_p() and gdb_get_regl() -> gdb_get_reg32/64(), allowing to build various gdbstub.c files once. Few other meson cleanups on the way.

Philippe Mathieu-Daudé (50):
target/ppc: Move user_only_helper.c to target_user_arch[] source set target/ppc: Remove PPC_DEBUG_SPR left-over comment target/i386: Inline GDB_FORCE_64 definition
target/avr: Fix typo in gdb-xml feature name
target/alpha: Document gdbstub register indexes target/riscv: Extract monitor-related code to monitor.c target/ppc: Fix CPUClass::gdb_num_core_regs value target/ppc: Remove dead code depending on USE_APPLE_GDB
gdbstub: Always infer gdb_num_core_regs when using XML file target/sparc: Introduce sparc_cpu_register_gdb_regs() stub target/sparc: Restore 'gdb-xml/sparc64-cp0.xml' target/sparc: Restore 'gdb-xml/sparc64-fpu.xml' target/sparc: Restore 'gdb-xml/sparc64-cpu.xml' target/sparc: Expose gdbstub registers to sparc32plus target target/sparc: Expose gdbstub registers to sparc32 targets monitor/hmp: Handle gdb-xml exposed registers via gdb_get_register() target/sparc: Remove MonitorDef register entries available via gdbstub target/i386: Remove MonitorDef register entries available via gdbstub target/m68k: Remove MonitorDef register entries available via gdbstub target/ppc: Remove MonitorDef register entries available via gdbstub target/ppc: Extract monitor-related code to monitor.c target/or1k: Use XML register definitions from GDB target/riscv: Remove empty target_monitor_defs() symbol target/sparc: Factor sparc_cpu_gdb_write_register() out target/ppc: Replace ldtul_p() -> ldn_p()
target/mips: Replace ldtul_p() -> ldn_p()
target/riscv: Replace ldtul_p() -> ldn_p()
target/riscv: Remove unnecessary target_ulong type uses target/i386: Replace ldtul_p() -> ldn_p()
target/i386: Expand 64-bit definitions when TARGET_LONG_BITS == 64
gdbstub: Remove ldtul*() macros
target/alpha: Expand gdb_get_regl() -> gdb_get_reg64() target/hexagon: Expand gdb_get_regl() -> gdb_get_reg32() target/rx: Expand gdb_get_regl() -> gdb_get_reg32() target/sh4: Expand gdb_get_regl() -> gdb_get_reg32() target/sparc: Expand gdb_get_regl() in gdb_get_rega() gdbstub/helpers: Convert gdb_get_regl() macro to inlined helper target/microblaze: Build 'gdbstub.c' once for system binaries target/sh4: Build 'monitor.c' once for system binaries target/sh4: Build 'gdbstub.c' once for system binaries target/or1k: Rename 'openrisc' -> 'or1k' in meson.build target/or1k: Build 'gdbstub.c' once for system single binary target/alpha: Build 'gdbstub.c' once for system single binary target/avr: Build 'gdbstub.c' once for system single binary target/loongarch: Build 'gdbstub.c' once for system single binary target/m68k: Build 'gdbstub.c' once for system single binary target/rx: Build 'gdbstub.c' once for system single binary target/s390x: Build 'gdbstub.c' once for system single binary target/tricore: Build 'gdbstub.c' once for system single binary DONOTREVIEW Revert "target/loongarch: Build 'gdbstub.c' once"

 configs/targets/or1k-linux-user.mak           |   1 +
 configs/targets/or1k-softmmu.mak              |   1 +
 configs/targets/sparc-linux-user.mak          |   1 +
 configs/targets/sparc-softmmu.mak             |   1 +
 configs/targets/sparc32plus-linux-user.mak    |   1 +
 configs/targets/sparc64-linux-user.mak        |   2 +-
 configs/targets/sparc64-softmmu.mak           |   2 +-
 include/gdbstub/helpers.h                     |  28 +-
 include/hw/core/cpu.h                         |   4 +-
 target/ppc/cpu.h                              |   2 -
 target/sparc/cpu.h                            |   1 +
 gdbstub/gdbstub.c                             |   1 +
 monitor/hmp.c                                 |  49 ++-
 target/alpha/cpu.c                            |   1 -
 target/alpha/gdbstub.c                        |  27 +-
 target/hexagon/gdbstub.c                      |  12 +-
 target/i386/gdbstub.c                         |  23 +-
 target/i386/monitor.c                         |  39 ---
 target/m68k/monitor.c                         |  18 -
 target/mips/gdbstub.c                         |  14 +-
 target/or1k/cpu.c                             |   2 +-
 target/ppc/cpu_init.c                         |  10 -
 target/ppc/gdbstub.c                          | 146 +-------
 target/ppc/monitor.c                          |  41 +++
 target/ppc/ppc-qmp-cmds.c                     | 148 +-------
 target/riscv/gdbstub.c                        |  20 +-
 target/riscv/monitor.c                        | 135 ++++++++
 target/riscv/riscv-qmp-cmds.c                 | 150 ---------
 target/rx/gdbstub.c                           |  20 +-
 target/sh4/gdbstub.c                          |  32 +-
 target/sparc/cpu.c                            |   7 +-
 target/sparc/gdbstub.c                        | 317 +++++++++++-------
 target/sparc/monitor.c                        | 107 ------
 gdb-xml/avr-cpu.xml                           |   2 +-
 gdb-xml/or1k-core.xml                         |  65 ++++
 gdb-xml/sparc32-cp0.xml                       |  18 +
 gdb-xml/sparc32-cpu.xml                       |  42 +++
 gdb-xml/sparc32-fpu.xml                       |  42 +++
 gdb-xml/sparc64-cp0.xml                       |  16 +
 gdb-xml/sparc64-cpu.xml                       |  42 +++
 gdb-xml/{sparc64-core.xml => sparc64-fpu.xml} |  44 +--
 target/alpha/meson.build                      |  14 +-
 target/avr/meson.build                        |   5 +-
 target/m68k/meson.build                       |   9 +-
 target/microblaze/meson.build                 |  11 +-
 target/or1k/meson.build                       |  23 +-
 target/ppc/meson.build                        |   7 +-
 target/rx/meson.build                         |   6 +-
 target/s390x/meson.build                      |   3 +-
 target/sh4/meson.build                        |  14 +-
 target/tricore/meson.build                    |  10 +-
 51 files changed, 836 insertions(+), 900 deletions(-)
 create mode 100644 target/ppc/monitor.c
 create mode 100644 gdb-xml/or1k-core.xml
 create mode 100644 gdb-xml/sparc32-cp0.xml
 create mode 100644 gdb-xml/sparc32-cpu.xml
 create mode 100644 gdb-xml/sparc32-fpu.xml
 create mode 100644 gdb-xml/sparc64-cp0.xml
 create mode 100644 gdb-xml/sparc64-cpu.xml
 rename gdb-xml/{sparc64-core.xml => sparc64-fpu.xml} (59%)
Signature · 1 line
2.52.0