This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
gdb and binutils branch master updated. 6a3cb8e88a739c967bb9b2d8774bf96b87a7fda4
- From: palves at sourceware dot org
- To: gdb-cvs at sourceware dot org
- Date: 21 May 2014 17:32:07 -0000
- Subject: gdb and binutils branch master updated. 6a3cb8e88a739c967bb9b2d8774bf96b87a7fda4
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".
The branch, master has been updated
via 6a3cb8e88a739c967bb9b2d8774bf96b87a7fda4 (commit)
via 930ee1b1bf8c36a746ea5f7456afba094aabc887 (commit)
via 1f5d1b137becfbd8d021640384559b1a458db1ff (commit)
via 132f8e032c8e82980c12d861089da561fc4dda35 (commit)
via 03c136c31c777605cb4f13cfc1286d21b4ffa3b0 (commit)
via a635d0f3d5a1e9a53cb9a7a61fc21b819f0db0d5 (commit)
via 4f9b5133a07078ee9e1b4e9348036fa3913aa4b7 (commit)
via bc85afdef59fc5f12765c829bbec7b6dedec62e6 (commit)
via 4ebfc96eba45f869ad109fdb7d1149bb4af3b3a2 (commit)
from 2648dfede02e487f89b9a8643b858aed755f00bd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6a3cb8e88a739c967bb9b2d8774bf96b87a7fda4
commit 6a3cb8e88a739c967bb9b2d8774bf96b87a7fda4
Author: Pedro Alves <palves@redhat.com>
Date: Wed May 21 18:30:47 2014 +0100
Allow making GDB not automatically connect to the native target.
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 the patch, 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 made "target native" work
instead of erroring out as today.
Before:
(gdb) target native
Use the "run" command to start a native process.
After:
(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 a non-native-target board, it's always a
bug to launch a program with the native target. Turns out we still
have one such case this patch 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
On the patch itself, probably the least obvious bit is the need to go
through all targets, and move the unpush_target call to after the
generic_mourn_inferior call instead of before. This is what
inf-ptrace.c does too, ever since multi-process support was added.
The reason inf-ptrace.c does things in that order is that in the
current multi-process/single-target model, we shouldn't unpush the
target if there are still other live inferiors being debugged. The
check for that is "have_inferiors ()" (a misnomer nowadays...), which
does:
have_inferiors (void)
{
for (inf = inferior_list; inf; inf = inf->next)
if (inf->pid != 0)
return 1;
It's generic_mourn_inferior that ends up clearing inf->pid, so we need
to call it before the have_inferiors check. To make all native
targets behave the same WRT to explicit "target native", I've added an
inf_child_maybe_unpush_target function that targets call instead of
calling unpush_target directly, and as that includes the
have_inferiors check, I needed to adjust the targets.
Tested on x86_64 Fedora 20, native, and also with the
extended-gdbserver board.
Confirmed a cross build of djgpp gdb still builds.
Smoke tested a cross build of Windows gdb under Wine.
Untested otherwise.
gdb/
2014-05-21 Pedro Alves <palves@redhat.com>
* inf-child.c (inf_child_ops, inf_child_explicitly_opened): New
globals.
(inf_child_open_target): New function.
(inf_child_open): Use inf_child_open_target to push the target
instead of erroring out.
(inf_child_disconnect, inf_child_close)
(inf_child_maybe_unpush_target): New functions.
(inf_child_target): Install inf_child_disconnect and
inf_child_close. Store a pointer to the returned object.
* inf-child.h (inf_child_open_target, inf_child_maybe_unpush): New
declarations.
* target.c (auto_connect_native_target): New global.
(show_default_run_target): New function.
(find_default_run_target): Return NULL if automatically connecting
to the native target is disabled.
(_initialize_target): Install set/show auto-connect-native-target.
* NEWS: Mention "set auto-connect-native-target", and "target
native".
* linux-nat.c (super_close): New global.
(linux_nat_close): Call super_close.
(linux_nat_add_target): Store a pointer to the base class's
to_close method.
* inf-ptrace.c (inf_ptrace_mourn_inferior, inf_ptrace_detach): Use
inf_child_maybe_unpush.
* inf-ttrace.c (inf_ttrace_him): Don't push the target if it is
already pushed.
(inf_ttrace_mourn_inferior): Only unpush the target after mourning
the inferior. Use inf_child_maybe_unpush_target.
(inf_ttrace_attach): Don't push the target if it is already
pushed.
(inf_ttrace_detach): Use inf_child_maybe_unpush_target.
* darwin-nat.c (darwin_mourn_inferior): Only unpush the target
after mourning the inferior. Use inf_child_maybe_unpush_target.
(darwin_attach_pid): Don't push the target if it is already
pushed.
* gnu-nat.c (gnu_mourn_inferior): Only unpush the target after
mourning the inferior. Use inf_child_maybe_unpush_target.
(gnu_detach): Use inf_child_maybe_unpush_target.
* go32-nat.c (go32_create_inferior): Don't push the target if it
is already pushed.
(go32_mourn_inferior): Use inf_child_maybe_unpush_target.
* nto-procfs.c (procfs_is_nto_target): Adjust comment.
(procfs_open): Rename to ...
(procfs_open_1): ... this. Add target_ops parameter. Adjust
comments. Can target_preopen before changing node. Call
inf_child_open_target to push the target explicitly.
(procfs_attach): Don't push the target if it is already pushed.
(procfs_detach): Use inf_child_maybe_unpush_target.
(procfs_create_inferior): Don't push the target if it is already
pushed.
(nto_native_ops): New global.
(procfs_open): Reimplement.
(procfs_native_open): New function.
(init_procfs_targets): Install procfs_native_open as to_open of
"target native". Store a pointer to the "native" target in
nto_native_ops.
* procfs.c (procfs_attach): Don't push the target if it is already
pushed.
(procfs_detach): Use inf_child_maybe_unpush_target.
(procfs_mourn_inferior): Only unpush the target after mourning the
inferior. Use inf_child_maybe_unpush_target.
(procfs_init_inferior): Don't push the target if it is already
pushed.
* windows-nat.c (do_initial_windows_stuff): Don't push the target
if it is already pushed.
(windows_detach): Use inf_child_maybe_unpush_target.
(windows_mourn_inferior): Only unpush the target after mourning
the inferior. Use inf_child_maybe_unpush_target.
gdb/doc/
2014-05-21 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Starting): Document "set/show
auto-connect-native-target".
(Target Commands): Document "target native".
gdb/testsuite/
2014-05-21 Pedro Alves <palves@redhat.com>
* boards/gdbserver-base.exp (GDBFLAGS): Set to "set
auto-connect-native-target off".
* gdb.base/auto-connect-native-target.c: New file.
* gdb.base/auto-connect-native-target.exp: New file.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=930ee1b1bf8c36a746ea5f7456afba094aabc887
commit 930ee1b1bf8c36a746ea5f7456afba094aabc887
Author: Pedro Alves <palves@redhat.com>
Date: Wed May 21 18:30:46 2014 +0100
NEWS: Mention native target renames.
gdb/
2014-05-21 Pedro Alves <palves@redhat.com>
* NEWS: Mention that the "child", "GNU, "djgpp", "darwin-child"
and "procfs" targets are now called "native" instead.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1f5d1b137becfbd8d021640384559b1a458db1ff
commit 1f5d1b137becfbd8d021640384559b1a458db1ff
Author: Pedro Alves <palves@redhat.com>
Date: Wed May 21 18:30:46 2014 +0100
go32-nat.c: Don't override to_open.
Although the string says "Done.", nothing is pushing the target as is.
Removing the method override let's us fall through to the the base
to_open implemention in inf-child.c, which will push the target in
reaction to "target native" in a follow up patch.
gdb/
2014-05-21 Pedro Alves <palves@redhat.com>
* go32-nat.c (go32_open): Delete.
(go32_target): Don't override the to_open method.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=132f8e032c8e82980c12d861089da561fc4dda35
commit 132f8e032c8e82980c12d861089da561fc4dda35
Author: Pedro Alves <palves@redhat.com>
Date: Wed May 21 18:30:45 2014 +0100
nto-procfs.c: Add "target native".
This makes QNX/NTO end up with two targets. It preserves "target
procfs <node>", and adds a "native" target to be like other native
ports.
Not tested.
gdb/
2014-05-21 Pedro Alves <palves@redhat.com>
* nto-procfs.c (procfs_can_run): New function.
(nto_procfs_ops): New global.
(init_procfs_targets): New, based on procfs_target. Install
"target native" in addition to "target procfs".
(_initialize_procfs): Call init_procfs_targets instead of adding
the target here.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=03c136c31c777605cb4f13cfc1286d21b4ffa3b0
commit 03c136c31c777605cb4f13cfc1286d21b4ffa3b0
Author: Pedro Alves <palves@redhat.com>
Date: Wed May 21 18:30:45 2014 +0100
Windows: Rename "target child" -> "target native"
To be like other native targets.
Leave to_shortname, to_longname, to_doc as inf-child.c sets them:
t->to_shortname = "native";
t->to_longname = "Native process";
t->to_doc = "Native process (started by the \"run\" command).";
gdb/
2014-05-21 Pedro Alves <palves@redhat.com>
* windows-nat.c (windows_target): Don't override to_shortname,
to_longname or to_doc.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a635d0f3d5a1e9a53cb9a7a61fc21b819f0db0d5
commit a635d0f3d5a1e9a53cb9a7a61fc21b819f0db0d5
Author: Pedro Alves <palves@redhat.com>
Date: Wed May 21 18:30:44 2014 +0100
Rename "target GNU" -> "target native"
To be like other native targets.
Leave to_shortname, to_longname, to_doc as inf-child.c sets them:
t->to_shortname = "native";
t->to_longname = "Native process";
t->to_doc = "Native process (started by the \"run\" command).";
gdb/
2014-05-21 Pedro Alves <palves@redhat.com>
* gnu-nat.c (gnu): Don't override to_shortname, to_longname or
to_doc.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4f9b5133a07078ee9e1b4e9348036fa3913aa4b7
commit 4f9b5133a07078ee9e1b4e9348036fa3913aa4b7
Author: Pedro Alves <palves@redhat.com>
Date: Wed May 21 18:30:43 2014 +0100
Rename "target darwin-child" -> "target native"
To be like other native targets.
Leave to_shortname, to_longname, to_doc as inf-child.c sets them:
t->to_shortname = "native";
t->to_longname = "Native process";
t->to_doc = "Native process (started by the \"run\" command).";
gdb/
2014-05-21 Pedro Alves <palves@redhat.com>
* darwin-nat.c (_initialize_darwin_inferior): Don't override
to_shortname, to_longname or to_doc.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=bc85afdef59fc5f12765c829bbec7b6dedec62e6
commit bc85afdef59fc5f12765c829bbec7b6dedec62e6
Author: Pedro Alves <palves@redhat.com>
Date: Wed May 21 18:30:43 2014 +0100
Rename "target djgpp" -> "target native"
To be like other native targets.
Leave to_shortname, to_longname, to_doc as inf-child.c sets them:
t->to_shortname = "native";
t->to_longname = "Native process";
t->to_doc = "Native process (started by the \"run\" command).";
gdb/
2014-05-21 Pedro Alves <palves@redhat.com>
* go32-nat.c (go32_target): Don't override to_shortname,
to_longname or to_doc.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4ebfc96eba45f869ad109fdb7d1149bb4af3b3a2
commit 4ebfc96eba45f869ad109fdb7d1149bb4af3b3a2
Author: Pedro Alves <palves@redhat.com>
Date: Wed May 21 18:30:43 2014 +0100
Rename "target child" to "target native".
I had been pondering renaming "target child" to something else.
"child" is a little lie in case of "attach", and not exactly very
clear to users, IMO. By best suggestion is "target native". If I
were to explain what "target child" is, I'd just start out with "it's
the native target" anyway. I was worrying a little that "native"
might be a lie too if some port comes up with a default target that
can run but is not really native, but I think that's a very minor
issue - we can consider that "native" really means the default built
in target that GDB supports, instead of saying that's the target that
debugs host native processes, if it turns out necessary.
This change doesn't affect users much, because "target child" results
in error today:
(gdb) target child
Use the "run" command to start a child process.
Other places "child" is visible:
(gdb) help target
...
List of target subcommands:
target child -- Child process (started by the "run" command)
target core -- Use a core file as a target
target exec -- Use an executable file as a target
...
(gdb) info target
Symbols from "/home/pedro/gdb/mygit/build/gdb/gdb".
Child process:
Using the running image of child Thread 0x7ffff7fc9740 (LWP 4818).
While running this, GDB does not access memory from...
...
These places will say "native" instead. I think that's a good thing.
gdb/
2014-05-21 Pedro Alves <palves@redhat.com>
* inf-child.c (inf_child_open): Remove mention of "child".
(inf_child_target): Rename target to "native" instead of "child".
gdb/testsuite/
2014-05-21 Pedro Alves <palves@redhat.com>
* gdb.base/default.exp: Test "target native" instead of "target
child".
-----------------------------------------------------------------------
Summary of changes:
gdb/ChangeLog | 112 +++++++++++
gdb/NEWS | 21 ++
gdb/darwin-nat.c | 10 +-
gdb/doc/ChangeLog | 6 +
gdb/doc/gdb.texinfo | 58 ++++++
gdb/gnu-nat.c | 8 +-
gdb/go32-nat.c | 16 +--
gdb/inf-child.c | 68 ++++++-
gdb/inf-child.h | 15 ++
gdb/inf-ptrace.c | 6 +-
gdb/inf-ttrace.c | 10 +-
gdb/linux-nat.c | 8 +
gdb/nto-procfs.c | 98 +++++++---
gdb/procfs.c | 13 +-
gdb/target.c | 48 ++++-
gdb/testsuite/ChangeLog | 12 ++
gdb/testsuite/boards/gdbserver-base.exp | 2 +
.../gdb.base/auto-connect-native-target.c | 23 +++
.../gdb.base/auto-connect-native-target.exp | 209 ++++++++++++++++++++
gdb/testsuite/gdb.base/default.exp | 4 +-
gdb/windows-nat.c | 10 +-
21 files changed, 671 insertions(+), 86 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
hooks/post-receive
--
gdb and binutils