Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d716a45f authored by Yabin Cui's avatar Yabin Cui Committed by Android Git Automerger
Browse files

am 27b455bb: am 00ea49fc: Merge "Revert "Revert "Revert "Add BacktraceOffline...

am 27b455bb: am 00ea49fc: Merge "Revert "Revert "Revert "Add BacktraceOffline for offline backtracing.""""

* commit '27b455bb':
  Revert "Revert "Revert "Add BacktraceOffline for offline backtracing."""
parents 3cbc7e7e 27b455bb
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -99,7 +99,6 @@ debuggerd_c_includes := \
debuggerd_cpp_flags := \
debuggerd_cpp_flags := \
    $(common_cppflags) \
    $(common_cppflags) \
    -Wno-missing-field-initializers \
    -Wno-missing-field-initializers \
    -fno-rtti \


# Only build the host tests on linux.
# Only build the host tests on linux.
ifeq ($(HOST_OS),linux)
ifeq ($(HOST_OS),linux)
+0 −14
Original line number Original line Diff line number Diff line
@@ -52,12 +52,6 @@ struct ucontext;
typedef ucontext ucontext_t;
typedef ucontext ucontext_t;
#endif
#endif


struct backtrace_stackinfo_t {
  uint64_t start;
  uint64_t end;
  const uint8_t* data;
};

class Backtrace {
class Backtrace {
public:
public:
  // Create the correct Backtrace object based on what is to be unwound.
  // Create the correct Backtrace object based on what is to be unwound.
@@ -72,14 +66,6 @@ public:
  // If map is not NULL, the map is still owned by the caller.
  // If map is not NULL, the map is still owned by the caller.
  static Backtrace* Create(pid_t pid, pid_t tid, BacktraceMap* map = NULL);
  static Backtrace* Create(pid_t pid, pid_t tid, BacktraceMap* map = NULL);


  // Create an offline Backtrace object that can be used to do an unwind without a process
  // that is still running. If cache_file is set to true, then elf information will be cached
  // for this call. The cached information survives until the calling process ends. This means
  // that subsequent calls to create offline Backtrace objects will continue to use the same
  // cache. It also assumes that the elf files used for each offline unwind are the same.
  static Backtrace* CreateOffline(pid_t pid, pid_t tid, BacktraceMap* map,
                                  const backtrace_stackinfo_t& stack, bool cache_file = false);

  virtual ~Backtrace();
  virtual ~Backtrace();


  // Get the current stack trace and store in the backtrace_ structure.
  // Get the current stack trace and store in the backtrace_ structure.
+0 −3
Original line number Original line Diff line number Diff line
@@ -31,7 +31,6 @@


#include <deque>
#include <deque>
#include <string>
#include <string>
#include <vector>


struct backtrace_map_t {
struct backtrace_map_t {
  uintptr_t start = 0;
  uintptr_t start = 0;
@@ -49,8 +48,6 @@ public:
  // is unsupported.
  // is unsupported.
  static BacktraceMap* Create(pid_t pid, bool uncached = false);
  static BacktraceMap* Create(pid_t pid, bool uncached = false);


  static BacktraceMap* Create(pid_t pid, const std::vector<backtrace_map_t>& maps);

  virtual ~BacktraceMap();
  virtual ~BacktraceMap();


