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: Pedro Alves <palves at redhat dot com>
- Cc: Hui Zhu <teawater at gmail dot com>, Hui Zhu <hui_zhu at mentor dot com>, gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Sat, 06 Apr 2013 14:45:23 -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> <5154378D dot 60302 at redhat dot com> <CANFwon3OdcsC3PQRwteYPKiBYFFKGPcOfMVcc4Fx8XdjZ=-pQw at mail dot gmail dot com> <515B1DF7 dot 3090705 at redhat dot com> <515EF6A3 dot 2080704 at redhat dot com>
On 04/05/2013 09:06 AM, Pedro Alves wrote:
Thanks for the help Keith. Much appreciated.
I'm not exactly sure I would call this "helping." I think I created more
work than I actually saved. My apologies for that. That certainly wasn't
my intent.
I think we want this:
static void
dprintf_re_set (struct breakpoint *b)
{
breakpoint_re_set_default (b);
/* This breakpoint could have been pending, and be resolved now, and
if so, we should now have the extra string. If we don't, the
dprintf was malformed when created, but we couldn't tell because
we can't extract the extra string until the location is
resolved. */
if (b->loc != NULL && b->extra_string == NULL)
error (_("Format string required"));
if (b->extra_string != NULL)
update_dprintf_command_list (b);
}
Yeah, that's good. Me likey. That was more like what I have in my sandbox.
You mean, only update the command list if there isn't one before
(because the breakpoint was pending before) ?
Yeah, I did mean that. Thank you to both you and Hui for clarifying why
this is necessary.
Thank you for your review of my review, too!
Keith