public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/8] Allow making GDB not automatically connect to the native target (and add "target native").
@ 2014-03-17 15:23 Pedro Alves
  2014-03-17 15:23 ` [PATCH 1/8] Rename "target djgpp" -> "target native" Pedro Alves
                   ` (10 more replies)
  0 siblings, 11 replies; 21+ messages in thread
From: Pedro Alves @ 2014-03-17 15:23 UTC (permalink / raw)
  To: gdb-patches

Sometimes it's useful to be able to disable the automatic connection
to the native target.  E.g., sometimes GDB disconnects from the
extended-remote target I was debugging, without me noticing it, and
then I do "run".  That starts the program locally, and only after a
little head scratch session do I figure out the program is running
locally instead of remotely as intended.  Same thing with "attach",
"info os", etc.

With this series, we now can have this instead:

 (gdb) set auto-connect-native-target off
 (gdb) target extended-remote :9999
 ...
 *gdb disconnects*
 (gdb) run
 Don't know how to run.  Try "help target".

To still be able to connect to the native target with
auto-connect-native-target set to off, I've renamed all native targets
to "target native", and made "target native" work instead of erroring
out as today.

E.g., before, on GNU/Linux and most native targets, the native target
is called "child", and trying to open it yields:

 (gdb) target child
 Use the "run" command to start a child process.

After the series we get:

 (gdb) target native
 Done.  Use the "run" command to start a process.
 (gdb) maint print target-stack
 The current target stack is:
   - native (Native process)
   - exec (Local exec file)
   - None (None)
 (gdb) run
 Starting program: ./a.out
 ...

I've also wanted this for the testsuite, when running against the
native-extended-gdbserver.exp board (runs against gdbserver in
extended-remote mode).  With that board, it's always a bug to launch a
program with the native target.  Turns out we still have one such case
this series catches:

 (gdb) break main
 Breakpoint 1 at 0x4009e5: file ../../../src/gdb/testsuite/gdb.base/coremaker.c, line 138.
 (gdb) run
 Don't know how to run.  Try "help target".
 (gdb) FAIL: gdb.base/corefile.exp: run: with core

For convenience, I've also put this at:
  git@github.com:palves/gdb.git target_native_v1

Pedro Alves (8):
  Rename "target djgpp" -> "target native"
  Rename "target darwin-child" -> "target native"
  Rename "target GNU" -> "target native"
  Windows: Rename "target child" -> "target native"
  nto-procfs.c: Add "target native".
  go32-nat.c: Don't override to_open.
  NEWS: Mention native target renames.
  Allow making GDB not automatically connect to the native target.

 gdb/NEWS                                           |  21 +++
 gdb/darwin-nat.c                                   |  10 +-
 gdb/doc/gdb.texinfo                                |  58 ++++++
 gdb/gnu-nat.c                                      |   8 +-
 gdb/go32-nat.c                                     |  16 +-
 gdb/inf-child.c                                    |  62 +++++-
 gdb/inf-child.h                                    |  11 ++
 gdb/inf-ptrace.c                                   |   6 +-
 gdb/inf-ttrace.c                                   |  10 +-
 gdb/linux-nat.c                                    |   8 +
 gdb/nto-procfs.c                                   |  97 +++++++---
 gdb/procfs.c                                       |  13 +-
 gdb/target.c                                       |  48 ++++-
 gdb/testsuite/boards/native-extended-gdbserver.exp |   2 +
 .../gdb.base/auto-connect-native-target.c          |  23 +++
 .../gdb.base/auto-connect-native-target.exp        | 209 +++++++++++++++++++++
 gdb/windows-nat.c                                  |  10 +-
 17 files changed, 531 insertions(+), 81 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/auto-connect-native-target.c
 create mode 100644 gdb/testsuite/gdb.base/auto-connect-native-target.exp

-- 
1.7.11.7

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

end of thread, other threads:[~2014-06-03  5:35 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-17 15:23 [PATCH 0/8] Allow making GDB not automatically connect to the native target (and add "target native") Pedro Alves
2014-03-17 15:23 ` [PATCH 1/8] Rename "target djgpp" -> "target native" Pedro Alves
2014-03-17 16:44   ` Eli Zaretskii
2014-03-17 15:23 ` [PATCH 4/8] Windows: Rename "target child" " Pedro Alves
2014-03-17 15:23 ` [PATCH 8/8] Allow making GDB not automatically connect to the native target Pedro Alves
2014-03-17 16:47   ` Eli Zaretskii
2014-03-18 21:55   ` Stan Shebs
2014-03-25 20:06   ` Doug Evans
2014-05-21 17:53     ` Pedro Alves
2014-06-03  5:35   ` [PATCH OBV] Fix a regexp pattern in gdb.base/auto-connect-native-target.exp (Re: [PATCH 8/8] Allow making GDB not automatically connect to the native target.) Yao Qi
2014-03-17 15:23 ` [PATCH 3/8] Rename "target GNU" -> "target native" Pedro Alves
2014-03-17 15:23 ` [PATCH 5/8] nto-procfs.c: Add " Pedro Alves
2014-03-17 15:23 ` [PATCH 7/8] NEWS: Mention native target renames Pedro Alves
2014-03-17 16:45   ` Eli Zaretskii
2014-03-17 15:23 ` [PATCH 6/8] go32-nat.c: Don't override to_open Pedro Alves
2014-03-17 16:44   ` Eli Zaretskii
2014-03-17 15:23 ` [PATCH 2/8] Rename "target darwin-child" -> "target native" Pedro Alves
2014-03-17 17:01 ` [PATCH 0.5/8] Rename "target child" to " Pedro Alves
2014-03-17 17:02 ` Pedro Alves
2014-06-03  5:29   ` [PATCH OBV] Fix regexp pattern in gdb.base/default.exp (Re: [PATCH 0.5/8] Rename "target child" to "target native".) Yao Qi
2014-05-21 17:57 ` [pushed] Re: [PATCH 0/8] Allow making GDB not automatically connect to the native target (and add "target native") Pedro Alves

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