diff options
author | Pavel Labath <labath@google.com> | 2016-04-05 13:07:16 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2016-04-05 13:07:16 +0000 |
commit | a933d5179e411f40059a3711c9a09559b4acb62d (patch) | |
tree | 7851360ca4a039c85f9bd15e6636c218fa815398 /lldb/source/Target/Process.cpp | |
parent | d9d41f531ef63ecf14472df29c68d8113284f051 (diff) | |
download | bcm5719-llvm-a933d5179e411f40059a3711c9a09559b4acb62d.tar.gz bcm5719-llvm-a933d5179e411f40059a3711c9a09559b4acb62d.zip |
Fix a bug in linux core file handling
Summary:
There was a bug in linux core file handling, where if there was a running process with the same
process id as the id in the core file, the core file debugging would fail, as we would pull some
pieces of information (ProcessInfo structure) from the running process instead of the core file.
I fix this by routing the ProcessInfo requests through the Process class and overriding it in
ProcessElfCore to return correct data.
A (slightly convoluted) test is included.
Reviewers: clayborg, zturner
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D18697
llvm-svn: 265391
Diffstat (limited to 'lldb/source/Target/Process.cpp')
-rw-r--r-- | lldb/source/Target/Process.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 4f15d5880a6..be21df55bb5 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -3422,7 +3422,7 @@ Process::CompleteAttach () else if (!process_arch.IsValid()) { ProcessInstanceInfo process_info; - platform_sp->GetProcessInfo (GetID(), process_info); + GetProcessInfo(process_info); const ArchSpec &process_arch = process_info.GetArchitecture(); if (process_arch.IsValid() && !GetTarget().GetArchitecture().IsExactMatch(process_arch)) { @@ -6481,6 +6481,18 @@ Process::PrintWarningOptimization (const SymbolContext &sc) } } +bool +Process::GetProcessInfo(ProcessInstanceInfo &info) +{ + info.Clear(); + + PlatformSP platform_sp = GetTarget().GetPlatform(); + if (! platform_sp) + return false; + + return platform_sp->GetProcessInfo(GetID(), info); +} + ThreadCollectionSP Process::GetHistoryThreads(lldb::addr_t addr) { |