Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] make "set debug target" take effect immediately
Date: Mon, 28 Jul 2014 20:51:00 -0000	[thread overview]
Message-ID: <87sillfd1q.fsf@fleche.redhat.com> (raw)
In-Reply-To: <837g2xgulk.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 28 Jul	2014 22:18:47 +0300")

Eli> The 2nd sentence of the doc string says something that you deleted
Eli> from the manual.  Shouldn't it be deleted from here as well?

Yeah, overlooked that one.

Tom

b/gdb/ChangeLog:
2014-07-28  Tom Tromey  <tromey@redhat.com>

	* target.c (set_targetdebug): New function.
	(initialize_targets): Pass set_targetdebug when creating "set
	debug target".

b/gdb/doc/ChangeLog:
2014-07-28  Tom Tromey  <tromey@redhat.com>

	* gdb.texinfo (Debugging Output): Update for change to "set debug
	target".

b/gdb/testsuite/ChangeLog:
2014-07-28  Tom Tromey  <tromey@redhat.com>

	* gdb.base/sss-bp-on-user-bp-2.exp: Expect output from "set debug
	target 0".

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 d9b471b..2a3baa4 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -120,6 +120,8 @@ static void init_dummy_target (void);
 
 static void debug_to_open (char *, int);
 
+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.  */
@@ -175,6 +177,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)
@@ -3554,9 +3563,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/gdb.base/sss-bp-on-user-bp-2.exp b/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp
index a196f68..dd793bd 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\]*"
 


  parent reply	other threads:[~2014-07-28 20:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-28 19:18 Tom Tromey
2014-07-28 19:21 ` Eli Zaretskii
2014-07-28 19:34   ` Eli Zaretskii
2014-07-28 20:51   ` Tom Tromey [this message]
2014-08-04 14:09     ` Tom Tromey
2014-07-29 10:07 ` Yao Qi
2014-07-29 10:27   ` Pedro Alves
2014-07-29 20:05   ` Tom Tromey
2014-07-30  7:48     ` Yao Qi
2014-07-30 13:49       ` Tom Tromey
2014-08-04 14:09         ` Tom Tromey
2014-07-29 11:05 ` Pedro Alves

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=87sillfd1q.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=eliz@gnu.org \
    --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