diff options
-rw-r--r-- | breakpad/linux/dump_symbols.cc | 2 | ||||
-rw-r--r-- | breakpad/linux/linux_dumper.cc | 4 | ||||
-rw-r--r-- | breakpad/linux/linux_dumper.h | 4 | ||||
-rw-r--r-- | breakpad/linux/memory.h | 5 | ||||
-rw-r--r-- | breakpad/linux/minidump_writer.cc | 8 | ||||
-rw-r--r-- | chrome/app/breakpad_linux.cc | 10 | ||||
-rw-r--r-- | chrome/app/breakpad_linux.h | 6 |
7 files changed, 24 insertions, 15 deletions
diff --git a/breakpad/linux/dump_symbols.cc b/breakpad/linux/dump_symbols.cc index 2ad4bff..49b70e5 100644 --- a/breakpad/linux/dump_symbols.cc +++ b/breakpad/linux/dump_symbols.cc @@ -147,7 +147,7 @@ static std::string Demangle(const char* mangled) { // Fix offset into virtual address by adding the mapped base into offsets. // Make life easier when want to find something by offset. static void FixAddress(void* obj_base) { - ElfW(Word) base = reinterpret_cast<ElfW(Word)>(obj_base); + ElfW(Addr) base = reinterpret_cast<ElfW(Addr)>(obj_base); ElfW(Ehdr)* elf_header = static_cast<ElfW(Ehdr)* >(obj_base); elf_header->e_phoff += base; elf_header->e_shoff += base; diff --git a/breakpad/linux/linux_dumper.cc b/breakpad/linux/linux_dumper.cc index 3dc64db..7b6ab23 100644 --- a/breakpad/linux/linux_dumper.cc +++ b/breakpad/linux/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/breakpad/linux/linux_dumper.h b/breakpad/linux/linux_dumper.h index ac4a470..0986e7b 100644 --- a/breakpad/linux/linux_dumper.h +++ b/breakpad/linux/linux_dumper.h @@ -64,9 +64,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]; #endif diff --git a/breakpad/linux/memory.h b/breakpad/linux/memory.h index e6947a1..94e2175 100644 --- a/breakpad/linux/memory.h +++ b/breakpad/linux/memory.h @@ -86,8 +86,13 @@ class PageAllocator { private: uint8_t *GetNPages(unsigned num_pages) { +#ifdef __x86_64 + void *a = sys_mmap(NULL, page_size_ * num_pages, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); +#else void *a = sys_mmap2(NULL, page_size_ * num_pages, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); +#endif if (a == MAP_FAILED) return NULL; diff --git a/breakpad/linux/minidump_writer.cc b/breakpad/linux/minidump_writer.cc index 0f463f0..ac6a9aa 100644 --- a/breakpad/linux/minidump_writer.cc +++ b/breakpad/linux/minidump_writer.cc @@ -238,21 +238,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; @@ -292,7 +292,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); } diff --git a/chrome/app/breakpad_linux.cc b/chrome/app/breakpad_linux.cc index c5dd0d3..b23a5d7 100644 --- a/chrome/app/breakpad_linux.cc +++ b/chrome/app/breakpad_linux.cc @@ -534,17 +534,17 @@ extern std::string active_url; static bool RendererCrashHandler(const void* crash_context, size_t crash_context_size, void* context) { - const int fd = reinterpret_cast<int>(context); + const int fd = reinterpret_cast<intptr_t>(context); int fds[2]; socketpair(AF_UNIX, SOCK_STREAM, 0, fds); char guid[kGuidSize] = {0}; char crash_url[kMaxActiveURLSize + 1] = {0}; char distro[kDistroSize + 1] = {0}; - const unsigned guid_len = std::min(google_update::linux_guid.size(), - kGuidSize); - const unsigned crash_url_len = + const size_t guid_len = std::min(google_update::linux_guid.size(), + kGuidSize); + const size_t crash_url_len = std::min(child_process_logging::active_url.size(), kMaxActiveURLSize); - const unsigned distro_len = + const size_t distro_len = std::min(base::linux_distro.size(), kDistroSize); memcpy(guid, google_update::linux_guid.data(), guid_len); memcpy(crash_url, child_process_logging::active_url.data(), crash_url_len); diff --git a/chrome/app/breakpad_linux.h b/chrome/app/breakpad_linux.h index 0c3ccde..d06c9a2 100644 --- a/chrome/app/breakpad_linux.h +++ b/chrome/app/breakpad_linux.h @@ -10,9 +10,9 @@ extern void InitCrashReporter(); #if defined(GOOGLE_CHROME_BUILD) -static const unsigned kMaxActiveURLSize = 1024; -static const unsigned kGuidSize = 32; // 128 bits = 32 chars in hex. -static const unsigned kDistroSize = 128; +static const size_t kMaxActiveURLSize = 1024; +static const size_t kGuidSize = 32; // 128 bits = 32 chars in hex. +static const size_t kDistroSize = 128; struct BreakpadInfo { const char* filename; |