qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/12] gdbstub: Implement follow-fork-mode child
@ 2024-02-19 14:15 Ilya Leoshkevich
  2024-02-19 14:15 ` [PATCH v4 01/12] gdbstub: Support disablement in a multi-threaded process Ilya Leoshkevich
                   ` (12 more replies)
  0 siblings, 13 replies; 17+ messages in thread
From: Ilya Leoshkevich @ 2024-02-19 14:15 UTC (permalink / raw)
  To: Warner Losh, Alex Bennée, Richard Henderson, Riku Voipio,
	Laurent Vivier
  Cc: Kyle Evans, Philippe Mathieu-Daudé, Alexandre Iooss,
	Mahmoud Mandour, Pierrick Bouvier, qemu-devel, Ilya Leoshkevich

v3: https://lists.gnu.org/archive/html/qemu-devel/2024-02/msg03142.html
v3 -> v4: Address the review comments, add R-bs.
          Add the get_task_state() refactoring.
          Keep passing CPUState to gdbserver_fork_end() for tb_flush().
          Patches that need review: 02/12, 09/12-12/12.

v2: https://lists.gnu.org/archive/html/qemu-devel/2024-02/msg00810.html
v2 -> v3: Rebase on top of master.
          Fix a typo in the 01/11 commit message.

v1: https://lists.gnu.org/archive/html/qemu-devel/2024-01/msg06646.html
v1 -> v2: Factor out a number of prep patches;
          Add a state transition diagram comment (Alex).
          Improve a few comments;
          Extend the ts_tid fix to bsd.

Hi,

I needed to debug a linux-user crash between fork() and exec() [1] and
realized that gdbstub does not allow this. This series lifts this
restriction (one still cannot debug past exec() though). Patches 1-10
are preliminary refactorings, patch 11 is the implementation, and patch
12 is the test.

[1] https://lists.gnu.org/archive/html/qemu-devel/2024-01/msg06424.html

Best regards,
Ilya

Ilya Leoshkevich (12):
  gdbstub: Support disablement in a multi-threaded process
  {linux,bsd}-user: Introduce get_task_state()
  {linux,bsd}-user: Update ts_tid after fork()
  gdbstub: Introduce gdbserver_fork_start()
  {linux,bsd}-user: Pass pid to fork_end()
  {linux,bsd}-user: Pass pid to gdbserver_fork()
  gdbstub: Call gdbserver_fork() both in parent and in child
  gdbstub: Introduce gdb_handle_query_supported_user()
  gdbstub: Introduce gdb_handle_set_thread_user()
  gdbstub: Introduce gdb_handle_detach_user()
  gdbstub: Implement follow-fork-mode child
  tests/tcg: Add two follow-fork-mode tests

 bsd-user/bsd-file.h                           |   2 +-
 bsd-user/freebsd/os-proc.h                    |   6 +-
 bsd-user/main.c                               |   9 +-
 bsd-user/qemu.h                               |   7 +-
 bsd-user/signal.c                             |  20 +-
 gdbstub/gdbstub.c                             |  29 ++-
 gdbstub/internals.h                           |   3 +
 gdbstub/user-target.c                         |   4 +-
 gdbstub/user.c                                | 244 +++++++++++++++++-
 include/gdbstub/user.h                        |  10 +-
 include/user/safe-syscall.h                   |   2 +-
 linux-user/aarch64/cpu_loop.c                 |   2 +-
 linux-user/arm/cpu_loop.c                     |   4 +-
 linux-user/arm/signal.c                       |   2 +-
 linux-user/cris/cpu_loop.c                    |   2 +-
 linux-user/elfload.c                          |   6 +-
 linux-user/hppa/signal.c                      |   2 +-
 linux-user/linuxload.c                        |   2 +-
 linux-user/m68k/cpu_loop.c                    |   2 +-
 linux-user/m68k/target_cpu.h                  |   2 +-
 linux-user/main.c                             |   8 +-
 linux-user/mips/cpu_loop.c                    |   2 +-
 linux-user/ppc/signal.c                       |   4 +-
 linux-user/qemu.h                             |   5 +
 linux-user/riscv/cpu_loop.c                   |   2 +-
 linux-user/signal-common.h                    |   2 +-
 linux-user/signal.c                           |  30 +--
 linux-user/syscall.c                          |  32 +--
 linux-user/user-internals.h                   |   2 +-
 linux-user/vm86.c                             |  18 +-
 linux-user/xtensa/signal.c                    |   2 +-
 plugins/api.c                                 |   8 +-
 semihosting/arm-compat-semi.c                 |   8 +-
 tests/tcg/multiarch/Makefile.target           |  17 +-
 tests/tcg/multiarch/follow-fork-mode.c        |  56 ++++
 .../gdbstub/follow-fork-mode-child.py         |  40 +++
 .../gdbstub/follow-fork-mode-parent.py        |  16 ++
 37 files changed, 511 insertions(+), 101 deletions(-)
 create mode 100644 tests/tcg/multiarch/follow-fork-mode.c
 create mode 100644 tests/tcg/multiarch/gdbstub/follow-fork-mode-child.py
 create mode 100644 tests/tcg/multiarch/gdbstub/follow-fork-mode-parent.py

-- 
2.43.2



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

end of thread, other threads:[~2024-03-04 18:04 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-19 14:15 [PATCH v4 00/12] gdbstub: Implement follow-fork-mode child Ilya Leoshkevich
2024-02-19 14:15 ` [PATCH v4 01/12] gdbstub: Support disablement in a multi-threaded process Ilya Leoshkevich
2024-02-19 14:15 ` [PATCH v4 02/12] {linux,bsd}-user: Introduce get_task_state() Ilya Leoshkevich
2024-02-19 14:32   ` Warner Losh
2024-02-19 20:46   ` Richard Henderson
2024-02-19 14:15 ` [PATCH v4 03/12] {linux,bsd}-user: Update ts_tid after fork() Ilya Leoshkevich
2024-02-19 14:33   ` Warner Losh
2024-02-19 14:15 ` [PATCH v4 04/12] gdbstub: Introduce gdbserver_fork_start() Ilya Leoshkevich
2024-02-19 14:15 ` [PATCH v4 05/12] {linux,bsd}-user: Pass pid to fork_end() Ilya Leoshkevich
2024-02-19 14:15 ` [PATCH v4 06/12] {linux,bsd}-user: Pass pid to gdbserver_fork() Ilya Leoshkevich
2024-02-19 14:15 ` [PATCH v4 07/12] gdbstub: Call gdbserver_fork() both in parent and in child Ilya Leoshkevich
2024-02-19 14:15 ` [PATCH v4 08/12] gdbstub: Introduce gdb_handle_query_supported_user() Ilya Leoshkevich
2024-02-19 14:15 ` [PATCH v4 09/12] gdbstub: Introduce gdb_handle_set_thread_user() Ilya Leoshkevich
2024-02-19 14:15 ` [PATCH v4 10/12] gdbstub: Introduce gdb_handle_detach_user() Ilya Leoshkevich
2024-02-19 14:15 ` [PATCH v4 11/12] gdbstub: Implement follow-fork-mode child Ilya Leoshkevich
2024-02-19 14:16 ` [PATCH v4 12/12] tests/tcg: Add two follow-fork-mode tests Ilya Leoshkevich
2024-03-04 18:03 ` [PATCH v4 00/12] gdbstub: Implement follow-fork-mode child 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).