break_insn = NDS32_BREAK_32;
}
- if (breakpoint->orig_instr != NULL)
- free(breakpoint->orig_instr);
+ free(breakpoint->orig_instr);
breakpoint->orig_instr = malloc(breakpoint->length);
memcpy(breakpoint->orig_instr, &data, breakpoint->length);
/* (address + length - 1) / dcache_line_size */
end_line = (address + length - 1) >> (dcache->line_size + 2);
- for (cur_address = address, cur_line = start_line ;
- cur_line <= end_line ;
+ for (cur_address = address, cur_line = start_line;
+ cur_line <= end_line;
cur_address += dcache_line_size, cur_line++) {
/* D$ write back */
result = aice_cache_ctl(aice, AICE_CACHE_CTL_L1D_VA_WB, cur_address);
/* (address + length - 1) / icache_line_size */
end_line = (address + length - 1) >> (icache->line_size + 2);
- for (cur_address = address, cur_line = start_line ;
- cur_line <= end_line ;
+ for (cur_address = address, cur_line = start_line;
+ cur_line <= end_line;
cur_address += icache_line_size, cur_line++) {
/* Because PSW.IT is turned off under debug exception, address MUST
* be physical address. L1I_VA_INVALIDATE uses PSW.IT to decide
LOG_DEBUG("hit syscall ID: 0x%" PRIx32, syscall_id);
/* free previous identifier storage */
- if (NULL != fileio_info->identifier) {
- free(fileio_info->identifier);
- fileio_info->identifier = NULL;
- }
+ free(fileio_info->identifier);
+ fileio_info->identifier = NULL;
uint32_t reg_r0, reg_r1, reg_r2;
nds32_get_mapped_reg(nds32, R0, ®_r0);
struct aice_port_s *aice = target_to_aice(target);
struct nds32 *nds32 = target_to_nds32(target);
+ /* REVISIT: can nds32 profile without halting? */
+ if (target->state != TARGET_HALTED) {
+ LOG_WARNING("target %s is not halted (profiling)", target->cmd_name);
+ return ERROR_TARGET_NOT_HALTED;
+ }
+
if (max_num_samples < iteration)
iteration = max_num_samples;