all repos — mgba @ c9c9ff802c424c39a7b5be207789152553944e6d

mGBA Game Boy Advance Emulator

Debugger: Only support breaking into the external debugger in debug builds
Jeffrey Pfau jeffrey@endrift.com
Sat, 08 Aug 2015 02:26:35 -0700
commit

c9c9ff802c424c39a7b5be207789152553944e6d

parent

a728ad2a8143efe53bd5e4aae4361da178f67368

1 files changed, 6 insertions(+), 0 deletions(-)

jump to
M src/debugger/cli-debugger.csrc/debugger/cli-debugger.c

@@ -18,7 +18,9 @@ static const char* ERROR_OVERFLOW = "Arguments overflow";

static struct CLIDebugger* _activeDebugger; +#ifndef NDEBUG static void _breakInto(struct CLIDebugger*, struct CLIDebugVector*); +#endif static void _continue(struct CLIDebugger*, struct CLIDebugVector*); static void _disassemble(struct CLIDebugger*, struct CLIDebugVector*); static void _disassembleArm(struct CLIDebugger*, struct CLIDebugVector*);

@@ -99,7 +101,9 @@ { "w/r", _writeRegister, CLIDVParse, "Write a register" },

{ "x/1", _dumpByte, CLIDVParse, "Examine bytes at a specified offset" }, { "x/2", _dumpHalfword, CLIDVParse, "Examine halfwords at a specified offset" }, { "x/4", _dumpWord, CLIDVParse, "Examine words at a specified offset" }, +#ifndef NDEBUG { "!", _breakInto, 0, "Break into attached debugger (for developers)" }, +#endif { 0, 0, 0, 0 } };

@@ -114,6 +118,7 @@ psr.f ? 'F' : '-',

psr.t ? 'T' : '-'); } +#ifndef NDEBUG static void _handleDeath(int sig) { UNUSED(sig); printf("No debugger attached!\n");

@@ -135,6 +140,7 @@ kill(getpid(), SIGTRAP);

#endif sigaction(SIGTRAP, &osa, 0); } +#endif static void _continue(struct CLIDebugger* debugger, struct CLIDebugVector* dv) { UNUSED(dv);