Commit 6b4cc450 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Be more consistent about "ip" while unwinding

I think the ip we receive is the return address to that stack frame
(at least in the non-signal case).  This makes things a bit weird
since the "is this ip in this range" tests have a different half-openness
than they normally do.  At some point an "ip = ip - 1" snuck in, which
I think was to address this issue, but I think it's better to not
change the ip -- ie the resulting address is not independently useful (it's
in the middle of an instruction); we could pass it around as "ip_minus_one",
but instead just try converting the tests to be better.
parent a60a1b9a
...@@ -404,12 +404,12 @@ static unw_word_t getFunctionEnd(unw_word_t ip) { ...@@ -404,12 +404,12 @@ static unw_word_t getFunctionEnd(unw_word_t ip) {
static bool inASTInterpreterExecuteInner(unw_word_t ip) { static bool inASTInterpreterExecuteInner(unw_word_t ip) {
static unw_word_t interpreter_instr_end = getFunctionEnd((unw_word_t)interpreter_instr_addr); static unw_word_t interpreter_instr_end = getFunctionEnd((unw_word_t)interpreter_instr_addr);
return ((unw_word_t)interpreter_instr_addr <= ip && ip < interpreter_instr_end); return ((unw_word_t)interpreter_instr_addr < ip && ip <= interpreter_instr_end);
} }
static bool inGeneratorEntry(unw_word_t ip) { static bool inGeneratorEntry(unw_word_t ip) {
static unw_word_t generator_entry_end = getFunctionEnd((unw_word_t)generatorEntry); static unw_word_t generator_entry_end = getFunctionEnd((unw_word_t)generatorEntry);
return ((unw_word_t)generatorEntry <= ip && ip < generator_entry_end); return ((unw_word_t)generatorEntry < ip && ip <= generator_entry_end);
} }
...@@ -419,7 +419,7 @@ static inline unw_word_t get_cursor_reg(unw_cursor_t* cursor, int reg) { ...@@ -419,7 +419,7 @@ static inline unw_word_t get_cursor_reg(unw_cursor_t* cursor, int reg) {
return v; return v;
} }
static inline unw_word_t get_cursor_ip(unw_cursor_t* cursor) { static inline unw_word_t get_cursor_ip(unw_cursor_t* cursor) {
return get_cursor_reg(cursor, UNW_REG_IP) - 1; return get_cursor_reg(cursor, UNW_REG_IP);
} }
static inline unw_word_t get_cursor_bp(unw_cursor_t* cursor) { static inline unw_word_t get_cursor_bp(unw_cursor_t* cursor) {
return get_cursor_reg(cursor, UNW_TDEP_BP); return get_cursor_reg(cursor, UNW_TDEP_BP);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment