]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2013-04-24 Hui Zhu <hui@codesourcery.com>
authorHui Zhu <teawater@gmail.com>
Wed, 24 Apr 2013 06:20:29 +0000 (06:20 +0000)
committerHui Zhu <teawater@gmail.com>
Wed, 24 Apr 2013 06:20:29 +0000 (06:20 +0000)
PR gdb/15165

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

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

PR gdb/15165

* gdb.base/save-bp.exp: Add test for dprintf.

gdb/ChangeLog
gdb/breakpoint.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/save-bp.exp

index 7f59706e859e18e0c93505944e69af0bb0a3d8d2..c35799b124d5242c13b47a6058268ba867694163 100644 (file)
@@ -1,3 +1,11 @@
+2013-04-24  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.
+
 gdb/
 2013-04-19  Vladimir Kargov <kargov@gmail.com>
            Pedro Alves  <palves@redhat.com>
index 9da20a1202de7f68c080d913bb2a3f149200c2e2..4bcfea794ddefa526e77820f40811238c88f9739 100644 (file)
@@ -13544,6 +13544,16 @@ dprintf_re_set (struct breakpoint *b)
     update_dprintf_command_list (b);
 }
 
+/* Implement the "print_recreate" breakpoint_ops method for dprintf.  */
+
+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').  */
 
@@ -15633,7 +15643,7 @@ save_breakpoints (char *filename, int from_tty,
     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;       
 
@@ -16047,7 +16057,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.  */
index a183dd7a42aba6981c18a75cba34d8de0316a0f0..1af13e803b9cd8b6e6c5fd8a917cc4d206154d85 100644 (file)
@@ -1,3 +1,9 @@
+2013-04-24  Hui Zhu  <hui@codesourcery.com>
+
+       PR gdb/15165
+
+       * gdb.base/save-bp.exp: Add test for dprintf.
+
 2013-04-19  Vladimir Kargov  <kargov@gmail.com>
            Pedro Alves  <palves@redhat.com>
 
index fa3c5dd172bbc1e3cd46b6d534088135c128a89b..72a6847a4ef020568b643bdb7aa76cf9b994b8f5 100644 (file)
@@ -46,6 +46,8 @@ set loc_bp5 [gdb_get_line_number "with commands"]
 gdb_breakpoint ${srcfile}:${loc_bp5}
 gdb_test "commands\nsilent\nend" "End with.*" "add breakpoint commands"
 
+gdb_test "dprintf ${srcfile}:${loc_bp5},\"At foo entry\\n\"" "Dprintf .*"
+
 # Now, save the breakpoints into a file...
 remote_file host delete "bps"
 gdb_test "save breakpoint bps"
@@ -65,5 +67,6 @@ gdb_test "source bps"
 
 # Now, verify that all breakpoints have been created correctly...
 set bp_row_start "\[0-9\]+ +breakpoint +keep +y +0x\[0-9a-f\]+ +in"
+set dprintf_row_start "\[0-9\]+ +dprintf +keep +y +0x\[0-9a-f\]+ +in"
 gdb_test "info break" \
-  " *Num +Type +Disp +Enb +Address +What\r\n$bp_row_start break_me at .*$srcfile:\[0-9\]+\r\n$bp_row_start main at .*$srcfile:$loc_bp2\r\n$bp_row_start main at .*$srcfile:$loc_bp3 +thread 1\r\n\[ \t]+stop only in thread 1\r\n$bp_row_start main at .*$srcfile:$loc_bp4\r\n\[ \t\]+stop only if i == 1( \\((host|target) evals\\))?\r\n$bp_row_start main at .*$srcfile:$loc_bp5\r\n\[ \t\]+silent"
+  " *Num +Type +Disp +Enb +Address +What\r\n$bp_row_start break_me at .*$srcfile:\[0-9\]+\r\n$bp_row_start main at .*$srcfile:$loc_bp2\r\n$bp_row_start main at .*$srcfile:$loc_bp3 +thread 1\r\n\[ \t]+stop only in thread 1\r\n$bp_row_start main at .*$srcfile:$loc_bp4\r\n\[ \t\]+stop only if i == 1( \\((host|target) evals\\))?\r\n$bp_row_start main at .*$srcfile:$loc_bp5\r\n\[ \t\]+silent\r\n$dprintf_row_start main at .*$srcfile:$loc_bp5\r\n\[ \t\]+printf.*"