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
throw FirstUnwindFrame();
}
new_context.rbp = interpret_dw_register(
cur_row,
lib::DWARF_X86_64_RBP,
ctx);
if(new_context.rbp == 0) {
// A null rbp means we've reached the end of the call stack
throw FirstUnwindFrame();
try {
new_context.rbp = interpret_dw_register(
cur_row,
lib::DWARF_X86_64_RBP,
ctx);
if(new_context.rbp == 0) {
// 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(