Change the 64 bit map address format.
Previously, the map printing in tombstones for 64 bit devices uses
a variable length value. This means that the maps are not lined up.
The new format is to print the map as 00000000'00000000 in all ways.
Also fix a bug where the backtrace_map_t did not initialize all
parameters.
Add unit tests for all of the dump_all_maps function.
Bug: 20950813
(cherry picked from commit 862fe029190b6d8344889988fb85526e64b2f4b7)
Change-Id: Ife5c48bddeb19006a98f9e87520474e97b97f6d9
diff --git a/debuggerd/Android.mk b/debuggerd/Android.mk
index 1a5f05e..6cfb541 100644
--- a/debuggerd/Android.mk
+++ b/debuggerd/Android.mk
@@ -75,46 +75,55 @@
include $(BUILD_EXECUTABLE)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
+debuggerd_test_src_files := \
utility.cpp \
+ test/dump_maps_test.cpp \
test/dump_memory_test.cpp \
+ test/elf_fake.cpp \
test/log_fake.cpp \
+ test/property_fake.cpp \
+ test/ptrace_fake.cpp \
+ test/selinux_fake.cpp \
-LOCAL_MODULE := debuggerd_test
-
-LOCAL_SHARED_LIBRARIES := \
+debuggerd_shared_libraries := \
libbacktrace \
libbase \
+ libcutils \
-LOCAL_C_INCLUDES += $(LOCAL_PATH)/test
-LOCAL_CPPFLAGS := $(common_cppflags)
+debuggerd_c_includes := \
+ $(LOCAL_PATH)/test \
+
+debuggerd_cpp_flags := \
+ $(common_cppflags) \
+ -Wno-missing-field-initializers \
+
+# Only build the host tests on linux.
+ifeq ($(HOST_OS),linux)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := debuggerd_test
+LOCAL_SRC_FILES := $(debuggerd_test_src_files)
+LOCAL_SHARED_LIBRARIES := $(debuggerd_shared_libraries)
+LOCAL_C_INCLUDES := $(debuggerd_c_includes)
+LOCAL_CPPFLAGS := $(debuggerd_cpp_flags)
LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
LOCAL_MULTILIB := both
-
include $(BUILD_HOST_NATIVE_TEST)
+endif
+
include $(CLEAR_VARS)
-LOCAL_SRC_FILES := \
- utility.cpp \
- test/dump_memory_test.cpp \
- test/log_fake.cpp \
-
LOCAL_MODULE := debuggerd_test
-
-LOCAL_SHARED_LIBRARIES := \
- libbacktrace \
- libbase \
-
-LOCAL_C_INCLUDES += $(LOCAL_PATH)/test
-LOCAL_CPPFLAGS := $(common_cppflags)
+LOCAL_SRC_FILES := $(debuggerd_test_src_files)
+LOCAL_SHARED_LIBRARIES := $(debuggerd_shared_libraries)
+LOCAL_C_INCLUDES := $(debuggerd_c_includes)
+LOCAL_CPPFLAGS := $(debuggerd_cpp_flags)
LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
LOCAL_MULTILIB := both
-
include $(BUILD_NATIVE_TEST)