summaryrefslogtreecommitdiffstats
path: root/breakpad/linux
diff options
context:
space:
mode:
authordeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-14 00:02:04 +0000
committerdeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-14 00:02:04 +0000
commit4cc7027434204784572b44dd0546678d560f2d61 (patch)
tree9122c191a7a09786526f7dc17bb7136d0bea1a55 /breakpad/linux
parent5e26030d358f16265cf80d3ed387ed51d0d1abec (diff)
downloadchromium_src-4cc7027434204784572b44dd0546678d560f2d61.zip
chromium_src-4cc7027434204784572b44dd0546678d560f2d61.tar.gz
chromium_src-4cc7027434204784572b44dd0546678d560f2d61.tar.bz2
Build breakpad / crash reporting on Linux 64-bit.
Review URL: http://codereview.chromium.org/165493 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23396 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'breakpad/linux')
-rw-r--r--breakpad/linux/dump_symbols.cc2
-rw-r--r--breakpad/linux/linux_dumper.cc4
-rw-r--r--breakpad/linux/linux_dumper.h4
-rw-r--r--breakpad/linux/memory.h5
-rw-r--r--breakpad/linux/minidump_writer.cc8
5 files changed, 16 insertions, 7 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);
}