public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/23] Multi-target support
@ 2019-09-06 23:28 Pedro Alves
  2019-09-06 23:28 ` [PATCH 06/23] Don't check target is running in remote_target::mourn_inferior Pedro Alves
                   ` (25 more replies)
  0 siblings, 26 replies; 68+ messages in thread
From: Pedro Alves @ 2019-09-06 23:28 UTC (permalink / raw)
  To: gdb-patches

This commit adds multi-target support to GDB.  What this means is that
with this commit, GDB can now be connected to different targets at the
same time.  E.g., you can debug a live native process and a core dump
at the same time, connect to multiple gdbservers, etc.

Patches 1 to 16 are preparatory patches.

Patch 17 is the actual multi-target patch.  This is the largest patch
in the series.  It does a number of things at the same time, but
they're all intertwined, so I gave up on splitting it further.

Patch 18 adds tests.  Split out because patch 17 is already too big as
is.

Patch 21 does some user-visible changes, including a new command to
list open target connections.  This is just the bare minimum I could
think of that is necessary for multi-target work.  I'm sure we'll find
other tweaks to other commands necessary.

Documentation is in patch 23.

This surely breaks the build on non-Linux ports as is.  I have not
tried to adjust the host-specific nat files to function API changes,
but I don't envision any serious trouble.  The fixes they'll need will
be quite mechanical, mostly usually to pass
'current_inferior()->process_target ()' to functions that gained a new
'process_stratum_target *' parameter, similar to the changes to tdep
files in the multi-target patch, need for which was caught with
--enable-targets=all.

I've pushed this to users/palves/multi-target-v1 on sourceware for
review and testing convenience.

