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
This commit is contained in:
nealsid 2009-12-01 21:35:52 +00:00
parent 873064894b
commit 096992fac7
10 changed files with 32 additions and 29 deletions

View file

@ -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);

View file

@ -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,

View file

@ -31,9 +31,10 @@
#define CLIENT_LINUX_MINIDUMP_WRITER_LINUX_DUMPER_H_
#include <elf.h>
#include <stdint.h>
#include <sys/user.h>
#include <linux/limits.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/user.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];

View file

@ -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