Allow building of minidump stackwalker on Android

This commit is contained in:
Aaron Culliney 2015-09-20 11:44:14 -07:00
parent 05e83a7800
commit 68be39de6b
4 changed files with 55 additions and 0 deletions

View File

@ -94,6 +94,49 @@ LOCAL_SRC_FILES := \
src/common/linux/memory_mapped_file.cc \ src/common/linux/memory_mapped_file.cc \
src/common/linux/safe_readlink.cc src/common/linux/safe_readlink.cc
# Embedded stackwalker sources (to be able to process crashes in-situ on Android device)
ifeq ($(EMBEDDED_STACKWALKER),1)
LOCAL_CPPFLAGS += -DEMBEDDED_STACKWALKER=1 -frtti
LOCAL_SRC_FILES += \
src/processor/basic_code_modules.cc \
src/processor/basic_source_line_resolver.cc \
src/processor/call_stack.cc \
src/processor/cfi_frame_info.cc \
src/processor/disassembler_x86.cc \
src/processor/dump_context.cc \
src/processor/dump_object.cc \
src/processor/exploitability.cc \
src/processor/exploitability_linux.cc \
src/processor/fast_source_line_resolver.cc \
src/processor/logging.cc \
src/processor/microdump.cc \
src/processor/microdump_processor.cc \
src/processor/microdump_stackwalk.cc \
src/processor/minidump.cc \
src/processor/minidump_dump.cc \
src/processor/minidump_processor.cc \
src/processor/minidump_stackwalk.cc \
src/processor/module_comparer.cc \
src/processor/module_serializer.cc \
src/processor/pathname_stripper.cc \
src/processor/process_state.cc \
src/processor/proc_maps_linux.cc \
src/processor/simple_symbol_supplier.cc \
src/processor/source_line_resolver_base.cc \
src/processor/stack_frame_cpu.cc \
src/processor/stack_frame_symbolizer.cc \
src/processor/stackwalk_common.cc \
src/processor/stackwalker_address_list.cc \
src/processor/stackwalker_amd64.cc \
src/processor/stackwalker_arm64.cc \
src/processor/stackwalker_arm.cc \
src/processor/stackwalker.cc \
src/processor/stackwalker_mips.cc \
src/processor/stackwalker_x86.cc \
src/processor/synth_minidump.cc \
src/processor/tokenize.cc
endif
LOCAL_C_INCLUDES := $(LOCAL_PATH)/src/common/android/include \ LOCAL_C_INCLUDES := $(LOCAL_PATH)/src/common/android/include \
$(LOCAL_PATH)/src $(LOCAL_PATH)/src

View File

@ -41,7 +41,9 @@
#include "google_breakpad/processor/minidump.h" #include "google_breakpad/processor/minidump.h"
#include "google_breakpad/processor/process_state.h" #include "google_breakpad/processor/process_state.h"
#include "processor/exploitability_linux.h" #include "processor/exploitability_linux.h"
#if !defined(__ANDROID__)
#include "processor/exploitability_win.h" #include "processor/exploitability_win.h"
#endif
#include "processor/logging.h" #include "processor/logging.h"
namespace google_breakpad { namespace google_breakpad {
@ -76,11 +78,13 @@ Exploitability *Exploitability::ExploitabilityForPlatform(
return NULL; return NULL;
switch (raw_system_info->platform_id) { switch (raw_system_info->platform_id) {
#if !defined(__ANDROID__)
case MD_OS_WIN32_NT: case MD_OS_WIN32_NT:
case MD_OS_WIN32_WINDOWS: { case MD_OS_WIN32_WINDOWS: {
platform_exploitability = new ExploitabilityWin(dump, process_state); platform_exploitability = new ExploitabilityWin(dump, process_state);
break; break;
} }
#endif
case MD_OS_LINUX: { case MD_OS_LINUX: {
platform_exploitability = new ExploitabilityLinux(dump, platform_exploitability = new ExploitabilityLinux(dump,
process_state, process_state,

View File

@ -999,6 +999,7 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
break; break;
} }
#if !defined(__ANDROID__)
case MD_OS_WIN32_NT: case MD_OS_WIN32_NT:
case MD_OS_WIN32_WINDOWS: { case MD_OS_WIN32_WINDOWS: {
switch (exception_code) { switch (exception_code) {
@ -1162,6 +1163,7 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
} }
break; break;
} }
#endif
case MD_OS_ANDROID: case MD_OS_ANDROID:
case MD_OS_LINUX: { case MD_OS_LINUX: {

View File

@ -47,9 +47,11 @@
#include "google_breakpad/processor/system_info.h" #include "google_breakpad/processor/system_info.h"
#include "processor/linked_ptr.h" #include "processor/linked_ptr.h"
#include "processor/logging.h" #include "processor/logging.h"
#if !defined(__ANDROID__)
#include "processor/stackwalker_ppc.h" #include "processor/stackwalker_ppc.h"
#include "processor/stackwalker_ppc64.h" #include "processor/stackwalker_ppc64.h"
#include "processor/stackwalker_sparc.h" #include "processor/stackwalker_sparc.h"
#endif
#include "processor/stackwalker_x86.h" #include "processor/stackwalker_x86.h"
#include "processor/stackwalker_amd64.h" #include "processor/stackwalker_amd64.h"
#include "processor/stackwalker_arm.h" #include "processor/stackwalker_arm.h"
@ -209,6 +211,7 @@ Stackwalker* Stackwalker::StackwalkerForCPU(
memory, modules, frame_symbolizer); memory, modules, frame_symbolizer);
break; break;
#if !defined(__ANDROID__)
case MD_CONTEXT_PPC: case MD_CONTEXT_PPC:
cpu_stackwalker = new StackwalkerPPC(system_info, cpu_stackwalker = new StackwalkerPPC(system_info,
context->GetContextPPC(), context->GetContextPPC(),
@ -220,6 +223,7 @@ Stackwalker* Stackwalker::StackwalkerForCPU(
context->GetContextPPC64(), context->GetContextPPC64(),
memory, modules, frame_symbolizer); memory, modules, frame_symbolizer);
break; break;
#endif
case MD_CONTEXT_AMD64: case MD_CONTEXT_AMD64:
cpu_stackwalker = new StackwalkerAMD64(system_info, cpu_stackwalker = new StackwalkerAMD64(system_info,
@ -227,11 +231,13 @@ Stackwalker* Stackwalker::StackwalkerForCPU(
memory, modules, frame_symbolizer); memory, modules, frame_symbolizer);
break; break;
#if !defined(__ANDROID__)
case MD_CONTEXT_SPARC: case MD_CONTEXT_SPARC:
cpu_stackwalker = new StackwalkerSPARC(system_info, cpu_stackwalker = new StackwalkerSPARC(system_info,
context->GetContextSPARC(), context->GetContextSPARC(),
memory, modules, frame_symbolizer); memory, modules, frame_symbolizer);
break; break;
#endif
case MD_CONTEXT_MIPS: case MD_CONTEXT_MIPS:
cpu_stackwalker = new StackwalkerMIPS(system_info, cpu_stackwalker = new StackwalkerMIPS(system_info,