Pedro Alves (23):
  Preserve selected thread in all-stop w/ background execution
  Don't rely on inferior_ptid in record_full_wait
  Make "show remote exec-file" inferior-aware
  exceptions.c:print_flush: Remove obsolete check
  Make target_ops::has_execution take an 'inferior *' instead of a
    ptid_t
  Don't check target is running in remote_target::mourn_inferior
  Delete unnecessary code from kill_command
  Introduce switch_to_inferior_no_thread
  switch inferior/thread before calling target methods
  Some get_last_target_status tweaks
  tfile_target::close: trace_fd can't be -1
  Use all_non_exited_inferiors in infrun.c
  Delete exit_inferior_silent(int pid)
  Tweak handling of remote errors in response to resumption packet
  Fix reconnecting to a gdbserver already debugging multiple processes,
    I
  Fix reconnecting to a gdbserver already debugging multiple processes,
    II
  Multi-target support
  Add multi-target tests
  gdbarch-selftests.c: No longer error out if debugging something
  Revert 'Remove unused struct serial::name field'
  Add "info connections" command, "info inferiors" connection
    number/string
  Require always-non-stop for multi-target resumptions
  Multi-target: NEWS and user manual

 gdb/doc/gdb.texinfo                                | 140 +++--
 gdb/doc/guile.texi                                 |   4 +-
 gdb/doc/python.texi                                |   6 +-
 gdb/NEWS                                           |  29 +
 gdb/Makefile.in                                    |   1 +
 gdb/ada-tasks.c                                    |   4 +-
 gdb/amd64-fbsd-tdep.c                              |   4 +-
 gdb/amd64-linux-nat.c                              |   2 +-
 gdb/break-catch-sig.c                              |   3 +-
 gdb/break-catch-syscall.c                          |   3 +-
 gdb/breakpoint.c                                   |  25 +-
 gdb/bsd-uthread.c                                  |  20 +-
 gdb/btrace.c                                       |   2 +-
 gdb/corelow.c                                      |  10 +-
 gdb/ctf.c                                          |   2 +-
 gdb/event-top.c                                    |  14 +-
 gdb/exceptions.c                                   |   6 +-
 gdb/exec.c                                         |  51 +-
 gdb/exec.h                                         |   7 +
 gdb/fbsd-tdep.c                                    |   3 +-
 gdb/fork-child.c                                   |   7 +-
 gdb/gdbarch-selftests.c                            |   5 -
 gdb/gdbserver/fork-child.c                         |   3 +-
 gdb/gdbserver/inferiors.c                          |   2 +-
 gdb/gdbserver/linux-low.c                          |   2 +-
 gdb/gdbserver/remote-utils.c                       |   2 +-
 gdb/gdbserver/target.c                             |   8 +-
 gdb/gdbserver/target.h                             |   9 +-
 gdb/gdbsupport/common-gdbthread.h                  |   5 +-
 gdb/gdbthread.h                                    | 133 ++--
 gdb/i386-fbsd-tdep.c                               |   4 +-
 gdb/inf-child.c                                    |   2 +-
 gdb/inf-ptrace.c                                   |   6 +-
 gdb/infcall.c                                      |   3 +-
 gdb/infcmd.c                                       | 129 ++--
 gdb/inferior-iter.h                                |  77 ++-
 gdb/inferior.c                                     | 155 +++--
 gdb/inferior.h                                     |  71 ++-
 gdb/infrun.c                                       | 683 ++++++++++++++++-----
 gdb/infrun.h                                       |  16 +-
 gdb/inline-frame.c                                 |  51 +-
 gdb/inline-frame.h                                 |  12 +-
 gdb/linux-fork.c                                   |   5 +-
 gdb/linux-nat.c                                    |  74 ++-
 gdb/linux-nat.h                                    |   1 +
 gdb/linux-tdep.c                                   |   3 +-
 gdb/linux-thread-db.c                              | 112 ++--
 gdb/mi/mi-interp.c                                 |  10 +-
 gdb/nat/fork-inferior.c                            |   8 +-
 gdb/nat/fork-inferior.h                            |   5 +-
 gdb/ppc-fbsd-tdep.c                                |   4 +-
 gdb/proc-service.c                                 |  17 +-
 gdb/process-stratum-target.c                       |  12 +-
 gdb/process-stratum-target.h                       |  31 +-
 gdb/python/py-threadevent.c                        |   4 +-
 gdb/ravenscar-thread.c                             |  16 +-
 gdb/record-btrace.c                                |  43 +-
 gdb/record-full.c                                  |  22 +-
 gdb/regcache.c                                     | 162 +++--
 gdb/regcache.h                                     |  30 +-
 gdb/remote.c                                       | 290 +++++----
 gdb/riscv-fbsd-tdep.c                              |   4 +-
 gdb/serial.c                                       |   4 +
 gdb/serial.h                                       |   1 +
 gdb/sol2-tdep.c                                    |   2 +-
 gdb/solib-spu.c                                    |   3 +-
 gdb/solib-svr4.c                                   |   3 +-
 gdb/spu-multiarch.c                                |   6 +-
 gdb/spu-tdep.c                                     |   8 +-
 gdb/target-connection.c                            | 153 +++++
 gdb/target-connection.h                            |  40 ++
 gdb/target-delegates.c                             |  27 +
 gdb/target.c                                       | 166 +++--
 gdb/target.h                                       |  23 +-
 gdb/testsuite/gdb.base/fork-running-state.exp      |  17 +-
 .../gdb.base/kill-detach-inferiors-cmd.exp         |   4 +-
 gdb/testsuite/gdb.base/quit-live.exp               |   2 +-
 gdb/testsuite/gdb.base/remote-exec-file.exp        |  46 ++
 gdb/testsuite/gdb.guile/scm-progspace.exp          |   2 +-
 gdb/testsuite/gdb.linespec/linespec.exp            |   2 +-
 gdb/testsuite/gdb.mi/new-ui-mi-sync.exp            |   2 +-
 .../gdb.mi/user-selected-context-sync.exp          |   2 +-
 gdb/testsuite/gdb.multi/multi-target.c             | 100 +++
 gdb/testsuite/gdb.multi/multi-target.exp           | 387 ++++++++++++
 gdb/testsuite/gdb.multi/remove-inferiors.exp       |   2 +-
 gdb/testsuite/gdb.multi/watchpoint-multi.exp       |   2 +-
 gdb/testsuite/gdb.python/py-inferior.exp           |   4 +-
 .../gdb.server/extended-remote-restart.exp         |  22 +-
 gdb/testsuite/gdb.threads/async.c                  |  70 +++
 gdb/testsuite/gdb.threads/async.exp                |  98 +++
 gdb/testsuite/gdb.threads/fork-plus-threads.exp    |   2 +-
 .../forking-threads-plus-breakpoint.exp            |   2 +-
 gdb/testsuite/gdb.trace/report.exp                 |   2 +-
 gdb/testsuite/lib/gdbserver-support.exp            |   4 +
 gdb/thread-iter.c                                  |  14 +-
 gdb/thread-iter.h                                  |  25 +-
 gdb/thread.c                                       | 230 ++++---
 gdb/top.c                                          |  17 +-
 gdb/tracefile-tfile.c                              |   5 +-
 gdb/tracefile.h                                    |   2 +-
 100 files changed, 3098 insertions(+), 977 deletions(-)
 create mode 100644 gdb/target-connection.c
 create mode 100644 gdb/target-connection.h
 create mode 100644 gdb/testsuite/gdb.base/remote-exec-file.exp
 create mode 100644 gdb/testsuite/gdb.multi/multi-target.c
 create mode 100644 gdb/testsuite/gdb.multi/multi-target.exp
 create mode 100644 gdb/testsuite/gdb.threads/async.c
 create mode 100644 gdb/testsuite/gdb.threads/async.exp

