Handle cleanly the absence of RBP

This commit is contained in:
Théophile Bastian 2018-04-12 13:24:07 +02:00
parent 0dd3ca94ce
commit 4369a4f3cc

View file

@ -205,13 +205,17 @@ DwarfInterpret::UnwindContext DwarfInterpret::unwind_context(
// An undefined RA means we've reached the end of the call stack // An undefined RA means we've reached the end of the call stack
throw FirstUnwindFrame(); throw FirstUnwindFrame();
} }
new_context.rbp = interpret_dw_register( try {
cur_row, new_context.rbp = interpret_dw_register(
lib::DWARF_X86_64_RBP, cur_row,
ctx); lib::DWARF_X86_64_RBP,
if(new_context.rbp == 0) { ctx);
// A null rbp means we've reached the end of the call stack if(new_context.rbp == 0) {
throw FirstUnwindFrame(); // A null rbp means we've reached the end of the call stack
throw FirstUnwindFrame();
}
} catch(const std::out_of_range& e) {
new_context.rbp = 0; // The base pointer does not exist
} }
new_context.rsp = interpret_dw_register( new_context.rsp = interpret_dw_register(