Fixed the debug printf feature in the case where a debugger is not attached.
This commit is contained in:
parent
6a987e31b7
commit
9ef3e205b0
|
@ -255,7 +255,7 @@ char *(patchNames[PATCH_MAX_NUM]) = { NULL }; // and so on
|
||||||
|
|
||||||
void(*dbgMain)() = remoteStubMain;
|
void(*dbgMain)() = remoteStubMain;
|
||||||
void(*dbgSignal)(int, int) = remoteStubSignal;
|
void(*dbgSignal)(int, int) = remoteStubSignal;
|
||||||
void(*dbgOutput)(const char *, u32) = remoteOutput;
|
void(*dbgOutput)(const char *, u32) = debuggerOutput;
|
||||||
|
|
||||||
char* homeDir = NULL;
|
char* homeDir = NULL;
|
||||||
char* arg0 = NULL;
|
char* arg0 = NULL;
|
||||||
|
|
|
@ -273,6 +273,23 @@ void printBreakRegList(bool verbose){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void debuggerOutput(const char *s, u32 addr)
|
||||||
|
{
|
||||||
|
if (s)
|
||||||
|
printf("%s", s);
|
||||||
|
else {
|
||||||
|
char c;
|
||||||
|
|
||||||
|
c = debuggerReadByte(addr);
|
||||||
|
addr++;
|
||||||
|
while (c) {
|
||||||
|
putchar(c);
|
||||||
|
c = debuggerReadByte(addr);
|
||||||
|
addr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// checks that the given address is in the DB list
|
// checks that the given address is in the DB list
|
||||||
bool debuggerInDB(u32 address)
|
bool debuggerInDB(u32 address)
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,6 +43,8 @@ extern void dexp_listVars();
|
||||||
extern void dexp_saveVars(char *);
|
extern void dexp_saveVars(char *);
|
||||||
extern void dexp_loadVars(char *);
|
extern void dexp_loadVars(char *);
|
||||||
|
|
||||||
|
void debuggerOutput(const char *s, u32 addr);
|
||||||
|
|
||||||
bool debuggerBreakOnExecution(u32 address, u8 state);
|
bool debuggerBreakOnExecution(u32 address, u8 state);
|
||||||
bool debuggerBreakOnWrite(u32 address, u32 value, int size);
|
bool debuggerBreakOnWrite(u32 address, u32 value, int size);
|
||||||
void debuggerBreakOnWrite(u32 address, u32 oldvalue, u32 value, int size, int t);
|
void debuggerBreakOnWrite(u32 address, u32 oldvalue, u32 value, int size, int t);
|
||||||
|
|
Loading…
Reference in New Issue