Add #ifdef to easily switch between the current libunwind-remote based unwinder
or the native unwinder (UnwindLLDB). I'll make the native unwinder the default
once I check in with everyone tomorrow.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118243 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp b/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
index d666734..478684d 100644
--- a/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
+++ b/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
@@ -26,6 +26,7 @@
#include "Utility/StringExtractorGDBRemote.h"
#include "UnwindLibUnwind.h"
#include "UnwindMacOSXFrameBackchain.h"
+#include "UnwindLLDB.h"
using namespace lldb;
using namespace lldb_private;
@@ -120,6 +121,10 @@
GetRegisterContext()->Invalidate();
}
+// Whether to use the new native unwinder (UnwindLLDB) or the libunwind-remote based unwinder for
+// stack walks on i386/x86_64
+#undef USE_NATIVE_UNWINDER
+
Unwind *
ThreadGDBRemote::GetUnwinder ()
{
@@ -128,7 +133,11 @@
const ArchSpec target_arch (GetProcess().GetTarget().GetArchitecture ());
if (target_arch == ArchSpec("x86_64") || target_arch == ArchSpec("i386"))
{
+#if defined (USE_NATIVE_UNWINDER)
+ m_unwinder_ap.reset (new UnwindLLDB (*this));
+#else
m_unwinder_ap.reset (new UnwindLibUnwind (*this, GetGDBProcess().GetLibUnwindAddressSpace()));
+#endif
}
else
{