--- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -4929,6 +4929,15 @@ linux_supports_range_stepping (void) return (*the_low_target.supports_range_stepping) (); } +static int +linux_supports_insert_point (void) +{ + if (the_low_target.insert_point != NULL) + return 1; + + return 0; +} + /* Enumerate spufs IDs for process PID. */ static int spu_enumerate_spu_ids (long pid, unsigned char *buf, CORE_ADDR offset, int len) @@ -5825,6 +5834,7 @@ static struct target_ops linux_target_op NULL, #endif linux_supports_range_stepping, + linux_supports_insert_point, }; static void --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -1806,9 +1806,16 @@ handle_query (char *own_buf, int packet_ strcat (own_buf, ";tracenz+"); } - /* Support target-side breakpoint conditions and commands. */ - strcat (own_buf, ";ConditionalBreakpoints+"); - strcat (own_buf, ";BreakpointCommands+"); + /* GDB will send target-side breakpoint conditions and commands packets + with insert point packets. So if target doesn't support insert + point, it should not support target-side breakpoint conditions + and commands packets. */ + if (target_supports_insert_point ()) + { + /* Support target-side breakpoint conditions and commands. */ + strcat (own_buf, ";ConditionalBreakpoints+"); + strcat (own_buf, ";BreakpointCommands+"); + } if (target_supports_agent ()) strcat (own_buf, ";QAgent+"); --- a/gdb/gdbserver/target.h +++ b/gdb/gdbserver/target.h @@ -365,6 +365,9 @@ struct target_ops /* Return true if target supports range stepping. */ int (*supports_range_stepping) (void); + + /* Return true if target supports insert_point. */ + int (*supports_insert_point) (void); }; extern struct target_ops *the_target; @@ -504,6 +507,10 @@ int kill_inferior (int); (the_target->supports_range_stepping ? \ (*the_target->supports_range_stepping) () : 0) +#define target_supports_insert_point() \ + (the_target->supports_insert_point ? \ + (*the_target->supports_insert_point) () : 0) + /* Start non-stop mode, returns 0 on success, -1 on failure. */ int start_non_stop (int nonstop);