summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
diff options
context:
space:
mode:
authorTodd Fiala <tfiala@google.com>2014-02-27 20:46:12 +0000
committerTodd Fiala <tfiala@google.com>2014-02-27 20:46:12 +0000
commit4507f06aaa1fa372b0b0fe62ad2fb4b70574e9e2 (patch)
tree50a6bf891a4eb79aa38a462b408807c81e8b7111 /lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
parent95833f33bda6c92e746e0b0007b69c2c30bfc693 (diff)
downloadbcm5719-llvm-4507f06aaa1fa372b0b0fe62ad2fb4b70574e9e2.tar.gz
bcm5719-llvm-4507f06aaa1fa372b0b0fe62ad2fb4b70574e9e2.zip
Fix linux x86 debugging on a linux x86 host (32-bit on 32-bit).
This change fixes up issues with specifying the size of the i386 register infos for FPU registers. The bug was that for the i386 register context, the size of the FPU registers were still being computed based on the x86_64 FXSAVE structure. This change permits the FPR_SIZE macro to optionally be defined outside of RegisterInfos_i386.h, which RegisterContextLinux_i386.cpp does properly. It redefines the FPR_i386 structure with all the accessible parts that RegisterInfos_i386.h wants to see, which we had not done before when we made the overall size of the structure properly sized a recently. This change also modifies POSIXThread to create a RegisterContextLinux_i386 only when the host is 32-bit; otherwise, it uses the RegisterContextLinux_x86_64, which works properly for 32-bit and 64-bit inferiors on a 64-bit host. I tested this debugging a Linux x86 exe on an x86 host (Ubuntu 13.10 x86), and debugging a Linux x86 exe and a Linux x86-64 exe on an x86-64 host (Ubuntu 12.04 LTS). Those cases all worked. Thanks to Matthew Gardiner who discoverd may key insights into tracking down the issue. The motivation for this change and some of the code originates from him via this thread: http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140224/010554.html llvm-svn: 202428
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp')
-rw-r--r--lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
index 0591a0d5755..36795e584cf 100644
--- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
+++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
@@ -168,9 +168,9 @@ PtraceWrapper(int req, lldb::pid_t pid, void *addr, void *data, size_t data_size
errno = 0;
if (req == PTRACE_GETREGSET || req == PTRACE_SETREGSET)
- result = ptrace(static_cast<__ptrace_request>(req), pid, *(unsigned int *)addr, data);
+ result = ptrace(static_cast<__ptrace_request>(req), static_cast<pid_t>(pid), *(unsigned int *)addr, data);
else
- result = ptrace(static_cast<__ptrace_request>(req), pid, addr, data);
+ result = ptrace(static_cast<__ptrace_request>(req), static_cast<pid_t>(pid), addr, data);
if (log)
log->Printf("ptrace(%s, %" PRIu64 ", %p, %p, %zu)=%lX called from file %s line %d",
OpenPOWER on IntegriCloud