[Lldb-commits] [lldb] r280264 - Always rely on CFI unwind info for linux vdso

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 31 10:43:50 PDT 2016


Author: labath
Date: Wed Aug 31 12:43:49 2016
New Revision: 280264

URL: http://llvm.org/viewvc/llvm-project?rev=280264&view=rev
Log:
Always rely on CFI unwind info for linux vdso

Summary:
The vdso is full of hand-written assembly which the instruction emulator has a hard time
understanding. Luckily, the kernel already provides us with correct unwind info for them. So
let's use it.

This fixes (at least) the AssertingInferiorTestCase.test_inferior_asserting_disassemble test on
android N i386.

Reviewers: tberghammer

Subscribers: tberghammer, danalbert, lldb-commits

Differential Revision: https://reviews.llvm.org/D24079

Modified:
    lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
    lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h

Modified: lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp?rev=280264&r1=280263&r2=280264&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp Wed Aug 31 12:43:49 2016
@@ -7,8 +7,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-// C Includes
-// C++ Includes
+// Main header include
+#include "DynamicLoaderPOSIXDYLD.h"
+
+// Project includes
+#include "AuxVector.h"
+
 // Other libraries and framework includes
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Core/Log.h"
@@ -22,9 +26,10 @@
 #include "lldb/Target/Thread.h"
 #include "lldb/Target/ThreadPlanRunToAddress.h"
 #include "lldb/Breakpoint/BreakpointLocation.h"
+#include "lldb/Symbol/Function.h"
 
-#include "AuxVector.h"
-#include "DynamicLoaderPOSIXDYLD.h"
+// C++ Includes
+// C Includes
 
 using namespace lldb;
 using namespace lldb_private;
@@ -691,3 +696,17 @@ DynamicLoaderPOSIXDYLD::ResolveExecutabl
 
     target.SetExecutableModule (module_sp, false);
 }
+
+bool
+DynamicLoaderPOSIXDYLD::AlwaysRelyOnEHUnwindInfo(lldb_private::SymbolContext &sym_ctx)
+{
+    ModuleSP module_sp;
+    if (sym_ctx.symbol)
+        module_sp = sym_ctx.symbol->GetAddressRef().GetModule();
+    if (!module_sp && sym_ctx.function)
+        module_sp = sym_ctx.function->GetAddressRange().GetBaseAddress().GetModule();
+    if (!module_sp)
+        return false;
+
+    return module_sp->GetFileSpec().GetPath() == "[vdso]";
+}

Modified: lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h?rev=280264&r1=280263&r2=280264&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h Wed Aug 31 12:43:49 2016
@@ -172,6 +172,9 @@ protected:
     void
     ResolveExecutableModule(lldb::ModuleSP &module_sp);
 
+    bool
+    AlwaysRelyOnEHUnwindInfo(lldb_private::SymbolContext &sym_ctx) override;
+
 private:
     DISALLOW_COPY_AND_ASSIGN(DynamicLoaderPOSIXDYLD);
 };




More information about the lldb-commits mailing list