From 4f291f0307ae6f33f70f578cbcd4450923692412 Mon Sep 17 00:00:00 2001 From: "mark@chromium.org" Date: Tue, 3 Apr 2012 16:38:53 +0000 Subject: Changes to get the breakpad client compiling and running on Android using ndk-7b. Patch by Carlos Valdivia Review URL: https://breakpad.appspot.com/363001/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@945 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/common/dwarf_cu_to_module.cc | 6 +++++- src/common/linux/file_id.cc | 3 ++- src/common/linux/memory_mapped_file.cc | 8 +++++++- 3 files changed, 14 insertions(+), 3 deletions(-) (limited to 'src/common') diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index 2a8b76ba..e3100a12 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -440,7 +440,11 @@ void DwarfCUToModule::FuncHandler::Finish() { func->address = low_pc_; func->size = high_pc_ - low_pc_; func->parameter_size = 0; - cu_context_->functions.push_back(func); + if (func->address) { + // If the function address is zero this is a sign that this function + // description is just empty debug data and should just be discarded. + cu_context_->functions.push_back(func); + } } else if (inline_) { AbstractOrigin origin(name_); cu_context_->file_context->file_private->origins[offset_] = origin; diff --git a/src/common/linux/file_id.cc b/src/common/linux/file_id.cc index bffef621..ff2f29e2 100644 --- a/src/common/linux/file_id.cc +++ b/src/common/linux/file_id.cc @@ -36,10 +36,11 @@ #include #include -#include #if defined(__ANDROID__) +#include #include "client/linux/android_link.h" #else +#include #include #endif #include diff --git a/src/common/linux/memory_mapped_file.cc b/src/common/linux/memory_mapped_file.cc index 6f450bd3..32fc3b18 100644 --- a/src/common/linux/memory_mapped_file.cc +++ b/src/common/linux/memory_mapped_file.cc @@ -34,6 +34,9 @@ #include #include +#if defined(__ANDROID__) +#include +#endif #include #include "common/memory_range.h" @@ -59,7 +62,10 @@ bool MemoryMappedFile::Map(const char* path) { return false; } -#if defined(__x86_64__) +#if defined(__ANDROID__) + struct stat st; + if (fstat(fd, &st) != 0) { +#elif defined(__x86_64__) struct kernel_stat st; if (sys_fstat(fd, &st) == -1 || st.st_size < 0) { #else -- cgit v1.2.1