--- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -13465,7 +13465,12 @@ dprintf_after_condition_true (struct bps bs->commands = NULL; old_chain = make_cleanup_decref_counted_command_line (&tmp_bs.commands); - bpstat_do_actions_1 (&tmp_bs_p); + /* If dprintf-style is set to agent, the actions of dprintf has been + executed in agent. They should not be execued in GDB side. + So the actions should be executed only when dprintf-style is not + set to agent. */ + if (strcmp (dprintf_style, dprintf_style_agent) != 0) + bpstat_do_actions_1 (&tmp_bs_p); /* 'tmp_bs.commands' will usually be NULL by now, but bpstat_do_actions_1 may return early without processing the whole