aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Maste <emaste@freebsd.org>2013-07-23 18:37:11 +0000
committerEd Maste <emaste@freebsd.org>2013-07-23 18:37:11 +0000
commiteb4b3d2b9d9d754db6c357a66223fca4af7cab71 (patch)
tree52f7478f2e3d234d8235c1d08cf2dbcdfb537ef4
parent3c2a6c63f4df24518b8cc57ae6081f90e8d60f41 (diff)
downloadlldb-eb4b3d2b9d9d754db6c357a66223fca4af7cab71.tar.gz
elf-core: Add helper function for parsing FreeBSD NT_PRSTATUS
This avoids the use of the ELFPrStatus class, which returns to being used only for Linux. git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@186976 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--source/Plugins/Process/elf-core/ProcessElfCore.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/source/Plugins/Process/elf-core/ProcessElfCore.cpp b/source/Plugins/Process/elf-core/ProcessElfCore.cpp
index b507e9819..a79fec66e 100644
--- a/source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ b/source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -436,6 +436,20 @@ struct ELFNote
};
static void
+ParseFreeBSDPrStatus(ThreadData *thread_data, DataExtractor &data,
+ ArchSpec &arch)
+{
+ lldb::offset_t offset;
+ size_t len;
+
+ offset = 36;
+ thread_data->signo = data.GetU32(&offset);
+ offset = 48;
+ len = data.GetByteSize() - offset;
+ thread_data->gpregset = DataExtractor(data, offset, len);
+}
+
+static void
ParseFreeBSDThrMisc(ThreadData *thread_data, DataExtractor &data)
{
lldb::offset_t offset = 0;
@@ -507,11 +521,7 @@ ProcessElfCore::ParseThreadContextsFromNoteSegment(const elf::ELFProgramHeader *
{
case NT_FREEBSD_PRSTATUS:
have_prstatus = true;
- prstatus.Parse(note_data, arch);
- thread_data->signo = prstatus.pr_cursig;
- header_size = ELFPrStatus::GetSize(arch);
- len = note_data.GetByteSize() - header_size;
- thread_data->gpregset = DataExtractor(note_data, header_size, len);
+ ParseFreeBSDPrStatus(thread_data, note_data, arch);
break;
case NT_FREEBSD_FPREGSET:
thread_data->fpregset = note_data;