MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / debug_record_ret

Function debug_record_ret

core/debug/debug.c:262–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260}
261
262void debug_record_ret(uint32_t retAddr, bool mode) {
263 uint32_t stack = cpu_address_mode(cpu.registers.stack[mode].hl, mode),
264 index = debug.stackIndex, size = debug.stackSize;
265 debug_stack_entry_t *entry;
266 bool found = false, stepOut = false, stepOutMatch;
267 while (size--) {
268 stepOutMatch = index == debug.stepOut;
269 entry = &debug.stack[index];
270 index = (index - 1) & DBG_STACK_MASK;
271 if (mode == entry->mode && (stack == entry->stack || entry->popped) &&
272 retAddr - entry->retAddr <= entry->range) {
273 debug.stackIndex = index;
274 debug.stackSize = size;
275 found = true;
276 } else if (found) {
277 break;
278 }
279 stepOut |= stepOutMatch;
280 }
281 if (found && stepOut) {
282 debug.step = true;
283 debug.stepOut = ~0u;
284 }
285}
286
287void debug_set_pc(uint32_t addr) {
288 cpu_flush(addr, cpu.ADL);

Callers 1

cpu_jumpFunction · 0.85

Calls 1

cpu_address_modeFunction · 0.85

Tested by

no test coverage detected