All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH  v1 00/10] split user and system code in gdbstub
@ 2022-12-16 11:21 Alex Bennée
  2022-12-16 11:21 ` [PATCH v1 01/10] gdbstub/internals.h: clean up include guard Alex Bennée
                   ` (9 more replies)
  0 siblings, 10 replies; 22+ messages in thread
From: Alex Bennée @ 2022-12-16 11:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: f4bug, mads, Alex Bennée

Hi,

We currently re-compile gdbstub for every single target on the system.
Part of the reason for this is we have a lot of conditional #ifdefs to
handle the differences between user and system mode debugging. To use
the CONFIG_USER_ONLY and CONFIG_SOFTMMU defines you require using
NEED_CPU which ensures CONFIG_TARGET is included.

This series starts to pull things apart so we split user and system
specific code into their appropriate files and reduce the amount of
#ifdef stuff in gdbstub. The work is not complete but hopefully shows
the direction of travel.

We also split up the public headers so other parts of the code aren't
forced to bring in all the additional NEED_CPU stuff just to access
the core API. The GDB helpers which do have to be host/target aware to
deal with byte swaps are now in their own mini-header.

What remains:

  - re-factoring inline #ifdef blocks
  - eliminating target_ulong usage
  - once no longer target dependent move gdbstub to common_ss

The command table is one section that still requires handling the
differences between user and system mode so I think that might end up
being split into a separate file or possibly figuring out how to
compile gdbstub just twice, once for user_ss (with CONFIG_USER_ONLY
manually defined) and once for system_ss. Any pointers on the meson
magic to do that gratefully received.

Please review

Alex Bennée (9):
  gdbstub/internals.h: clean up include guard
  gdbstub: fix-up copyright and license files
  gdbstub: split GDBConnection from main structure
  gdbstub: move GDBState to shared internals header
  includes: move tb_flush into its own header
  includes: add new gdbstub include directory
  gdbstub: move chunk of softmmu functionality to own file
  gdbstub: move chunks of user code into own files
  gdbstub: retire exec/gdbstub.h

Philippe Mathieu-Daudé (1):
  gdbstub: Make syscall_complete/[gs]et_reg target-agnostic typedefs

 bsd-user/qemu.h                              |    2 +-
 gdbstub/internals.h                          |  139 +-
 include/exec/exec-all.h                      |    1 -
 include/exec/tb-flush.h                      |   19 +
 include/{exec/gdbstub.h => gdbstub/common.h} |  141 +-
 include/gdbstub/helpers.h                    |  101 ++
 include/gdbstub/user.h                       |   43 +
 linux-user/user-internals.h                  |    1 +
 accel/kvm/kvm-all.c                          |    2 +-
 accel/stubs/tcg-stub.c                       |    1 +
 accel/tcg/tb-maint.c                         |    1 +
 accel/tcg/tcg-accel-ops.c                    |    2 +-
 accel/tcg/translate-all.c                    |    1 +
 cpu.c                                        |    1 +
 gdbstub/gdbstub.c                            | 1331 ++----------------
 gdbstub/softmmu.c                            |  514 ++++++-
 gdbstub/user-target.c                        |  283 ++++
 gdbstub/user.c                               |  348 ++++-
 hw/ppc/spapr_hcall.c                         |    1 +
 linux-user/exit.c                            |    2 +-
 linux-user/main.c                            |    3 +-
 linux-user/signal.c                          |    2 +-
 monitor/misc.c                               |    2 +-
 plugins/core.c                               |    1 +
 plugins/loader.c                             |    2 +-
 semihosting/arm-compat-semi.c                |    2 +-
 semihosting/console.c                        |    2 +-
 semihosting/guestfd.c                        |    2 +-
 semihosting/syscalls.c                       |    3 +-
 softmmu/cpus.c                               |    2 +-
 softmmu/runstate.c                           |    2 +-
 softmmu/vl.c                                 |    2 +-
 stubs/gdbstub.c                              |    2 +-
 target/alpha/gdbstub.c                       |    2 +-
 target/alpha/sys_helper.c                    |    1 +
 target/arm/gdbstub.c                         |    3 +-
 target/arm/gdbstub64.c                       |    2 +-
 target/arm/helper-a64.c                      |    2 +-
 target/arm/kvm64.c                           |    2 +-
 target/arm/m_helper.c                        |    2 +-
 target/avr/gdbstub.c                         |    2 +-
 target/cris/gdbstub.c                        |    2 +-
 target/hexagon/gdbstub.c                     |    2 +-
 target/hppa/gdbstub.c                        |    2 +-
 target/i386/gdbstub.c                        |    2 +-
 target/i386/kvm/kvm.c                        |    2 +-
 target/i386/whpx/whpx-all.c                  |    2 +-
 target/loongarch/gdbstub.c                   |    3 +-
 target/m68k/gdbstub.c                        |    2 +-
 target/m68k/helper.c                         |    3 +-
 target/m68k/m68k-semi.c                      |    4 +-
 target/microblaze/gdbstub.c                  |    2 +-
 target/mips/gdbstub.c                        |    2 +-
 target/mips/tcg/sysemu/mips-semi.c           |    3 +-
 target/nios2/cpu.c                           |    2 +-
 target/nios2/nios2-semi.c                    |    3 +-
 target/openrisc/gdbstub.c                    |    2 +-
 target/openrisc/interrupt.c                  |    2 +-
 target/openrisc/mmu.c                        |    2 +-
 target/ppc/cpu_init.c                        |    2 +-
 target/ppc/gdbstub.c                         |    3 +-
 target/ppc/kvm.c                             |    2 +-
 target/riscv/csr.c                           |    1 +
 target/riscv/gdbstub.c                       |    3 +-
 target/rx/gdbstub.c                          |    2 +-
 target/s390x/gdbstub.c                       |    3 +-
 target/s390x/helper.c                        |    2 +-
 target/s390x/kvm/kvm.c                       |    2 +-
 target/sh4/gdbstub.c                         |    2 +-
 target/sparc/gdbstub.c                       |    2 +-
 target/tricore/gdbstub.c                     |    2 +-
 target/xtensa/core-dc232b.c                  |    2 +-
 target/xtensa/core-dc233c.c                  |    2 +-
 target/xtensa/core-de212.c                   |    2 +-
 target/xtensa/core-de233_fpu.c               |    2 +-
 target/xtensa/core-dsp3400.c                 |    2 +-
 target/xtensa/core-fsf.c                     |    2 +-
 target/xtensa/core-lx106.c                   |    2 +-
 target/xtensa/core-sample_controller.c       |    2 +-
 target/xtensa/core-test_kc705_be.c           |    2 +-
 target/xtensa/core-test_mmuhifi_c3.c         |    2 +-
 target/xtensa/gdbstub.c                      |    2 +-
 target/xtensa/helper.c                       |    2 +-
 MAINTAINERS                                  |    2 +-
 gdbstub/meson.build                          |    2 +
 gdbstub/trace-events                         |    4 +-
 scripts/feature_to_c.sh                      |    2 +-
 target/xtensa/import_core.sh                 |    2 +-
 88 files changed, 1680 insertions(+), 1401 deletions(-)
 create mode 100644 include/exec/tb-flush.h
 rename include/{exec/gdbstub.h => gdbstub/common.h} (61%)
 create mode 100644 include/gdbstub/helpers.h
 create mode 100644 include/gdbstub/user.h
 create mode 100644 gdbstub/user-target.c

