summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp26
-rw-r--r--lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h9
-rw-r--r--lldb/test/functionalities/inferior-assert/TestInferiorAssert.py13
-rw-r--r--lldb/test/python_api/hello_world/TestHelloWorld.py2
4 files changed, 42 insertions, 8 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
index e563ad66b4a..6ba7b470d74 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
@@ -91,7 +91,8 @@ DynamicLoaderPOSIXDYLD::DynamicLoaderPOSIXDYLD(Process *process)
m_load_offset(LLDB_INVALID_ADDRESS),
m_entry_point(LLDB_INVALID_ADDRESS),
m_auxv(),
- m_dyld_bid(LLDB_INVALID_BREAK_ID)
+ m_dyld_bid(LLDB_INVALID_BREAK_ID),
+ m_vdso_base(LLDB_INVALID_ADDRESS)
{
}
@@ -126,6 +127,8 @@ DynamicLoaderPOSIXDYLD::DidAttach()
if (log)
log->Printf ("DynamicLoaderPOSIXDYLD::%s pid %" PRIu64 " executable '%s', load_offset 0x%" PRIx64, __FUNCTION__, m_process ? m_process->GetID () : LLDB_INVALID_PROCESS_ID, executable_sp ? executable_sp->GetFileSpec().GetPath().c_str () : "<null executable>", load_offset);
+ EvalVdsoStatus();
+
// if we dont have a load address we cant re-base
bool rebase_exec = (load_offset == LLDB_INVALID_ADDRESS) ? false : true;
@@ -213,6 +216,7 @@ DynamicLoaderPOSIXDYLD::DidLaunch()
executable = GetTargetExecutable();
load_offset = ComputeLoadOffset();
+ EvalVdsoStatus();
if (executable.get() && load_offset != LLDB_INVALID_ADDRESS)
{
@@ -503,7 +507,15 @@ DynamicLoaderPOSIXDYLD::LoadAllCurrentModules()
// that ourselves here.
ModuleSP executable = GetTargetExecutable();
m_loaded_modules[executable] = m_rendezvous.GetLinkMapAddress();
-
+ if (m_vdso_base != LLDB_INVALID_ADDRESS)
+ {
+ FileSpec file_spec("[vdso]", false);
+ ModuleSP module_sp = LoadModuleAtAddress(file_spec, LLDB_INVALID_ADDRESS, m_vdso_base, false);
+ if (module_sp.get())
+ {
+ module_list.Append(module_sp);
+ }
+ }
for (I = m_rendezvous.begin(), E = m_rendezvous.end(); I != E; ++I)
{
ModuleSP module_sp = LoadModuleAtAddress(I->file_spec, I->link_addr, I->base_addr, true);
@@ -551,6 +563,16 @@ DynamicLoaderPOSIXDYLD::ComputeLoadOffset()
return m_load_offset;
}
+void
+DynamicLoaderPOSIXDYLD::EvalVdsoStatus()
+{
+ AuxVector::iterator I = m_auxv->FindEntry(AuxVector::AT_SYSINFO_EHDR);
+
+ if (I != m_auxv->end())
+ m_vdso_base = I->value;
+
+}
+
addr_t
DynamicLoaderPOSIXDYLD::GetEntryPoint()
{
diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
index d3407eb23cd..cb97bbf43ba 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
@@ -88,6 +88,10 @@ protected:
/// Rendezvous breakpoint.
lldb::break_id_t m_dyld_bid;
+ /// Contains AT_SYSINFO_EHDR, which means a vDSO has been
+ /// mapped to the address space
+ lldb::addr_t m_vdso_base;
+
/// Loaded module list. (link map for each module)
std::map<lldb::ModuleWP, lldb::addr_t, std::owner_less<lldb::ModuleWP>> m_loaded_modules;
@@ -159,6 +163,11 @@ protected:
lldb::addr_t
GetEntryPoint();
+ /// Evaluate if Aux vectors contain vDSO information
+ /// in case they do, read and assign the address to m_vdso_base
+ void
+ EvalVdsoStatus();
+
/// Loads Module from inferior process.
void
ResolveExecutableModule(lldb::ModuleSP &module_sp);
diff --git a/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py b/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py
index 7bbeff6c95a..e5bc232caea 100644
--- a/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py
+++ b/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py
@@ -12,7 +12,6 @@ class AssertingInferiorTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailurei386("llvm.org/pr17384: lldb needs to be aware of linux-vdso.so to unwind stacks properly")
@expectedFailureWindows("llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
def test_inferior_asserting(self):
"""Test that lldb reliably catches the inferior asserting (command)."""
@@ -26,7 +25,6 @@ class AssertingInferiorTestCase(TestBase):
self.build()
self.inferior_asserting_registers()
- @expectedFailurei386("llvm.org/pr17384: lldb needs to be aware of linux-vdso.so to unwind stacks properly")
@expectedFailureWindows("llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
def test_inferior_asserting_disassemble(self):
"""Test that lldb reliably disassembles frames after asserting (command)."""
@@ -40,14 +38,12 @@ class AssertingInferiorTestCase(TestBase):
self.build()
self.inferior_asserting_python()
- @expectedFailurei386('llvm.org/pr17384: lldb needs to be aware of linux-vdso.so to unwind stacks properly')
@expectedFailureWindows("llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
def test_inferior_asserting_expr(self):
"""Test that the lldb expression interpreter can read from the inferior after asserting (command)."""
self.build()
self.inferior_asserting_expr()
- @expectedFailurei386("llvm.org/pr17384: lldb needs to be aware of linux-vdso.so to unwind stacks properly")
@expectedFailureWindows("llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
def test_inferior_asserting_step(self):
"""Test that lldb functions correctly after stepping through a call to assert()."""
@@ -146,6 +142,12 @@ class AssertingInferiorTestCase(TestBase):
thread = process.GetThreadAtIndex(0)
self.assertTrue(thread.IsValid(), "current thread is valid")
+ lastframeID = thread.GetFrameAtIndex(thread.GetNumFrames() - 1).GetFrameID()
+
+ isi386Arch = False
+ if "i386" in self.getArchitecture():
+ isi386Arch = True
+
# lldb should be able to disassemble frames from the inferior after asserting.
for frame in thread:
self.assertTrue(frame.IsValid(), "current frame is valid")
@@ -160,6 +162,9 @@ class AssertingInferiorTestCase(TestBase):
pc_backup_offset = 1
if frame.GetFrameID() == 0:
pc_backup_offset = 0
+ if isi386Arch == True:
+ if lastframeID == frame.GetFrameID():
+ pc_backup_offset = 0
self.expect("disassemble -a %s" % (frame.GetPC() - pc_backup_offset),
substrs = ['<+0>: '])
diff --git a/lldb/test/python_api/hello_world/TestHelloWorld.py b/lldb/test/python_api/hello_world/TestHelloWorld.py
index 263d41c22d5..84ad17ab6ee 100644
--- a/lldb/test/python_api/hello_world/TestHelloWorld.py
+++ b/lldb/test/python_api/hello_world/TestHelloWorld.py
@@ -73,7 +73,6 @@ class HelloWorldTestCase(TestBase):
self.assertTrue(breakpoint.GetHitCount() == 1, BREAKPOINT_HIT_ONCE)
@add_test_categories(['pyapi'])
- @expectedFailurei386 # llvm.org/pr17384: lldb needs to be aware of linux-vdso.so to unwind stacks properly
@expectedFailureWindows("llvm.org/pr24600")
def test_with_attach_to_process_with_id_api(self):
"""Create target, spawn a process, and attach to it with process id."""
@@ -102,7 +101,6 @@ class HelloWorldTestCase(TestBase):
'(int)argc=3'])
@add_test_categories(['pyapi'])
- @expectedFailurei386 # llvm.org/pr17384: lldb needs to be aware of linux-vdso.so to unwind stacks properly
@expectedFailureWindows("llvm.org/pr24600")
def test_with_attach_to_process_with_name_api(self):
"""Create target, spawn a process, and attach to it with process name."""
OpenPOWER on IntegriCloud