diff options
| author | Ed Maste <emaste@freebsd.org> | 2014-02-14 21:29:05 +0000 |
|---|---|---|
| committer | Ed Maste <emaste@freebsd.org> | 2014-02-14 21:29:05 +0000 |
| commit | 8b4a283234cd6562629aef0d955e57674fcfc15b (patch) | |
| tree | e557f25a4f6a7a6061c470c18064fad5a8d10a05 /lldb/source/Plugins/Process | |
| parent | 728d4172df9a88dcb92795bf48d3d2ab5782b5dd (diff) | |
| download | bcm5719-llvm-8b4a283234cd6562629aef0d955e57674fcfc15b.tar.gz bcm5719-llvm-8b4a283234cd6562629aef0d955e57674fcfc15b.zip | |
Correct offset calculation for FreeBSD i386 core NT_PRSTATUS
llvm-svn: 201434
Diffstat (limited to 'lldb/source/Plugins/Process')
| -rw-r--r-- | lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp index a2b02d26d82..1db58550d78 100644 --- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp +++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp @@ -374,8 +374,8 @@ ParseFreeBSDPrStatus(ThreadData *thread_data, DataExtractor &data, ArchSpec &arch) { lldb::offset_t offset = 0; - bool have_padding = (arch.GetMachine() == llvm::Triple::mips64 || - arch.GetMachine() == llvm::Triple::x86_64); + bool lp64 = (arch.GetMachine() == llvm::Triple::mips64 || + arch.GetMachine() == llvm::Triple::x86_64); int pr_version = data.GetU32(&offset); Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_PROCESS)); @@ -385,12 +385,15 @@ ParseFreeBSDPrStatus(ThreadData *thread_data, DataExtractor &data, log->Printf("FreeBSD PRSTATUS unexpected version %d", pr_version); } - if (have_padding) - offset += 4; - offset += 28; // pr_statussz, pr_gregsetsz, pr_fpregsetsz, pr_osreldate + // Skip padding, pr_statussz, pr_gregsetsz, pr_fpregsetsz, pr_osreldate + if (lp64) + offset += 32; + else + offset += 16; + thread_data->signo = data.GetU32(&offset); // pr_cursig offset += 4; // pr_pid - if (have_padding) + if (lp64) offset += 4; size_t len = data.GetByteSize() - offset; |

