Debugger: Only support breaking into the external debugger in debug builds

This commit is contained in:
Jeffrey Pfau 2015-08-08 02:26:35 -07:00
parent a728ad2a81
commit c9c9ff802c
1 changed files with 6 additions and 0 deletions

View File

@ -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 @@ static struct CLIDebuggerCommandSummary _debuggerCommands[] = {
{ "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 @@ static inline void _printPSR(union PSR psr) {
psr.t ? 'T' : '-');
}
#ifndef NDEBUG
static void _handleDeath(int sig) {
UNUSED(sig);
printf("No debugger attached!\n");
@ -135,6 +140,7 @@ static void _breakInto(struct CLIDebugger* debugger, struct CLIDebugVector* dv)
#endif
sigaction(SIGTRAP, &osa, 0);
}
#endif
static void _continue(struct CLIDebugger* debugger, struct CLIDebugVector* dv) {
UNUSED(dv);