aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2014-07-28 12:53:35 -0600
committerTom Tromey <tromey@redhat.com>2014-08-04 08:07:53 -0600
commit3cecbbbef197fdcdc833155ba4c3f3233a10e5c7 (patch)
tree305ed830bb69dea23e2e331539d3e906793c1fa4
parent00b51ff5835770104952dca3f9addb8f1025a24b (diff)
downloadgdb-3cecbbbef197fdcdc833155ba4c3f3233a10e5c7.zip
gdb-3cecbbbef197fdcdc833155ba4c3f3233a10e5c7.tar.gz
gdb-3cecbbbef197fdcdc833155ba4c3f3233a10e5c7.tar.bz2
make "set debug target" take effect immediately
Right now, "set debug target" acts a bit strangely. Most target APIs only notice that it has changed when the target stack is changed in some way. This is because many methods implement the setting using the special debug target. However, a few spots do change their behavior immediately -- any place explicitly checking "targetdebug". Some of this peculiar behavior is documented. However, I think that it just isn't very useful for it to work this way. So, this patch changes "set debug target" to take effect immediately in all cases. This is done by simply calling update_current_target when the setting is changed. This required one small change in the test suite. Here a test was expecting the current behavior. Built and regtested on x86-64 Fedora 20. 2014-08-04 Tom Tromey <tromey@redhat.com> * target.c (set_targetdebug): New function. (initialize_targets): Pass set_targetdebug when creating "set debug target". 2014-08-04 Tom Tromey <tromey@redhat.com> * gdb.texinfo (Debugging Output): Update for change to "set debug target". 2014-08-04 Tom Tromey <tromey@redhat.com> * gdb.base/sss-bp-on-user-bp-2.exp: Expect output from "set debug target 0".
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/doc/ChangeLog5
-rw-r--r--gdb/doc/gdb.texinfo3
-rw-r--r--gdb/target.c14
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp2
6 files changed, 29 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index af340f8..5201626 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2014-08-04 Tom Tromey <tromey@redhat.com>
+
+ * target.c (set_targetdebug): New function.
+ (initialize_targets): Pass set_targetdebug when creating "set
+ debug target".
+
2014-08-01 Joel Brobecker <brobecker@adacore.com>
* gdbtypes.c (resolve_dynamic_struct): Do not generate an error
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 20ce293..2bf94bc 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,8 @@
+2014-08-04 Tom Tromey <tromey@redhat.com>
+
+ * gdb.texinfo (Debugging Output): Update for change to "set debug
+ target".
+
2014-08-01 Masaki Muranaka <monaka@monami-software.com>
Pushed by Joel Brobecker <brobecker@adacore.com>.
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 32f709a..8d9148c 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -22996,8 +22996,7 @@ Show the current state of symbol table creation debugging.
Turns on or off display of @value{GDBN} target debugging info. This info
includes what is going on at the target level of GDB, as it happens. The
default is 0. Set it to 1 to track events, and to 2 to also track the
-value of large memory transfers. Changes to this flag do not take effect
-until the next time you connect to a target or use the @code{run} command.
+value of large memory transfers.
@item show debug target
Displays the current state of displaying @value{GDBN} target debugging
info.
diff --git a/gdb/target.c b/gdb/target.c
index f5c9ba3..9b907fa 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -118,6 +118,8 @@ static struct target_ops debug_target;
static void init_dummy_target (void);
+static void update_current_target (void);
+
/* Pointer to array of target architecture structures; the size of the
array; the current index into the array; the allocated size of the
array. */
@@ -173,6 +175,13 @@ int may_stop = 1;
/* Non-zero if we want to see trace of target level stuff. */
static unsigned int targetdebug = 0;
+
+static void
+set_targetdebug (char *args, int from_tty, struct cmd_list_element *c)
+{
+ update_current_target ();
+}
+
static void
show_targetdebug (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
@@ -3565,9 +3574,8 @@ initialize_targets (void)
Set target debugging."), _("\
Show target debugging."), _("\
When non-zero, target debugging is enabled. Higher numbers are more\n\
-verbose. Changes do not take effect until the next \"run\" or \"target\"\n\
-command."),
- NULL,
+verbose."),
+ set_targetdebug,
show_targetdebug,
&setdebuglist, &showdebuglist);
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 1ff7249..0bda4d0 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2014-08-04 Tom Tromey <tromey@redhat.com>
+ * gdb.base/sss-bp-on-user-bp-2.exp: Expect output from "set debug
+ target 0".
+
+2014-08-04 Tom Tromey <tromey@redhat.com>
+
* gdb.base/sss-bp-on-user-bp-2.exp: Match "to_resume", not
"target_resume".
diff --git a/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp b/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp
index cb95da0..9e86bea 100644
--- a/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp
+++ b/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp
@@ -76,7 +76,7 @@ if { $hardware_step } {
return
}
-gdb_test_no_output "set debug target 0"
+gdb_test "set debug target 0" "->to_log_command.*\\)"
set line_re "\[^\r\n\]*"