  // Fill in the map data structure for the given address.
  // Fill in the map data structure for the given address.
+0 −4
Original line number Original line Diff line number Diff line
@@ -69,10 +69,7 @@ LOCAL_LDLIBS := \
    $($(module)_ldlibs) \
    $($(module)_ldlibs) \
    $($(module)_ldlibs_$(build_type)) \
    $($(module)_ldlibs_$(build_type)) \


LOCAL_STRIP_MODULE := $($(module)_strip_module)

ifeq ($(build_type),target)
ifeq ($(build_type),target)
  include $(LLVM_DEVICE_BUILD_MK)
  include $(BUILD_$(build_target))
  include $(BUILD_$(build_target))
endif
endif


@@ -80,7 +77,6 @@ ifeq ($(build_type),host)
  # Only build if host builds are supported.
  # Only build if host builds are supported.
  ifeq ($(build_host),true)
  ifeq ($(build_host),true)
    LOCAL_CFLAGS += -Wno-extern-c-compat -fno-omit-frame-pointer
    LOCAL_CFLAGS += -Wno-extern-c-compat -fno-omit-frame-pointer
    include $(LLVM_HOST_BUILD_MK)
    include $(BUILD_HOST_$(build_target))
    include $(BUILD_HOST_$(build_target))
  endif
  endif
endif
endif
+0 −25
Original line number Original line Diff line number Diff line
@@ -25,7 +25,6 @@ libbacktrace_common_conlyflags := \


libbacktrace_common_cppflags := \
libbacktrace_common_cppflags := \
	-std=gnu++11 \
	-std=gnu++11 \
	-I external/libunwind/include/tdep \


# The latest clang (r230699) does not allow SP/PC to be declared in inline asm lists.
# The latest clang (r230699) does not allow SP/PC to be declared in inline asm lists.
libbacktrace_common_clang_cflags += \
libbacktrace_common_clang_cflags += \
@@ -38,9 +37,6 @@ build_host := true
endif
endif
endif
endif


LLVM_ROOT_PATH := external/llvm
include $(LLVM_ROOT_PATH)/llvm.mk

#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
# The libbacktrace library.
# The libbacktrace library.
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
@@ -48,7 +44,6 @@ libbacktrace_src_files := \
	Backtrace.cpp \
	Backtrace.cpp \
	BacktraceCurrent.cpp \
	BacktraceCurrent.cpp \
	BacktraceMap.cpp \
	BacktraceMap.cpp \
	BacktraceOffline.cpp \
	BacktracePtrace.cpp \
	BacktracePtrace.cpp \
	thread_utils.c \
	thread_utils.c \
	ThreadEntry.cpp \
	ThreadEntry.cpp \
@@ -61,20 +56,6 @@ libbacktrace_shared_libraries := \
	liblog \
	liblog \
	libunwind \
	libunwind \


# Use shared llvm library on device to save space.
libbacktrace_shared_libraries_target := \
	libLLVM \

# Use static llvm libraries on host to remove dependency on 32-bit llvm shared library
# which is not included in the prebuilt.
libbacktrace_static_libraries_host := \
	libLLVMObject \
	libLLVMBitReader \
	libLLVMMC \
	libLLVMMCParser \
	libLLVMCore \
	libLLVMSupport \

libbacktrace_ldlibs_host := \
libbacktrace_ldlibs_host := \
	-lpthread \
	-lpthread \
	-lrt \
	-lrt \
@@ -105,8 +86,6 @@ libbacktrace_test_cflags := \
libbacktrace_test_src_files := \
libbacktrace_test_src_files := \
	backtrace_testlib.c \
	backtrace_testlib.c \


libbacktrace_test_strip_module := false

module := libbacktrace_test
module := libbacktrace_test
module_tag := debug
module_tag := debug
build_type := target
build_type := target
@@ -128,7 +107,6 @@ backtrace_test_cflags_target := \
	-DENABLE_PSS_TESTS \
	-DENABLE_PSS_TESTS \


backtrace_test_src_files := \
backtrace_test_src_files := \
	backtrace_offline_test.cpp \
	backtrace_test.cpp \
	backtrace_test.cpp \
	GetPss.cpp \
	GetPss.cpp \
	thread_utils.c \
	thread_utils.c \
@@ -142,7 +120,6 @@ backtrace_test_shared_libraries := \
	libbacktrace \
	libbacktrace \
	libbase \
	libbase \
	libcutils \
	libcutils \
	libunwind \


backtrace_test_shared_libraries_target += \
backtrace_test_shared_libraries_target += \
	libdl \
	libdl \
@@ -150,8 +127,6 @@ backtrace_test_shared_libraries_target += \
backtrace_test_ldlibs_host += \
backtrace_test_ldlibs_host += \
	-ldl \
	-ldl \


backtrace_test_strip_module := false

module := backtrace_test
module := backtrace_test
module_tag := debug
module_tag := debug
build_type := target
build_type := target
Loading