Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [pushed] Re: [PATCH 0/8] Allow making GDB not automatically connect to the native target (and add "target native").
Date: Wed, 21 May 2014 17:57:00 -0000	[thread overview]
Message-ID: <537CE8FF.3070103@redhat.com> (raw)
In-Reply-To: <1395069784-7406-1-git-send-email-palves@redhat.com>

I've pushed this in now.

Pedro Alves

On 03/17/2014 03:22 PM, Pedro Alves wrote:
> 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
> 


-- 
Pedro Alves


      parent reply	other threads:[~2014-05-21 17:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-17 15:23 Pedro Alves
2014-03-17 15:23 ` [PATCH 3/8] Rename "target GNU" -> "target native" 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 5/8] nto-procfs.c: Add "target native" Pedro Alves
2014-03-17 15:23 ` [PATCH 2/8] Rename "target darwin-child" -> " 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 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 6/8] go32-nat.c: Don't override to_open Pedro Alves
2014-03-17 16:44   ` Eli Zaretskii
2014-03-17 17:01 ` [PATCH 0.5/8] Rename "target child" to "target native" 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 ` Pedro Alves [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=537CE8FF.3070103@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox