fix SF in print_expr_block() due to wrong dereference of stack pointer
to memory location
This commit is contained in:
@@ -154,11 +154,9 @@ uint32_t __pst_context::print_expr_block (Dwarf_Op *exprs, int len, char* buff,
|
||||
} else if(map->op_num == DW_OP_bregx) {
|
||||
uint32_t regno = decode_uleb128((unsigned char*)&exprs[i].number);
|
||||
int32_t off = decode_sleb128((unsigned char*)&exprs[i].number2);
|
||||
|
||||
unw_word_t ptr = 0;
|
||||
unw_get_reg(&cursor, regno, &ptr);
|
||||
//ptr += off;
|
||||
|
||||
offset += snprintf(buff + offset, buff_size - offset, "%s(%s%s%d) reg_value = 0x%lX", map->op_name, unw_regname(regno), off >= 0 ? "+" : "", off, ptr);
|
||||
} else if(map->op_num == DW_OP_regx) {
|
||||
int32_t reg = decode_sleb128((unsigned char*)&exprs[i].number);
|
||||
@@ -168,7 +166,7 @@ uint32_t __pst_context::print_expr_block (Dwarf_Op *exprs, int len, char* buff,
|
||||
|
||||
offset += snprintf(buff + offset, buff_size - offset, "%s(%s) value = 0x%lX", map->op_name, unw_regname(reg), value);
|
||||
} else if(map->op_num == DW_OP_addr) {
|
||||
offset += snprintf(buff + offset, buff_size - offset, "%s value = 0x%X", map->op_name, *((uint32_t*)exprs[i].number));
|
||||
offset += snprintf(buff + offset, buff_size - offset, "%s value = %p", map->op_name, (void*)exprs[i].number);
|
||||
} else {
|
||||
offset += snprintf(buff + offset, buff_size - offset, "%s(0x%lX, 0x%lx) ", map->op_name, exprs[i].number, exprs[i].number2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user