-- 
2.34.1



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

end of thread, other threads:[~2022-12-21 16:57 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-16 11:21 [PATCH v1 00/10] split user and system code in gdbstub Alex Bennée
2022-12-16 11:21 ` [PATCH v1 01/10] gdbstub/internals.h: clean up include guard Alex Bennée
2022-12-16 19:17   ` Richard Henderson
2022-12-16 11:21 ` [PATCH v1 02/10] gdbstub: fix-up copyright and license files Alex Bennée
2022-12-16 19:39   ` Richard Henderson
2022-12-16 11:21 ` [PATCH v1 03/10] gdbstub: Make syscall_complete/[gs]et_reg target-agnostic typedefs Alex Bennée
2022-12-16 11:22 ` [PATCH v1 04/10] gdbstub: split GDBConnection from main structure Alex Bennée
2022-12-16 15:29   ` Fabiano Rosas
2022-12-21 16:56     ` Alex Bennée
2022-12-16 20:11   ` Richard Henderson
2022-12-16 11:22 ` [PATCH v1 05/10] gdbstub: move GDBState to shared internals header Alex Bennée
2022-12-16 20:02   ` Richard Henderson
2022-12-16 11:22 ` [PATCH v1 06/10] includes: move tb_flush into its own header Alex Bennée
2022-12-16 20:01   ` Richard Henderson
2022-12-16 11:22 ` [PATCH v1 07/10] includes: add new gdbstub include directory Alex Bennée
2022-12-16 20:37   ` Richard Henderson
2022-12-16 11:22 ` [PATCH v1 08/10] gdbstub: move chunk of softmmu functionality to own file Alex Bennée
2022-12-16 15:52   ` Fabiano Rosas
2022-12-16 20:27   ` Richard Henderson
2022-12-16 11:22 ` [PATCH v1 09/10] gdbstub: move chunks of user code into own files Alex Bennée
2022-12-16 16:38   ` Fabiano Rosas
2022-12-16 11:22 ` [PATCH v1 10/10] gdbstub: retire exec/gdbstub.h Alex Bennée

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.