Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hui Zhu <teawater@gmail.com>
To: gdb-patches ml <gdb-patches@sourceware.org>
Subject: [PATCH] Let dprintf can be saved
Date: Thu, 18 Apr 2013 17:04:00 -0000	[thread overview]
Message-ID: <CANFwon0p7x4X1qx=kqu-XRJ0XYfv8NDW4WxqST=w16VDUZTSzw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 585 bytes --]

Hi,

This patch fix http://sourceware.org/bugzilla/show_bug.cgi?id=15165

But I didn't use commands because it is not current way to setup
commands of dprintf.

So I add a check in save_breakpoints to let it not save dprintf
commands..  If you think we need, I can put commands save code as a
special function to handle it.

Please help me review it.

Thanks,
Hui

2013-04-18  Hui Zhu  <hui@codesourcery.com>

	PR gdb/15165

	* breakpoint.c (dprintf_print_recreate): New.
	(save_breakpoints): Let it not save dprintf commands.
	(initialize_breakpoint_ops): Set dprintf_print_recreate.

[-- Attachment #2: dprintf-save.txt --]
[-- Type: text/plain, Size: 1104 bytes --]

--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -13364,6 +13364,14 @@ dprintf_re_set (struct breakpoint *b)
     update_dprintf_command_list (b);
 }
 
+static void
+dprintf_print_recreate (struct breakpoint *tp, struct ui_file *fp)
+{
+  fprintf_unfiltered (fp, "dprintf %s%s", tp->addr_string,
+		      tp->extra_string);
+  print_recreate_thread (tp, fp);
+}
+
 /* The breakpoint_ops structure to be used on static tracepoints with
    markers (`-m').  */
 
@@ -15453,7 +15461,7 @@ save_breakpoints (char *filename, int fr
     if (tp->ignore_count)
       fprintf_unfiltered (fp, "  ignore $bpnum %d\n", tp->ignore_count);
 
-    if (tp->commands)
+    if (tp->type != bp_dprintf && tp->commands)
       {
 	volatile struct gdb_exception ex;	
 
@@ -15859,7 +15867,7 @@ initialize_breakpoint_ops (void)
   ops->resources_needed = bkpt_resources_needed;
   ops->print_it = bkpt_print_it;
   ops->print_mention = bkpt_print_mention;
-  ops->print_recreate = bkpt_print_recreate;
+  ops->print_recreate = dprintf_print_recreate;
 }
 
 /* Chain containing all defined "enable breakpoint" subcommands.  */

             reply	other threads:[~2013-04-18  5:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-18 17:04 Hui Zhu [this message]
2013-04-19 18:33 ` Tom Tromey
2013-04-19 18:36   ` Keith Seitz
2013-04-22  0:19   ` Hui Zhu
2013-04-22  0:24     ` Hui Zhu
2013-04-22 23:26       ` Tom Tromey
2013-04-23 16:53         ` Hui Zhu
2013-04-24 14:34           ` Joel Brobecker
2013-04-24 14:35             ` Hui Zhu
2013-04-22 23:47     ` Tom Tromey

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='CANFwon0p7x4X1qx=kqu-XRJ0XYfv8NDW4WxqST=w16VDUZTSzw@mail.gmail.com' \
    --to=teawater@gmail.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