mirror of https://github.com/mgba-emu/mgba.git
Debugger: Print breakpoint/watchpoint number when inserting
This commit is contained in:
parent
1d6d4a5377
commit
1deff07aa1
1
CHANGES
1
CHANGES
|
@ -45,6 +45,7 @@ Misc:
|
||||||
- Qt: Cap window size on start to monitor size
|
- Qt: Cap window size on start to monitor size
|
||||||
- GBA BIOS: Add timings for HLE BIOS math functions (fixes mgba.io/i/1396)
|
- GBA BIOS: Add timings for HLE BIOS math functions (fixes mgba.io/i/1396)
|
||||||
- Debugger: Make tracing compatible with breakpoints/watchpoints
|
- Debugger: Make tracing compatible with breakpoints/watchpoints
|
||||||
|
- Debugger: Print breakpoint/watchpoint number when inserting
|
||||||
|
|
||||||
0.7.1: (2019-02-24)
|
0.7.1: (2019-02-24)
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
|
|
@ -15,6 +15,8 @@ CXX_GUARD_START
|
||||||
extern const char* ERROR_MISSING_ARGS;
|
extern const char* ERROR_MISSING_ARGS;
|
||||||
extern const char* ERROR_OVERFLOW;
|
extern const char* ERROR_OVERFLOW;
|
||||||
extern const char* ERROR_INVALID_ARGS;
|
extern const char* ERROR_INVALID_ARGS;
|
||||||
|
extern const char* INFO_BREAKPOINT_ADDED;
|
||||||
|
extern const char* INFO_WATCHPOINT_ADDED;
|
||||||
|
|
||||||
struct CLIDebugger;
|
struct CLIDebugger;
|
||||||
struct VFile;
|
struct VFile;
|
||||||
|
|
|
@ -147,21 +147,27 @@ static void _printStatus(struct CLIDebuggerSystem* debugger) {
|
||||||
static void _setBreakpointARM(struct CLIDebugger* debugger, struct CLIDebugVector* dv) {
|
static void _setBreakpointARM(struct CLIDebugger* debugger, struct CLIDebugVector* dv) {
|
||||||
struct CLIDebuggerBackend* be = debugger->backend;
|
struct CLIDebuggerBackend* be = debugger->backend;
|
||||||
if (!dv || dv->type != CLIDV_INT_TYPE) {
|
if (!dv || dv->type != CLIDV_INT_TYPE) {
|
||||||
be->printf(be, "%s\n", ERROR_MISSING_ARGS);
|
be->printf(be, "%s", ERROR_MISSING_ARGS);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uint32_t address = dv->intValue;
|
uint32_t address = dv->intValue;
|
||||||
ARMDebuggerSetSoftwareBreakpoint(debugger->d.platform, address, MODE_ARM);
|
ssize_t id = ARMDebuggerSetSoftwareBreakpoint(debugger->d.platform, address, MODE_ARM);
|
||||||
|
if (id > 0) {
|
||||||
|
debugger->backend->printf(debugger->backend, INFO_BREAKPOINT_ADDED, id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _setBreakpointThumb(struct CLIDebugger* debugger, struct CLIDebugVector* dv) {
|
static void _setBreakpointThumb(struct CLIDebugger* debugger, struct CLIDebugVector* dv) {
|
||||||
struct CLIDebuggerBackend* be = debugger->backend;
|
struct CLIDebuggerBackend* be = debugger->backend;
|
||||||
if (!dv || dv->type != CLIDV_INT_TYPE) {
|
if (!dv || dv->type != CLIDV_INT_TYPE) {
|
||||||
be->printf(be, "%s\n", ERROR_MISSING_ARGS);
|
be->printf(be, "%s", ERROR_MISSING_ARGS);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uint32_t address = dv->intValue;
|
uint32_t address = dv->intValue;
|
||||||
ARMDebuggerSetSoftwareBreakpoint(debugger->d.platform, address, MODE_THUMB);
|
ssize_t id = ARMDebuggerSetSoftwareBreakpoint(debugger->d.platform, address, MODE_THUMB);
|
||||||
|
if (id > 0) {
|
||||||
|
debugger->backend->printf(debugger->backend, INFO_BREAKPOINT_ADDED, id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ARMCLIDebuggerCreate(struct CLIDebuggerSystem* debugger) {
|
void ARMCLIDebuggerCreate(struct CLIDebuggerSystem* debugger) {
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
const char* ERROR_MISSING_ARGS = "Arguments missing"; // TODO: share
|
const char* ERROR_MISSING_ARGS = "Arguments missing"; // TODO: share
|
||||||
const char* ERROR_OVERFLOW = "Arguments overflow";
|
const char* ERROR_OVERFLOW = "Arguments overflow";
|
||||||
const char* ERROR_INVALID_ARGS = "Invalid arguments";
|
const char* ERROR_INVALID_ARGS = "Invalid arguments";
|
||||||
|
const char* INFO_BREAKPOINT_ADDED = "Added breakpoint #%" PRIz "i\n";
|
||||||
|
const char* INFO_WATCHPOINT_ADDED = "Added watchpoint #%" PRIz "i\n";
|
||||||
|
|
||||||
static struct ParseTree* _parseTree(const char** string);
|
static struct ParseTree* _parseTree(const char** string);
|
||||||
static bool _doTrace(struct CLIDebugger* debugger);
|
static bool _doTrace(struct CLIDebugger* debugger);
|
||||||
|
@ -553,7 +555,10 @@ static void _setBreakpoint(struct CLIDebugger* debugger, struct CLIDebugVector*
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
debugger->d.platform->setBreakpoint(debugger->d.platform, &breakpoint);
|
ssize_t id = debugger->d.platform->setBreakpoint(debugger->d.platform, &breakpoint);
|
||||||
|
if (id > 0) {
|
||||||
|
debugger->backend->printf(debugger->backend, INFO_BREAKPOINT_ADDED, id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _setWatchpoint(struct CLIDebugger* debugger, struct CLIDebugVector* dv, enum mWatchpointType type) {
|
static void _setWatchpoint(struct CLIDebugger* debugger, struct CLIDebugVector* dv, enum mWatchpointType type) {
|
||||||
|
@ -579,7 +584,10 @@ static void _setWatchpoint(struct CLIDebugger* debugger, struct CLIDebugVector*
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
debugger->d.platform->setWatchpoint(debugger->d.platform, &watchpoint);
|
ssize_t id = debugger->d.platform->setWatchpoint(debugger->d.platform, &watchpoint);
|
||||||
|
if (id > 0) {
|
||||||
|
debugger->backend->printf(debugger->backend, INFO_WATCHPOINT_ADDED, id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _setReadWriteWatchpoint(struct CLIDebugger* debugger, struct CLIDebugVector* dv) {
|
static void _setReadWriteWatchpoint(struct CLIDebugger* debugger, struct CLIDebugVector* dv) {
|
||||||
|
|
Loading…
Reference in New Issue