Fix stack overflow when stack trace is too large

This commit is contained in:
Yannik Marchand 2018-09-24 17:17:05 +02:00
parent bbf63715e9
commit 190a55e032

View File

@ -792,9 +792,9 @@ void Debugger::mainLoop(Client *client) {
ExceptionState *state = exceptions.find(thread); ExceptionState *state = exceptions.find(thread);
if (state) { if (state) {
uint32_t sp = state->context.gpr[1]; uint32_t sp = state->context.gpr[1];
uint32_t trace[32]; uint32_t trace[100];
int index = 0; int index = 0;
while (checkDataRead(sp, 4)) { while (checkDataRead(sp, 4) && index < 100) {
sp = *(uint32_t *)sp; sp = *(uint32_t *)sp;
if (!checkDataRead(sp, 4)) break; if (!checkDataRead(sp, 4)) break;