Get a disassembler based on the correct architecture for assembly
prologue profiling.
Change the log print statements to elide the thread number, make
some of them only print when IsLogVerbose().
Add a couple of sanity checks for impossible CFA values so backtraces
don't go too far off into the weeds.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117343 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/Utility/UnwindLLDB.cpp b/source/Plugins/Process/Utility/UnwindLLDB.cpp
index 6d4c345..e2d2f9c 100644
--- a/source/Plugins/Process/Utility/UnwindLLDB.cpp
+++ b/source/Plugins/Process/Utility/UnwindLLDB.cpp
@@ -71,8 +71,8 @@
delete register_ctx;
if (log)
{
- log->Printf("%*sThread %u Frame %d invalid RegisterContext for this frame, stopping stack walk",
- cur_idx, "", m_thread.GetIndexID(), cur_idx);
+ log->Printf("%*sFrame %d invalid RegisterContext for this frame, stopping stack walk",
+ cur_idx, "", cur_idx);
}
break;
}
@@ -81,8 +81,18 @@
delete register_ctx;
if (log)
{
- log->Printf("%*sThread %u Frame %d did not get CFA for this frame, stopping stack walk",
- cur_idx, "", m_thread.GetIndexID(), cur_idx);
+ log->Printf("%*sFrame %d did not get CFA for this frame, stopping stack walk",
+ cur_idx, "", cur_idx);
+ }
+ break;
+ }
+ if (cursor.cfa == (addr_t) -1 || cursor.cfa == 1 || cursor.cfa == 0)
+ {
+ delete register_ctx;
+ if (log)
+ {
+ log->Printf("%*sFrame %d did not get a valid CFA for this frame, stopping stack walk",
+ cur_idx, "", cur_idx);
}
break;
}
@@ -91,8 +101,8 @@
delete register_ctx;
if (log)
{
- log->Printf("%*sThread %u Frame %d did not get PC for this frame, stopping stack walk",
- cur_idx, "", m_thread.GetIndexID(), cur_idx);
+ log->Printf("%*sFrame %d did not get PC for this frame, stopping stack walk",
+ cur_idx, "", cur_idx);
}
break;
}