mirror of
https://github.com/intel/llvm.git
synced 2026-01-22 23:49:22 +08:00
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
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user