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.

llvm-svn: 118243
This commit is contained in:
Jason Molenda 2010-11-04 09:51:29 +00:00
parent 311eb2deec
commit c311c23402
1 changed files with 9 additions and 0 deletions

View File

@ -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 @@ ThreadGDBRemote::RefreshStateAfterStop()
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 @@ ThreadGDBRemote::GetUnwinder ()
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
{