+ char* buf = buf_to_str(breakpoint->orig_instr,
+ breakpoint->length, 16);
+ command_print(cmd_ctx, "IVA breakpoint: 0x%8.8" PRIx32 ", 0x%x, %i, 0x%s",
+ breakpoint->address,
+ breakpoint->length,
+ breakpoint->set, buf);
+ free(buf);
+ }
+ else
+ {
+ if ((breakpoint->address == 0) && (breakpoint->asid != 0))
+ command_print(cmd_ctx, "Context breakpoint: 0x%8.8" PRIx32 ", 0x%x, %i",
+ breakpoint->asid,
+ breakpoint->length, breakpoint->set);
+ else if ((breakpoint->address != 0) && (breakpoint->asid != 0))
+ {
+ command_print(cmd_ctx, "Hybrid breakpoint(IVA): 0x%8.8" PRIx32 ", 0x%x, %i",
+ breakpoint->address,
+ breakpoint->length, breakpoint->set);
+ command_print(cmd_ctx, "\t|--->linked with ContextID: 0x%8.8" PRIx32,
+ breakpoint->asid);
+ }
+ else
+ command_print(cmd_ctx, "Breakpoint(IVA): 0x%8.8" PRIx32 ", 0x%x, %i",
+ breakpoint->address,
+ breakpoint->length, breakpoint->set);
+ }
+
+ breakpoint = breakpoint->next;
+ }
+ return ERROR_OK;
+}
+
+static int handle_bp_command_set(struct command_context *cmd_ctx,
+ uint32_t addr, uint32_t asid, uint32_t length, int hw)
+{
+ struct target *target = get_current_target(cmd_ctx);
+
+ if (asid == 0)
+ {
+ int retval = breakpoint_add(target, addr, length, hw);
+ if (ERROR_OK == retval)
+ command_print(cmd_ctx, "breakpoint set at 0x%8.8" PRIx32 "", addr);
+ else
+ {
+ LOG_ERROR("Failure setting breakpoint, the same address(IVA) is already used");
+ return retval;
+ }
+ }
+ else if (addr == 0)
+ {
+ int retval = context_breakpoint_add(target, asid, length, hw);
+ if (ERROR_OK == retval)
+ command_print(cmd_ctx, "Context breakpoint set at 0x%8.8" PRIx32 "", asid);
+ else
+ {
+ LOG_ERROR("Failure setting breakpoint, the same address(CONTEXTID) is already used");
+ return retval;