Don't implicitly dereference DW_CFA_def_cfa_expression.
The specification isn't entirely clear. Follow the gdb interpretation.
Bug: 73954823
Test: libunwindstack_test
Change-Id: If72717f54eed84e442f43af19e615143a9796b68
diff --git a/libunwindstack/DwarfSection.cpp b/libunwindstack/DwarfSection.cpp
index 7649798..ddbc12e 100644
--- a/libunwindstack/DwarfSection.cpp
+++ b/libunwindstack/DwarfSection.cpp
@@ -214,21 +214,13 @@
}
eval_info.cfa += loc->values[1];
break;
- case DWARF_LOCATION_EXPRESSION:
case DWARF_LOCATION_VAL_EXPRESSION: {
AddressType value;
if (!EvalExpression(*loc, regular_memory, &value, &eval_info.regs_info, nullptr)) {
return false;
}
- if (loc->type == DWARF_LOCATION_EXPRESSION) {
- if (!regular_memory->ReadFully(value, &eval_info.cfa, sizeof(AddressType))) {
- last_error_.code = DWARF_ERROR_MEMORY_INVALID;
- last_error_.address = value;
- return false;
- }
- } else {
- eval_info.cfa = value;
- }
+ // There is only one type of valid expression for CFA evaluation.
+ eval_info.cfa = value;
break;
}
default: