aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authornealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e>2009-12-01 21:35:52 +0000
committernealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e>2009-12-01 21:35:52 +0000
commit096992fac73756cfa0974a94754329f30fd4e786 (patch)
treec38f1e56f91e8f167b9e5012662f31fc2da434aa /src/client
parentdon't output duplicate filenames in PDBSourceLineWriter. r=mark at http://bre... (diff)
downloadbreakpad-096992fac73756cfa0974a94754329f30fd4e786.tar.xz
Upstreaming several patches from Chrome:
Build fix for systems where sys/user.h needs sys/types.h.... http://breakpad.appspot.com/40002 MDRawSystemInfo.processor_level refers to the CPU family, not the cpuid level.. http://breakpad.appspot.com/40003 Use MD_MODULE_SIZE in place of sizeof(MDRawModule). http://breakpad.appspot.com/39003 Linux x64 compile fix. http://breakpad.appspot.com/40004 Include linux_syscall_support.h to get definition of NT_PRXFPREG. This is Chromium commit 23659. http://breakpad.appspot.com/40005 Build breakpad / crash reporting on Linux 64-bit. This is Chromium commit 23396. http://breakpad.appspot.com/40006 Fix #includes in a couple unit tests. http://breakpad.appspot.com/41001 Clean up unused headers / files for Linux dump_syms. http://breakpad.appspot.com/40002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@432 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client')
-rw-r--r--src/client/linux/handler/exception_handler_unittest.cc4
-rw-r--r--src/client/linux/minidump_writer/linux_dumper.cc4
-rw-r--r--src/client/linux/minidump_writer/linux_dumper.h8
-rw-r--r--src/client/linux/minidump_writer/minidump_writer.cc16
4 files changed, 19 insertions, 13 deletions
diff --git a/src/client/linux/handler/exception_handler_unittest.cc b/src/client/linux/handler/exception_handler_unittest.cc
index 157c495a..2f4e1045 100644
--- a/src/client/linux/handler/exception_handler_unittest.cc
+++ b/src/client/linux/handler/exception_handler_unittest.cc
@@ -84,7 +84,7 @@ static bool DoneCallback(const char* dump_path,
if (!succeeded)
return succeeded;
- int fd = (int) context;
+ int fd = (intptr_t) context;
uint32_t len = my_strlen(minidump_id);
HANDLE_EINTR(sys_write(fd, &len, sizeof(len)));
HANDLE_EINTR(sys_write(fd, minidump_id, len));
@@ -143,7 +143,7 @@ static const unsigned kControlMsgSize =
static bool
CrashHandler(const void* crash_context, size_t crash_context_size,
void* context) {
- const int fd = (int) context;
+ const int fd = (intptr_t) context;
int fds[2];
pipe(fds);
diff --git a/src/client/linux/minidump_writer/linux_dumper.cc b/src/client/linux/minidump_writer/linux_dumper.cc
index e821db7d..86ebb866 100644
--- a/src/client/linux/minidump_writer/linux_dumper.cc
+++ b/src/client/linux/minidump_writer/linux_dumper.cc
@@ -316,10 +316,12 @@ bool LinuxDumper::ThreadInfoGet(pid_t tid, ThreadInfo* info) {
return false;
}
-#if defined(__i386) || defined(__x86_64)
+#if defined(__i386)
if (sys_ptrace(PTRACE_GETFPXREGS, tid, NULL, &info->fpxregs) == -1)
return false;
+#endif
+#if defined(__i386) || defined(__x86_64)
for (unsigned i = 0; i < ThreadInfo::kNumDebugRegisters; ++i) {
if (sys_ptrace(
PTRACE_PEEKUSER, tid,
diff --git a/src/client/linux/minidump_writer/linux_dumper.h b/src/client/linux/minidump_writer/linux_dumper.h
index 252e9ee6..d8e5e783 100644
--- a/src/client/linux/minidump_writer/linux_dumper.h
+++ b/src/client/linux/minidump_writer/linux_dumper.h
@@ -31,9 +31,10 @@
#define CLIENT_LINUX_MINIDUMP_WRITER_LINUX_DUMPER_H_
#include <elf.h>
+#include <linux/limits.h>
#include <stdint.h>
+#include <sys/types.h>
#include <sys/user.h>
-#include <linux/limits.h>
#include "common/linux/memory.h"
@@ -64,8 +65,11 @@ struct ThreadInfo {
user_regs_struct regs;
user_fpregs_struct fpregs;
-#if defined(__i386) || defined(__x86_64)
+#if defined(__i386)
user_fpxregs_struct fpxregs;
+#endif
+
+#if defined(__i386) || defined(__x86_64)
static const unsigned kNumDebugRegisters = 8;
debugreg_t dregs[8];
diff --git a/src/client/linux/minidump_writer/minidump_writer.cc b/src/client/linux/minidump_writer/minidump_writer.cc
index a99309f3..10041f77 100644
--- a/src/client/linux/minidump_writer/minidump_writer.cc
+++ b/src/client/linux/minidump_writer/minidump_writer.cc
@@ -248,21 +248,21 @@ static void CPUFillFromThreadInfo(MDRawContextAMD64 *out,
out->flt_save.control_word = info.fpregs.cwd;
out->flt_save.status_word = info.fpregs.swd;
- out->flt_save.tag_word = info.fpregs.twd;
+ out->flt_save.tag_word = info.fpregs.ftw;
out->flt_save.error_opcode = info.fpregs.fop;
out->flt_save.error_offset = info.fpregs.rip;
out->flt_save.error_selector = 0; // We don't have this.
out->flt_save.data_offset = info.fpregs.rdp;
out->flt_save.data_selector = 0; // We don't have this.
out->flt_save.mx_csr = info.fpregs.mxcsr;
- out->flt_save.mx_csr_mask = info.fpregs.mxcsr_mask;
+ out->flt_save.mx_csr_mask = info.fpregs.mxcr_mask;
memcpy(&out->flt_save.float_registers, &info.fpregs.st_space, 8 * 16);
memcpy(&out->flt_save.xmm_registers, &info.fpregs.xmm_space, 16 * 16);
}
static void CPUFillFromUContext(MDRawContextAMD64 *out, const ucontext *uc,
const struct _libc_fpstate* fpregs) {
- const greg_t* regs = uc->gregs;
+ const greg_t* regs = uc->uc_mcontext.gregs;
out->context_flags = MD_CONTEXT_AMD64_FULL;
@@ -302,7 +302,7 @@ static void CPUFillFromUContext(MDRawContextAMD64 *out, const ucontext *uc,
out->flt_save.error_selector = 0; // We don't have this.
out->flt_save.data_selector = 0; // We don't have this.
out->flt_save.mx_csr = fpregs->mxcsr;
- out->flt_save.mx_csr_mask = fpregs->mxcsr_mask;
+ out->flt_save.mx_csr_mask = fpregs->mxcr_mask;
memcpy(&out->flt_save.float_registers, &fpregs->_st, 8 * 16);
memcpy(&out->flt_save.xmm_registers, &fpregs->_xmm, 16 * 16);
}
@@ -510,7 +510,7 @@ class MinidumpWriter {
}
TypedMDRVA<uint32_t> list(&minidump_writer_);
- if (!list.AllocateObjectAndArray(num_output_mappings, sizeof(MDRawModule)))
+ if (!list.AllocateObjectAndArray(num_output_mappings, MD_MODULE_SIZE))
return false;
dirent->stream_type = MD_MODULE_LIST_STREAM;
@@ -523,7 +523,7 @@ class MinidumpWriter {
continue;
MDRawModule mod;
- my_memset(&mod, 0, sizeof(mod));
+ my_memset(&mod, 0, MD_MODULE_SIZE);
mod.base_of_image = mapping.start_addr;
mod.size_of_image = mapping.size;
const size_t filepath_len = my_strlen(mapping.name);
@@ -579,7 +579,7 @@ class MinidumpWriter {
return false;
mod.module_name_rva = ld.rva;
- list.CopyIndexAfterObject(j++, &mod, sizeof(mod));
+ list.CopyIndexAfterObject(j++, &mod, MD_MODULE_SIZE);
}
return true;
@@ -650,7 +650,7 @@ class MinidumpWriter {
{ "processor", -1, false },
{ "model", 0, false },
{ "stepping", 0, false },
- { "cpuid level", 0, false },
+ { "cpu family", 0, false },
};
// processor_architecture should always be set, do this first