[BREAKING CHANGE] Unwinding stops at the end
This introduces a breaking change: [undefined] was previously represented by 0, and is now represented by `numeric_limits<uintptr_t>::max()`
This commit is contained in:
parent
209e668505
commit
6854eb56e4
2 changed files with 5 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
||||||
#include "settings.hpp"
|
#include "settings.hpp"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
@ -161,7 +162,7 @@ static const char* ctx_of_dw_name(SimpleDwarf::MachineRegister reg) {
|
||||||
void CodeGenerator::gen_of_reg(const SimpleDwarf::DwRegister& reg) {
|
void CodeGenerator::gen_of_reg(const SimpleDwarf::DwRegister& reg) {
|
||||||
switch(reg.type) {
|
switch(reg.type) {
|
||||||
case SimpleDwarf::DwRegister::REG_UNDEFINED:
|
case SimpleDwarf::DwRegister::REG_UNDEFINED:
|
||||||
os << "0"; // FIXME do better?
|
os << std::numeric_limits<uintptr_t>::max() << "ull";
|
||||||
break;
|
break;
|
||||||
case SimpleDwarf::DwRegister::REG_REGISTER:
|
case SimpleDwarf::DwRegister::REG_REGISTER:
|
||||||
os << ctx_of_dw_name(reg.reg)
|
os << ctx_of_dw_name(reg.reg)
|
||||||
|
|
|
@ -224,6 +224,9 @@ bool unwind_context(unwind_context_t& ctx) {
|
||||||
|
|
||||||
uintptr_t tr_pc = ctx.rip - mmap_entry->beg;
|
uintptr_t tr_pc = ctx.rip - mmap_entry->beg;
|
||||||
ctx = fde_func(ctx, tr_pc);
|
ctx = fde_func(ctx, tr_pc);
|
||||||
|
|
||||||
|
if(ctx.rbp == 0 || ctx.rip + 1 == 0)
|
||||||
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue