aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/mem-break.h
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2016-07-21 12:12:17 +0100
committerYao Qi <yao.qi@linaro.org>2016-07-21 12:12:17 +0100
commit9aa76cd0a7b2cfdcc9da31e7763a695fac89f569 (patch)
tree3c3da4cc2d57c58b907fbf5c45369eebe709aea2 /gdb/gdbserver/mem-break.h
parent811f8301f8054eb964e92af63930c4495207e7d5 (diff)
downloadgdb-9aa76cd0a7b2cfdcc9da31e7763a695fac89f569.zip
gdb-9aa76cd0a7b2cfdcc9da31e7763a695fac89f569.tar.gz
gdb-9aa76cd0a7b2cfdcc9da31e7763a695fac89f569.tar.bz2
Create sub classes of 'struct breakpoint'
Nowadays, there are three types of breakpoint in GDBserver, - gdb breakpoints, - reinsert breakpoints, used for software single step, - other breakpoints, used for tracepoint, but we only have one 'struct breakpoint' for all of them. Some fields are only useful to one type of breakpoint. For example, cond_list and command_list are only used by gdb breakpoints, while handler is only used by other breakpoints. This patch changes 'struct breakpoint' to a base class, which has fields needed by all breakpoint types, also add three sub-classes to 'struct breakpoint' to these three types of breakpoints. gdb/gdbserver: 2016-07-21 Yao Qi <yao.qi@linaro.org> * mem-break.c (struct breakpoint) <cond_list>: Remove. <command_list, handler>: Remove. (struct gdb_breakpoint): New. (struct other_breakpoint): New. (struct reinsert_breakpoint): New. (is_gdb_breakpoint): New function. (any_persistent_commands): Update command_list if is_gdb_breakpoint returns true. (set_breakpoint): Create breakpoints according to their types. (find_gdb_breakpoint): Return 'struct gdb_breakpoint *'. (set_gdb_breakpoint_1): Likewise. (set_gdb_breakpoint): Likewise. (clear_breakpoint_conditions): Change parameter type to 'struct gdb_breakpoint *'. (clear_breakpoint_commands): Likewise. (clear_breakpoint_conditions_and_commands): Likewise. (add_condition_to_breakpoint): Likewise. (add_breakpoint_condition): Likewise. (add_commands_to_breakpoint): Likewise. (check_breakpoints): Check other_breakpoint. (clone_one_breakpoint): Clone breakpopint according to its type. * mem-break.h (struct gdb_breakpoint): Declare. (set_gdb_breakpoint): Update declaration. (clear_breakpoint_conditions_and_commands): Likewise. (add_breakpoint_condition): Likewise. (add_breakpoint_commands): Likewise. * server.c (process_point_options): Change parameter type to 'struct gdb_breakpoint *'.
Diffstat (limited to 'gdb/gdbserver/mem-break.h')
-rw-r--r--gdb/gdbserver/mem-break.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/gdb/gdbserver/mem-break.h b/gdb/gdbserver/mem-break.h
index dd5a750..321de12 100644
--- a/gdb/gdbserver/mem-break.h
+++ b/gdb/gdbserver/mem-break.h
@@ -25,6 +25,7 @@
/* Breakpoints are opaque. */
struct breakpoint;
+struct gdb_breakpoint;
struct fast_tracepoint_jump;
struct raw_breakpoint;
struct process_info;
@@ -70,8 +71,8 @@ enum target_hw_bp_type raw_bkpt_type_to_target_hw_bp_type
failure returns NULL and sets *ERR to either -1 for error, or 1 if
Z_TYPE breakpoints are not supported on this target. */
-struct breakpoint *set_gdb_breakpoint (char z_type, CORE_ADDR addr, int kind,
- int *err);
+struct gdb_breakpoint *set_gdb_breakpoint (char z_type, CORE_ADDR addr,
+ int kind, int *err);
/* Delete a GDB breakpoint of type Z_TYPE and kind KIND previously
inserted at ADDR with set_gdb_breakpoint_at. Returns 0 on success,
@@ -107,20 +108,20 @@ int reinsert_breakpoint_inserted_here (CORE_ADDR addr);
/* Clear all breakpoint conditions and commands associated with a
breakpoint. */
-void clear_breakpoint_conditions_and_commands (struct breakpoint *bp);
+void clear_breakpoint_conditions_and_commands (struct gdb_breakpoint *bp);
/* Set target-side condition CONDITION to the breakpoint at ADDR.
Returns false on failure. On success, advances CONDITION pointer
past the condition and returns true. */
-int add_breakpoint_condition (struct breakpoint *bp, char **condition);
+int add_breakpoint_condition (struct gdb_breakpoint *bp, char **condition);
/* Set target-side commands COMMANDS to the breakpoint at ADDR.
Returns false on failure. On success, advances COMMANDS past the
commands and returns true. If PERSIST, the commands should run
even while GDB is disconnected. */
-int add_breakpoint_commands (struct breakpoint *bp, char **commands,
+int add_breakpoint_commands (struct gdb_breakpoint *bp, char **commands,
int persist);
int any_persistent_commands (void);