Remove misleading typedef and redundant suffix from struct breakpoint.
{
/* check if one matches PC and step over it if necessary */
- breakpoint_t * bp;
+ struct breakpoint * bp;
for (bp = target->breakpoints; bp; bp = bp->next)
{
* rw: 0 = write, 1 = read, 2 = access
*/
static int arm11_add_breakpoint(struct target_s *target,
- breakpoint_t *breakpoint)
+ struct breakpoint *breakpoint)
{
FNC_INFO;
}
static int arm11_remove_breakpoint(struct target_s *target,
- breakpoint_t *breakpoint)
+ struct breakpoint *breakpoint)
{
FNC_INFO;
* @param arm7_9 Pointer to the common struct for an ARM7/9 target
* @param breakpoint Pointer to the breakpoint to be used as a watchpoint
*/
-static void arm7_9_assign_wp(struct arm7_9_common *arm7_9, breakpoint_t *breakpoint)
+static void arm7_9_assign_wp(struct arm7_9_common *arm7_9, struct breakpoint *breakpoint)
{
if (!arm7_9->wp0_used)
{
* queue. For software breakpoints, this will be the status of the
* required memory reads and writes
*/
-int arm7_9_set_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
+int arm7_9_set_breakpoint(struct target_s *target, struct breakpoint *breakpoint)
{
struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
int retval = ERROR_OK;
* queue. For software breakpoints, this will be the status of the
* required memory reads and writes
*/
-int arm7_9_unset_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
+int arm7_9_unset_breakpoint(struct target_s *target, struct breakpoint *breakpoint)
{
int retval = ERROR_OK;
struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
* @return An error status if there is a problem adding the breakpoint or the
* result of setting the breakpoint
*/
-int arm7_9_add_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
+int arm7_9_add_breakpoint(struct target_s *target, struct breakpoint *breakpoint)
{
struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
* @return Error status if there was a problem unsetting the breakpoint or the
* watchpoints could not be cleared
*/
-int arm7_9_remove_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
+int arm7_9_remove_breakpoint(struct target_s *target, struct breakpoint *breakpoint)
{
int retval = ERROR_OK;
struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
*/
void arm7_9_enable_breakpoints(struct target_s *target)
{
- breakpoint_t *breakpoint = target->breakpoints;
+ struct breakpoint *breakpoint = target->breakpoints;
/* set any pending breakpoints */
while (breakpoint)
{
struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
struct armv4_5_common_s *armv4_5 = &arm7_9->armv4_5_common;
- breakpoint_t *breakpoint = target->breakpoints;
+ struct breakpoint *breakpoint = target->breakpoints;
reg_t *dbg_ctrl = &arm7_9->eice_cache->reg_list[EICE_DBG_CTRL];
int err, retval = ERROR_OK;
{
struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
struct armv4_5_common_s *armv4_5 = &arm7_9->armv4_5_common;
- breakpoint_t *breakpoint = NULL;
+ struct breakpoint *breakpoint = NULL;
int err, retval;
if (target->state != TARGET_HALTED)
int arm7_9_run_algorithm(struct target_s *target, int num_mem_params, struct mem_param *mem_params, int num_reg_prams, struct reg_param *reg_param, uint32_t entry_point, void *arch_info);
-int arm7_9_add_breakpoint(struct target_s *target, breakpoint_t *breakpoint);
-int arm7_9_remove_breakpoint(struct target_s *target, breakpoint_t *breakpoint);
+int arm7_9_add_breakpoint(struct target_s *target, struct breakpoint *breakpoint);
+int arm7_9_remove_breakpoint(struct target_s *target, struct breakpoint *breakpoint);
int arm7_9_add_watchpoint(struct target_s *target, struct watchpoint *watchpoint);
int arm7_9_remove_watchpoint(struct target_s *target, struct watchpoint *watchpoint);
int breakpoint_add(target_t *target, uint32_t address, uint32_t length, enum breakpoint_type type)
{
- breakpoint_t *breakpoint = target->breakpoints;
- breakpoint_t **breakpoint_p = &target->breakpoints;
+ struct breakpoint *breakpoint = target->breakpoints;
+ struct breakpoint **breakpoint_p = &target->breakpoints;
int retval;
int n;
breakpoint = breakpoint->next;
}
- (*breakpoint_p) = malloc(sizeof(breakpoint_t));
+ (*breakpoint_p) = malloc(sizeof(struct breakpoint));
(*breakpoint_p)->address = address;
(*breakpoint_p)->length = length;
(*breakpoint_p)->type = type;
}
/* free up a breakpoint */
-static void breakpoint_free(target_t *target, breakpoint_t *breakpoint_remove)
+static void breakpoint_free(target_t *target, struct breakpoint *breakpoint_remove)
{
- breakpoint_t *breakpoint = target->breakpoints;
- breakpoint_t **breakpoint_p = &target->breakpoints;
+ struct breakpoint *breakpoint = target->breakpoints;
+ struct breakpoint **breakpoint_p = &target->breakpoints;
while (breakpoint)
{
void breakpoint_remove(target_t *target, uint32_t address)
{
- breakpoint_t *breakpoint = target->breakpoints;
- breakpoint_t **breakpoint_p = &target->breakpoints;
+ struct breakpoint *breakpoint = target->breakpoints;
+ struct breakpoint **breakpoint_p = &target->breakpoints;
while (breakpoint)
{
void breakpoint_clear_target(target_t *target)
{
- breakpoint_t *breakpoint;
+ struct breakpoint *breakpoint;
LOG_DEBUG("Delete all breakpoints for target: %s", target_get_name( target ));
while ((breakpoint = target->breakpoints) != NULL)
{
}
}
-breakpoint_t* breakpoint_find(target_t *target, uint32_t address)
+struct breakpoint* breakpoint_find(target_t *target, uint32_t address)
{
- breakpoint_t *breakpoint = target->breakpoints;
+ struct breakpoint *breakpoint = target->breakpoints;
while (breakpoint)
{
WPT_READ = 0, WPT_WRITE = 1, WPT_ACCESS = 2
};
-typedef struct breakpoint_s
+struct breakpoint
{
uint32_t address;
int length;
enum breakpoint_type type;
int set;
uint8_t *orig_instr;
- struct breakpoint_s *next;
+ struct breakpoint *next;
int unique_id;
-} breakpoint_t;
+};
struct watchpoint
{
uint32_t address, uint32_t length, enum breakpoint_type type);
void breakpoint_remove(struct target_s *target, uint32_t address);
-breakpoint_t* breakpoint_find(struct target_s *target, uint32_t address);
+struct breakpoint* breakpoint_find(struct target_s *target, uint32_t address);
void watchpoint_clear_target(struct target_s *target);
int watchpoint_add(struct target_s *target,
static int cortex_a8_debug_entry(target_t *target);
static int cortex_a8_restore_context(target_t *target);
static int cortex_a8_set_breakpoint(struct target_s *target,
- breakpoint_t *breakpoint, uint8_t matchmode);
+ struct breakpoint *breakpoint, uint8_t matchmode);
static int cortex_a8_unset_breakpoint(struct target_s *target,
- breakpoint_t *breakpoint);
+ struct breakpoint *breakpoint);
static int cortex_a8_dap_read_coreregister_u32(target_t *target,
uint32_t *value, int regnum);
static int cortex_a8_dap_write_coreregister_u32(target_t *target,
struct armv4_5_common_s *armv4_5 = &armv7a->armv4_5_common;
struct swjdp_common *swjdp = &armv7a->swjdp_info;
-// breakpoint_t *breakpoint = NULL;
+// struct breakpoint *breakpoint = NULL;
uint32_t resume_pc, dscr;
uint8_t saved_apsel = dap_ap_get_select(swjdp);
{
struct armv7a_common *armv7a = target_to_armv7a(target);
struct armv4_5_common_s *armv4_5 = &armv7a->armv4_5_common;
- breakpoint_t *breakpoint = NULL;
- breakpoint_t stepbreakpoint;
+ struct breakpoint *breakpoint = NULL;
+ struct breakpoint stepbreakpoint;
int timeout = 100;
/* Setup hardware Breakpoint Register Pair */
static int cortex_a8_set_breakpoint(struct target_s *target,
- breakpoint_t *breakpoint, uint8_t matchmode)
+ struct breakpoint *breakpoint, uint8_t matchmode)
{
int retval;
int brp_i=0;
return ERROR_OK;
}
-static int cortex_a8_unset_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
+static int cortex_a8_unset_breakpoint(struct target_s *target, struct breakpoint *breakpoint)
{
int retval;
struct cortex_a8_common *cortex_a8 = target_to_cortex_a8(target);
return ERROR_OK;
}
-int cortex_a8_add_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
+int cortex_a8_add_breakpoint(struct target_s *target, struct breakpoint *breakpoint)
{
struct cortex_a8_common *cortex_a8 = target_to_cortex_a8(target);
return ERROR_OK;
}
-static int cortex_a8_remove_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
+static int cortex_a8_remove_breakpoint(struct target_s *target, struct breakpoint *breakpoint)
{
struct cortex_a8_common *cortex_a8 = target_to_cortex_a8(target);
/* forward declarations */
-static int cortex_m3_set_breakpoint(struct target_s *target, breakpoint_t *breakpoint);
-static int cortex_m3_unset_breakpoint(struct target_s *target, breakpoint_t *breakpoint);
+static int cortex_m3_set_breakpoint(struct target_s *target, struct breakpoint *breakpoint);
+static int cortex_m3_unset_breakpoint(struct target_s *target, struct breakpoint *breakpoint);
static void cortex_m3_enable_watchpoints(struct target_s *target);
static int cortex_m3_store_core_reg_u32(target_t *target,
enum armv7m_regtype type, uint32_t num, uint32_t value);
static void cortex_m3_enable_breakpoints(struct target_s *target)
{
- breakpoint_t *breakpoint = target->breakpoints;
+ struct breakpoint *breakpoint = target->breakpoints;
/* set any pending breakpoints */
while (breakpoint)
uint32_t address, int handle_breakpoints, int debug_execution)
{
struct armv7m_common *armv7m = target_to_armv7m(target);
- breakpoint_t *breakpoint = NULL;
+ struct breakpoint *breakpoint = NULL;
uint32_t resume_pc;
if (target->state != TARGET_HALTED)
struct cortex_m3_common *cortex_m3 = target_to_cm3(target);
struct armv7m_common *armv7m = &cortex_m3->armv7m;
struct swjdp_common *swjdp = &armv7m->swjdp_info;
- breakpoint_t *breakpoint = NULL;
+ struct breakpoint *breakpoint = NULL;
if (target->state != TARGET_HALTED)
{
}
static int
-cortex_m3_set_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
+cortex_m3_set_breakpoint(struct target_s *target, struct breakpoint *breakpoint)
{
int retval;
int fp_num = 0;
}
static int
-cortex_m3_unset_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
+cortex_m3_unset_breakpoint(struct target_s *target, struct breakpoint *breakpoint)
{
int retval;
struct cortex_m3_common *cortex_m3 = target_to_cm3(target);
}
static int
-cortex_m3_add_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
+cortex_m3_add_breakpoint(struct target_s *target, struct breakpoint *breakpoint)
{
struct cortex_m3_common *cortex_m3 = target_to_cm3(target);
}
static int
-cortex_m3_remove_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
+cortex_m3_remove_breakpoint(struct target_s *target, struct breakpoint *breakpoint)
{
struct cortex_m3_common *cortex_m3 = target_to_cm3(target);
{
struct mips32_common *mips32 = target->arch_info;
struct mips_ejtag *ejtag_info = &mips32->ejtag_info;
- breakpoint_t *breakpoint = NULL;
+ struct breakpoint *breakpoint = NULL;
uint32_t resume_pc;
if (target->state != TARGET_HALTED)
/* get pointers to arch-specific information */
struct mips32_common *mips32 = target->arch_info;
struct mips_ejtag *ejtag_info = &mips32->ejtag_info;
- breakpoint_t *breakpoint = NULL;
+ struct breakpoint *breakpoint = NULL;
if (target->state != TARGET_HALTED)
{
void mips_m4k_enable_breakpoints(struct target_s *target)
{
- breakpoint_t *breakpoint = target->breakpoints;
+ struct breakpoint *breakpoint = target->breakpoints;
/* set any pending breakpoints */
while (breakpoint)
}
}
-int mips_m4k_set_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
+int mips_m4k_set_breakpoint(struct target_s *target, struct breakpoint *breakpoint)
{
struct mips32_common *mips32 = target->arch_info;
struct mips32_comparator * comparator_list = mips32->inst_break_list;
return ERROR_OK;
}
-int mips_m4k_unset_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
+int mips_m4k_unset_breakpoint(struct target_s *target, struct breakpoint *breakpoint)
{
/* get pointers to arch-specific information */
struct mips32_common *mips32 = target->arch_info;
return ERROR_OK;
}
-int mips_m4k_add_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
+int mips_m4k_add_breakpoint(struct target_s *target, struct breakpoint *breakpoint)
{
struct mips32_common *mips32 = target->arch_info;
return ERROR_OK;
}
-int mips_m4k_remove_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
+int mips_m4k_remove_breakpoint(struct target_s *target, struct breakpoint *breakpoint)
{
/* get pointers to arch-specific information */
struct mips32_common *mips32 = target->arch_info;
uint32_t address, uint32_t count, uint8_t *buffer);
void mips_m4k_enable_breakpoints(struct target_s *target);
-int mips_m4k_set_breakpoint(struct target_s *target, breakpoint_t *bp);
-int mips_m4k_unset_breakpoint(struct target_s *target, breakpoint_t *bp);
-int mips_m4k_add_breakpoint(struct target_s *target, breakpoint_t *bp);
-int mips_m4k_remove_breakpoint(struct target_s *target, breakpoint_t *bp);
+int mips_m4k_set_breakpoint(struct target_s *target, struct breakpoint *bp);
+int mips_m4k_unset_breakpoint(struct target_s *target, struct breakpoint *bp);
+int mips_m4k_add_breakpoint(struct target_s *target, struct breakpoint *bp);
+int mips_m4k_remove_breakpoint(struct target_s *target, struct breakpoint *bp);
void mips_m4k_enable_watchpoints(struct target_s *target);
int mips_m4k_set_watchpoint(struct target_s *target, struct watchpoint *wp);
}
int target_add_breakpoint(struct target_s *target,
- struct breakpoint_s *breakpoint)
+ struct breakpoint *breakpoint)
{
return target->type->add_breakpoint(target, breakpoint);
}
int target_remove_breakpoint(struct target_s *target,
- struct breakpoint_s *breakpoint)
+ struct breakpoint *breakpoint)
{
return target->type->remove_breakpoint(target, breakpoint);
}
static int handle_bp_command_list(struct command_context_s *cmd_ctx)
{
target_t *target = get_current_target(cmd_ctx);
- breakpoint_t *breakpoint = target->breakpoints;
+ struct breakpoint *breakpoint = target->breakpoints;
while (breakpoint)
{
if (breakpoint->type == BKPT_SOFT)
// also see: target_state_name()
enum target_state state; /* the current backend-state (running, halted, ...) */
struct reg_cache *reg_cache; /* the first register cache of the target (core regs) */
- struct breakpoint_s *breakpoints; /* list of breakpoints */
+ struct breakpoint *breakpoints; /* list of breakpoints */
struct watchpoint *watchpoints; /* list of watchpoints */
struct trace_s *trace_info; /* generic trace information */
struct debug_msg_receiver *dbgmsg;/* list of debug message receivers */
* This routine is a wrapper for target->type->add_breakpoint.
*/
int target_add_breakpoint(struct target_s *target,
- struct breakpoint_s *breakpoint);
+ struct breakpoint *breakpoint);
/**
* Remove the @a breakpoint for @a target.
*
* This routine is a wrapper for target->type->remove_breakpoint.
*/
int target_remove_breakpoint(struct target_s *target,
- struct breakpoint_s *breakpoint);
+ struct breakpoint *breakpoint);
/**
* Add the @a watchpoint for @a target.
*
*
* Upon GDB connection all breakpoints/watchpoints are cleared.
*/
- int (*add_breakpoint)(struct target_s *target, breakpoint_t *breakpoint);
+ int (*add_breakpoint)(struct target_s *target, struct breakpoint *breakpoint);
/* remove breakpoint. hw will only be updated if the target is currently halted.
* However, this method can be invoked on unresponsive targets.
*/
- int (*remove_breakpoint)(struct target_s *target, breakpoint_t *breakpoint);
+ int (*remove_breakpoint)(struct target_s *target, struct breakpoint *breakpoint);
int (*add_watchpoint)(struct target_s *target, struct watchpoint *watchpoint);
/* remove watchpoint. hw will only be updated if the target is currently halted.
* However, this method can be invoked on unresponsive targets.
static int xscale_restore_context(target_t *);
static int xscale_get_reg(reg_t *reg);
static int xscale_set_reg(reg_t *reg, uint8_t *buf);
-static int xscale_set_breakpoint(struct target_s *, breakpoint_t *);
+static int xscale_set_breakpoint(struct target_s *, struct breakpoint *);
static int xscale_set_watchpoint(struct target_s *, struct watchpoint *);
-static int xscale_unset_breakpoint(struct target_s *, breakpoint_t *);
+static int xscale_unset_breakpoint(struct target_s *, struct breakpoint *);
static int xscale_read_trace(target_t *);
if (xscale->ibcr0_used)
{
- breakpoint_t *ibcr0_bp = breakpoint_find(target, buf_get_u32(ibcr0->value, 0, 32) & 0xfffffffe);
+ struct breakpoint *ibcr0_bp = breakpoint_find(target, buf_get_u32(ibcr0->value, 0, 32) & 0xfffffffe);
if (ibcr0_bp)
{
static void xscale_enable_breakpoints(struct target_s *target)
{
- breakpoint_t *breakpoint = target->breakpoints;
+ struct breakpoint *breakpoint = target->breakpoints;
/* set any pending breakpoints */
while (breakpoint)
{
struct xscale_common *xscale = target_to_xscale(target);
struct armv4_5_common_s *armv4_5 = &xscale->armv4_5_common;
- breakpoint_t *breakpoint = target->breakpoints;
+ struct breakpoint *breakpoint = target->breakpoints;
uint32_t current_pc;
int retval;
int i;
uint32_t address, int handle_breakpoints)
{
struct armv4_5_common_s *armv4_5 = target_to_armv4_5(target);
- breakpoint_t *breakpoint = target->breakpoints;
+ struct breakpoint *breakpoint = target->breakpoints;
uint32_t current_pc;
int retval;
static int xscale_deassert_reset(target_t *target)
{
struct xscale_common *xscale = target_to_xscale(target);
- breakpoint_t *breakpoint = target->breakpoints;
+ struct breakpoint *breakpoint = target->breakpoints;
LOG_DEBUG("-");
}
static int xscale_set_breakpoint(struct target_s *target,
- breakpoint_t *breakpoint)
+ struct breakpoint *breakpoint)
{
int retval;
struct xscale_common *xscale = target_to_xscale(target);
}
static int xscale_add_breakpoint(struct target_s *target,
- breakpoint_t *breakpoint)
+ struct breakpoint *breakpoint)
{
struct xscale_common *xscale = target_to_xscale(target);
}
static int xscale_unset_breakpoint(struct target_s *target,
- breakpoint_t *breakpoint)
+ struct breakpoint *breakpoint)
{
int retval;
struct xscale_common *xscale = target_to_xscale(target);
return ERROR_OK;
}
-static int xscale_remove_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
+static int xscale_remove_breakpoint(struct target_s *target, struct breakpoint *breakpoint)
{
struct xscale_common *xscale = target_to_xscale(target);