--- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -13389,6 +13389,19 @@ tracepoint_probe_decode_linespec (struct static struct breakpoint_ops tracepoint_probe_breakpoint_ops; +/* Implement the "breakpoint_hit" breakpoint_ops method for dprintf. */ + +static int +dprintf_breakpoint_hit (const struct bp_location *bl, + struct address_space *aspace, CORE_ADDR bp_addr, + const struct target_waitstatus *ws) +{ + if (strcmp (dprintf_style, dprintf_style_agent) != 0) + return bkpt_breakpoint_hit (bl, aspace, bp_addr, ws); + + return 0; +} + /* Dprintf breakpoint_ops methods. */ static void @@ -15957,6 +15970,7 @@ initialize_breakpoint_ops (void) ops = &dprintf_breakpoint_ops; *ops = bkpt_base_breakpoint_ops; + ops->breakpoint_hit = dprintf_breakpoint_hit; ops->re_set = dprintf_re_set; ops->resources_needed = bkpt_resources_needed; ops->print_it = bkpt_print_it;