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,6 +205,7 @@ 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();
} }
try {
new_context.rbp = interpret_dw_register( new_context.rbp = interpret_dw_register(
cur_row, cur_row,
lib::DWARF_X86_64_RBP, lib::DWARF_X86_64_RBP,
@ -213,6 +214,9 @@ DwarfInterpret::UnwindContext DwarfInterpret::unwind_context(
// A null rbp means we've reached the end of the call stack // A null rbp means we've reached the end of the call stack
throw FirstUnwindFrame(); 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(
cur_row, cur_row,