This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] fix 15184 Cannot change dprintf style to agent for existing dprintfs
- From: Pedro Alves <palves at redhat dot com>
- To: Hui Zhu <teawater at gmail dot com>
- Cc: gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Wed, 26 Jun 2013 16:27:51 +0100
- Subject: Re: [PATCH] fix 15184 Cannot change dprintf style to agent for existing dprintfs
- References: <CANFwon2QATsoKg7bBpjOHPyutnjiq-AvnnCJJC8VW_zPMt64uw at mail dot gmail dot com>
On 04/19/2013 03:40 PM, Hui Zhu wrote:
> Hi,
>
> This bug is because build_target_command_list didn't reset
> bl->target_info.tcommands because bl->needs_update is 0 after change
> dprintf style.
> So Update needs_update in update_dprintf_command_list.
>
> Also I update test for it.
>
> Please help me review it.
>
> Thanks,
> Hui
>
> 2013-04-19 Hui Zhu <hui@codesourcery.com>
>
> PR gdb/15184
>
> * breakpoint.c (update_dprintf_command_list): Set needs_update.
>
> 2013-04-19 Hui Zhu <hui@codesourcery.com>
>
> PR gdb/15184
>
> * gdb.base/dprintf.exp: Add test for agent update.
>
>
> dprintf-update.txt
>
>
> --- a/gdb/breakpoint.c
> +++ b/gdb/breakpoint.c
> @@ -8910,6 +8910,10 @@ update_dprintf_command_list (struct brea
> {
> char *dprintf_args = b->extra_string;
> char *printf_line = NULL;
> + struct bp_location *loc = b->loc;
> +
> + for (; loc; loc = loc->next)
> + loc->needs_update = 1;
>
Write as:
struct bp_location *loc;
for (loc = b->loc; loc != NULL; loc = loc->next)
loc->needs_update = 1;
I tried it out, and the test passes for me without the fix.
I had to manually rebase due to recent changes in dprintf.exp,
so perhaps I did something wrong. Could you send a fresh
version against current mainline, and be sure the test fails
without the fix?
Thanks,
--
Pedro Alves