[libunwind] Support for leaf function unwinding.
Unwinding leaf function is useful in cases when the backtrace finds a
leaf function for example when it caused a signal.
This patch also add the support for the DW_CFA_undefined because it marks
the end of the frames.
Ryan Prichard provided code for the tests.
Reviewed By: #libunwind, mstorsjo
Differential Revision: https://reviews.llvm.org/D83573
Reland with limit the test to the x86_64-linux target.
Cr-Mirrored-From: https://chromium.googlesource.com/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 22b615a96593f13109a27cabfd1764ec4f558c7a
diff --git a/src/DwarfParser.hpp b/src/DwarfParser.hpp
index fb943ed..86c0522 100644
--- a/src/DwarfParser.hpp
+++ b/src/DwarfParser.hpp
@@ -69,6 +69,7 @@
};
enum RegisterSavedWhere {
kRegisterUnused,
+ kRegisterUndefined,
kRegisterInCFA,
kRegisterOffsetFromCFA,
kRegisterInRegister,
@@ -505,7 +506,7 @@
"malformed DW_CFA_undefined DWARF unwind, reg too big");
return false;
}
- results->setRegisterLocation(reg, kRegisterUnused, initialState);
+ results->setRegisterLocation(reg, kRegisterUndefined, initialState);
_LIBUNWIND_TRACE_DWARF("DW_CFA_undefined(reg=%" PRIu64 ")\n", reg);
break;
case DW_CFA_same_value: