From cb2e67fdb7c57df3f754fbcf00c007397a631223 Mon Sep 17 00:00:00 2001 From: Steve Fung Date: Thu, 24 Sep 2015 01:40:52 -0700 Subject: [PATCH] Generate breakpad symbols When BREAKPAD_GENERATE_SYMBOLS is set to true, generate breakpad symbols for binaries. Bug: 23900817 Change-Id: I7b992d819350f4f80df5868d16f13016502dfca0 --- core/config.mk | 6 ++++++ core/dynamic_binary.mk | 15 +++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/core/config.mk b/core/config.mk index a7517f3795..12308fd671 100644 --- a/core/config.mk +++ b/core/config.mk @@ -423,6 +423,12 @@ YASM := prebuilts/misc/$(BUILD_OS)-$(HOST_PREBUILT_ARCH)/yasm/yasm DOXYGEN:= doxygen AAPT := $(HOST_OUT_EXECUTABLES)/aapt$(HOST_EXECUTABLE_SUFFIX) AIDL := $(HOST_OUT_EXECUTABLES)/aidl$(HOST_EXECUTABLE_SUFFIX) +ifeq ($(HOST_OS),linux) +BREAKPAD_DUMP_SYMS := $(HOST_OUT_EXECUTABLES)/dump_syms +else +# For non-supported hosts, do not generate breakpad symbols. +BREAKPAD_GENERATE_SYMBOLS := false +endif PROTOC := $(HOST_OUT_EXECUTABLES)/aprotoc$(HOST_EXECUTABLE_SUFFIX) DBUS_GENERATOR := $(HOST_OUT_EXECUTABLES)/dbus-binding-generator SIGNAPK_JAR := $(HOST_OUT_JAVA_LIBRARIES)/signapk$(COMMON_JAVA_PACKAGE_SUFFIX) diff --git a/core/dynamic_binary.mk b/core/dynamic_binary.mk index 38c0cbee89..240415d767 100644 --- a/core/dynamic_binary.mk +++ b/core/dynamic_binary.mk @@ -86,6 +86,20 @@ $(symbolic_output) : $(symbolic_input) | $(ACP) @echo "target Symbolic: $(PRIVATE_MODULE) ($@)" $(copy-file-to-target) +########################################################### +## Store breakpad symbols +########################################################### + +ifeq ($(BREAKPAD_GENERATE_SYMBOLS),true) +my_breakpad_path := $(PRODUCT_OUT)/breakpad/$(patsubst $(PRODUCT_OUT)/%,%,$(my_module_path)) +breakpad_input := $(relocation_packer_output) +breakpad_output := $(my_breakpad_path)/$(my_installed_module_stem).sym +$(breakpad_output) : $(breakpad_input) | $(BREAKPAD_DUMP_SYMS) + @echo "target breakpad: $(PRIVATE_MODULE) ($@)" + @mkdir -p $(dir $@) + $(hide) $(BREAKPAD_DUMP_SYMS) -c $< > $@ +$(LOCAL_BUILT_MODULE) : $(breakpad_output) +endif ########################################################### ## Strip @@ -143,5 +157,6 @@ endif # my_strip_module $(cleantarget): PRIVATE_CLEAN_FILES += \ $(linked_module) \ + $(breakpad_output) \ $(symbolic_output) \ $(strip_output)