LOG_DEBUG("-");
for (int bp_index = 0; breakpoints_p < breakpoints_e; ++breakpoints_p, ++bp_index)
- if (*breakpoints_p == NULL)
+ if (!*breakpoints_p)
return bp_index;
return -1;
LOG_DEBUG("-");
- while (breakpoint != NULL) {
+ while (breakpoint) {
if (breakpoint->set == 0)
esirisc_add_breakpoint(target, breakpoint);
LOG_DEBUG("-");
for (int wp_index = 0; watchpoints_p < watchpoints_e; ++watchpoints_p, ++wp_index)
- if (*watchpoints_p == NULL)
+ if (!*watchpoints_p)
return wp_index;
return -1;
LOG_DEBUG("-");
- while (watchpoint != NULL) {
+ while (watchpoint) {
if (watchpoint->set == 0)
esirisc_add_watchpoint(target, watchpoint);
if (handle_breakpoints) {
breakpoint = breakpoint_find(target, address);
- if (breakpoint != NULL)
+ if (breakpoint)
esirisc_remove_breakpoint(target, breakpoint);
}
case EID_INST_BREAKPOINT:
breakpoint = breakpoint_find(target,
buf_get_u32(esirisc->epc->value, 0, esirisc->epc->size));
- target->debug_reason = (breakpoint != NULL) ?
+ target->debug_reason = (breakpoint) ?
DBG_REASON_BREAKPOINT : DBG_REASON_DBGRQ;
break;
* requires additional configuration to properly interact with these
* targets in GDB (also see: `esirisc cache_arch`).
*/
- if (esirisc->gdb_arch == NULL && target_was_examined(target))
+ if (!esirisc->gdb_arch && target_was_examined(target))
esirisc->gdb_arch = alloc_printf("esirisc:%d_bit_%d_reg_%s",
esirisc->num_bits, esirisc->num_regs, esirisc_cache_arch_name(esirisc));
*reg_list_size = ESIRISC_NUM_REGS;
*reg_list = calloc(*reg_list_size, sizeof(struct reg *));
- if (*reg_list == NULL)
+ if (!*reg_list)
return ERROR_FAIL;
if (reg_class == REG_CLASS_ALL)
struct jtag_tap *tap = target->tap;
struct esirisc_common *esirisc;
- if (tap == NULL)
+ if (!tap)
return ERROR_FAIL;
if (tap->ir_length != INSTR_LENGTH) {
}
esirisc = calloc(1, sizeof(struct esirisc_common));
- if (esirisc == NULL)
+ if (!esirisc)
return ERROR_FAIL;
esirisc->target = target;