This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix dprintf work not right if it is pending
- From: Keith Seitz <keiths at redhat dot com>
- To: Hui Zhu <teawater at gmail dot com>
- Cc: Hui Zhu <hui_zhu at mentor dot com>, gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Thu, 28 Mar 2013 05:29:01 -0700
- Subject: Re: [PATCH] Fix dprintf work not right if it is pending
- References: <514BF736 dot 3070706 at mentor dot com> <514C3C85 dot 4000704 at codesourcery dot com> <514EEBFF dot 8090705 at redhat dot com> <CANFwon3D77yDiB_bQ0iZeg=KpkwoGiKnu=_7+kfcVV547M_cfg at mail dot gmail dot com>
On 03/25/2013 11:41 PM, Hui Zhu wrote:
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -12963,6 +12963,15 @@ bkpt_re_set (struct breakpoint *b)
breakpoint_re_set_default (b);
}
+static void
+dprintf_re_set (struct breakpoint *b)
+{
This function needs a comment, even if it just mentions that this
function is the re_set method for dprintf breakpoints.
+ breakpoint_re_set_default (b);
+
+ if (b->extra_string != NULL)
+ update_dprintf_command_list (b);
+}
+
This will update the command list every time breakpoints are reset and
could be limited to only those needing updating. Is there perhaps a
reason to always do this?
--- /dev/null
+++ b/gdb/testsuite/gdb.base/dprintf-pending.c
@@ -0,0 +1,31 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2004-2013 Free Software Foundation, Inc.
^^^^^^^^^
I think you meant only 2013. :-)
--- /dev/null
+++ b/gdb/testsuite/gdb.base/dprintf-pending.exp
+
+if [get_compiler_info] {
+ return -1
+}
Can you please add braces around the expression here? [Yeah, that's a
nit, but it is one of my Tcl pet peeves, and this is a new file. Time to
stomp out the old crud.]
Keith