fix (stack-tracing): added check if symbol resolved correctly

This commit is contained in:
antifallobst 2023-03-04 17:32:34 +01:00
parent 9d5ba72228
commit e0494263da
1 changed files with 6 additions and 1 deletions

View File

@ -34,7 +34,12 @@ void stack_trace_call_stack(uint64_t rbp) {
process_T* process = scheduler_get_current_process(); process_T* process = scheduler_get_current_process();
symbol_T* symbol = symbol_resolve_function_from_rip(process->executable->symbols, process->executable->num_symbols, rip); symbol_T* symbol = symbol_resolve_function_from_rip(process->executable->symbols, process->executable->num_symbols, rip);
if (symbol != NULL && !string_compare(symbol->name, "_start")) { if (symbol == NULL) {
log(LOG_NONE, " 0x%x -> <failed to resolve symbol>", rip);
return;
}
if (!string_compare(symbol->name, "_start")) {
stack_trace_call_stack(((uint64_t*)rbp)[0]); stack_trace_call_stack(((uint64_t*)rbp)[0]);
} }