summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/elf-core
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2016-03-16 09:19:57 +0000
committerPavel Labath <labath@google.com>2016-03-16 09:19:57 +0000
commit39aab4d60664a3ee56e7add57aafed453cab1df7 (patch)
tree0192011097f92f710b73d62c5d237d80b5ef60b5 /lldb/source/Plugins/Process/elf-core
parent302f83ac4e5ba37d9b116867ba6a537b0f0adb9a (diff)
downloadbcm5719-llvm-39aab4d60664a3ee56e7add57aafed453cab1df7.tar.gz
bcm5719-llvm-39aab4d60664a3ee56e7add57aafed453cab1df7.zip
Fix thread/process ID reading from linux core files
Summary: This also adds a basic smoke test for linux core file reading. I'm checking in the core files as well, so that the tests can run on all platforms. With some tricks I was able to produce reasonably-sized core files (~40K). This fixes the first part of pr26322. Reviewers: zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D18176 llvm-svn: 263628
Diffstat (limited to 'lldb/source/Plugins/Process/elf-core')
-rw-r--r--lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
index db56cc38140..fb54153a919 100644
--- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -559,11 +559,10 @@ ProcessElfCore::ParseThreadContextsFromNoteSegment(const elf::ELFProgramHeader *
have_prstatus = true;
prstatus.Parse(note_data, arch);
thread_data->signo = prstatus.pr_cursig;
+ thread_data->tid = prstatus.pr_pid;
header_size = ELFLinuxPrStatus::GetSize(arch);
len = note_data.GetByteSize() - header_size;
thread_data->gpregset = DataExtractor(note_data, header_size, len);
- // FIXME: Obtain actual tid on Linux
- thread_data->tid = m_thread_data.size();
break;
case NT_FPREGSET:
thread_data->fpregset = note_data;
@@ -572,6 +571,7 @@ ProcessElfCore::ParseThreadContextsFromNoteSegment(const elf::ELFProgramHeader *
have_prpsinfo = true;
prpsinfo.Parse(note_data, arch);
thread_data->name = prpsinfo.pr_fname;
+ SetID(prpsinfo.pr_pid);
break;
case NT_AUXV:
m_auxv = DataExtractor(note_data);
OpenPOWER on IntegriCloud