-- 
2.14.5

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

end of thread, other threads:[~2020-08-03  0:08 UTC | newest]

Thread overview: 68+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 23:28 [PATCH 00/23] Multi-target support Pedro Alves
2019-09-06 23:28 ` [PATCH 06/23] Don't check target is running in remote_target::mourn_inferior Pedro Alves
2019-09-06 23:28 ` [PATCH 13/23] Delete exit_inferior_silent(int pid) Pedro Alves
2019-09-06 23:28 ` [PATCH 20/23] Revert 'Remove unused struct serial::name field' Pedro Alves
2019-09-06 23:47   ` Christian Biesinger via gdb-patches
2019-09-08 19:30     ` Pedro Alves
2019-09-06 23:28 ` [PATCH 19/23] gdbarch-selftests.c: No longer error out if debugging something Pedro Alves
2019-09-06 23:28 ` [PATCH 15/23] Fix reconnecting to a gdbserver already debugging multiple processes, I Pedro Alves
2019-09-06 23:28 ` [PATCH 11/23] tfile_target::close: trace_fd can't be -1 Pedro Alves
2019-09-06 23:28 ` [PATCH 02/23] Don't rely on inferior_ptid in record_full_wait Pedro Alves
2020-07-31  3:17   ` Tom Tromey
2020-08-01 16:14     ` Simon Marchi
2020-08-01 19:32       ` John Baldwin
2020-08-01 20:47         ` Tom Tromey
2020-08-01 20:46       ` Tom Tromey
2020-08-01 22:56         ` Simon Marchi
2020-08-02 17:52           ` Tom Tromey
2020-08-03  0:08             ` Simon Marchi
2019-09-06 23:28 ` [PATCH 16/23] Fix reconnecting to a gdbserver already debugging multiple processes, II Pedro Alves
2019-09-06 23:28 ` [PATCH 03/23] Make "show remote exec-file" inferior-aware Pedro Alves
2019-09-06 23:28 ` [PATCH 08/23] Introduce switch_to_inferior_no_thread Pedro Alves
2019-09-09 18:42   ` Tom Tromey
2019-10-17  1:07     ` Pedro Alves
2019-09-06 23:28 ` [PATCH 09/23] switch inferior/thread before calling target methods Pedro Alves
2019-09-06 23:28 ` [PATCH 17/23] Multi-target support Pedro Alves
2019-09-11 17:11   ` Tom Tromey
2019-10-17  1:54     ` Pedro Alves
2019-09-06 23:28 ` [PATCH 01/23] Preserve selected thread in all-stop w/ background execution Pedro Alves
2019-10-09  9:36   ` Aktemur, Tankut Baris
2019-10-16 23:54     ` [PATCH v1.1 " Pedro Alves
2019-10-17 10:21       ` Aktemur, Tankut Baris
2019-09-06 23:28 ` [PATCH 18/23] Add multi-target tests Pedro Alves
2019-10-09 16:01   ` Aktemur, Tankut Baris
2019-10-17  0:55     ` Pedro Alves
2019-09-06 23:28 ` [PATCH 10/23] Some get_last_target_status tweaks Pedro Alves
2019-09-09 18:53   ` Tom Tromey
2019-10-17  1:14     ` Pedro Alves
2019-09-06 23:33 ` [PATCH 23/23] Multi-target: NEWS and user manual Pedro Alves
2019-09-07  6:33   ` Eli Zaretskii
2019-10-17  2:08     ` Pedro Alves
2019-10-17  7:55       ` Eli Zaretskii
2019-10-17  2:42     ` Pedro Alves
2019-10-17  8:14       ` Eli Zaretskii
2019-10-17 15:31         ` Pedro Alves
2019-09-06 23:34 ` [PATCH 04/23] exceptions.c:print_flush: Remove obsolete check Pedro Alves
2019-09-09 18:07   ` Tom Tromey
2019-09-06 23:35 ` [PATCH 05/23] Make target_ops::has_execution take an 'inferior *' instead of a ptid_t Pedro Alves
2019-09-09 18:12   ` Tom Tromey
2019-09-06 23:36 ` [PATCH 14/23] Tweak handling of remote errors in response to resumption packet Pedro Alves
2019-10-09 13:35   ` Aktemur, Tankut Baris
2019-10-17  0:54     ` [PATCH 14.5/23] Avoid another inferior_ptid reference in gdb/remote.c (Re: [PATCH 14/23] Tweak handling of remote errors in response to resumption packet) Pedro Alves
2019-10-17 10:45       ` Aktemur, Tankut Baris
2019-09-06 23:36 ` [PATCH 07/23] Delete unnecessary code from kill_command Pedro Alves
2019-10-01 10:19   ` Aktemur, Tankut Baris
2019-10-01 13:28     ` Aktemur, Tankut Baris
2019-09-06 23:36 ` [PATCH 12/23] Use all_non_exited_inferiors in infrun.c Pedro Alves
2019-09-06 23:37 ` [PATCH 22/23] Require always-non-stop for multi-target resumptions Pedro Alves
2019-09-06 23:37 ` [PATCH 21/23] Add "info connections" command, "info inferiors" connection number/string Pedro Alves
2019-09-09 20:18   ` Tom Tromey
2019-10-17  2:21     ` Pedro Alves
2019-10-17 14:23       ` Tom Tromey
2019-09-07 11:19 ` [PATCH 00/23] Multi-target support Philippe Waroquiers
2019-09-08 20:06   ` Pedro Alves
2019-09-08 20:50     ` Philippe Waroquiers
2019-10-16 19:08       ` Pedro Alves
2019-10-16 19:14       ` [PATCH] Avoid inferior_ptid reference in gdb/remote.c (Re: [PATCH 00/23] Multi-target support) Pedro Alves
2019-09-09 19:09 ` [PATCH 00/23] Multi-target support Tom Tromey
2019-09-09 20:22 ` Tom Tromey

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 read-only IMAP folder(s) and NNTP newsgroup(s).