Fix ptrace log on i386 and include return value

Patch by Matthew Gardiner

llvm-svn: 202036
This commit is contained in:
Ed Maste 2014-02-24 14:07:45 +00:00
parent c523dcff29
commit c099c958bc
1 changed files with 4 additions and 4 deletions

View File

@ -164,10 +164,6 @@ PtraceWrapper(int req, lldb::pid_t pid, void *addr, void *data, size_t data_size
Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_PTRACE)); Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_PTRACE));
if (log)
log->Printf("ptrace(%s, %lu, %p, %p, %zu) called from file %s line %d",
reqName, pid, addr, data, data_size, file, line);
PtraceDisplayBytes(req, data, data_size); PtraceDisplayBytes(req, data, data_size);
errno = 0; errno = 0;
@ -176,6 +172,10 @@ PtraceWrapper(int req, lldb::pid_t pid, void *addr, void *data, size_t data_size
else else
result = ptrace(static_cast<__ptrace_request>(req), pid, addr, data); result = ptrace(static_cast<__ptrace_request>(req), pid, addr, data);
if (log)
log->Printf("ptrace(%s, %" PRIu64 ", %p, %p, %zu)=%lX called from file %s line %d",
reqName, pid, addr, data, data_size, result, file, line);
PtraceDisplayBytes(req, data, data_size); PtraceDisplayBytes(req, data, data_size);
if (log && errno != 0) if (log && errno != 0)