Skip to content

Commit

Permalink
Use arch flags instead of TARGET_ARCH_VARIANT, and add support for VF…
Browse files Browse the repository at this point in the history
…P_D16

Change-Id: I6007ff21076e92b04a17fb030472a9f8842f0315
  • Loading branch information
colincross committed Mar 10, 2010
1 parent 7df6349 commit e951f60
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
17 changes: 15 additions & 2 deletions debuggerd/Android.mk
Expand Up @@ -9,6 +9,13 @@ LOCAL_SRC_FILES:= debuggerd.c getevent.c unwind-arm.c pr-support.c utility.c
LOCAL_CFLAGS := -Wall LOCAL_CFLAGS := -Wall
LOCAL_MODULE := debuggerd LOCAL_MODULE := debuggerd


ifeq ($(ARCH_ARM_HAVE_VFP),true)
LOCAL_CFLAGS += -DWITH_VFP
endif # ARCH_ARM_HAVE_VFP
ifeq ($(ARCH_ARM_HAVE_VFP_D32),true)
LOCAL_CFLAGS += -DWITH_VFP_D32
endif # ARCH_ARM_HAVE_VFP_D32

LOCAL_STATIC_LIBRARIES := libcutils libc LOCAL_STATIC_LIBRARIES := libcutils libc


include $(BUILD_EXECUTABLE) include $(BUILD_EXECUTABLE)
Expand All @@ -23,14 +30,20 @@ LOCAL_MODULE_TAGS := eng
LOCAL_SHARED_LIBRARIES := libcutils libc LOCAL_SHARED_LIBRARIES := libcutils libc
include $(BUILD_EXECUTABLE) include $(BUILD_EXECUTABLE)


ifeq ($(TARGET_ARCH_VARIANT),armv7-a) ifeq ($(ARCH_ARM_HAVE_VFP),true)
include $(CLEAR_VARS) include $(CLEAR_VARS)

LOCAL_CFLAGS += -DWITH_VFP
ifeq ($(ARCH_ARM_HAVE_VFP_D32),true)
LOCAL_CFLAGS += -DWITH_VFP_D32
endif # ARCH_ARM_HAVE_VFP_D32

LOCAL_SRC_FILES := vfp-crasher.c vfp.S LOCAL_SRC_FILES := vfp-crasher.c vfp.S
LOCAL_MODULE := vfp-crasher LOCAL_MODULE := vfp-crasher
LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
LOCAL_MODULE_TAGS := eng LOCAL_MODULE_TAGS := eng
LOCAL_SHARED_LIBRARIES := libcutils libc LOCAL_SHARED_LIBRARIES := libcutils libc
include $(BUILD_EXECUTABLE) include $(BUILD_EXECUTABLE)
endif # TARGET_ARCH_VARIANT == armv7-a endif # ARCH_ARM_HAVE_VFP == true


endif # TARGET_ARCH == arm endif # TARGET_ARCH == arm
12 changes: 10 additions & 2 deletions debuggerd/debuggerd.c
Expand Up @@ -42,6 +42,14 @@


#include "utility.h" #include "utility.h"


#ifdef WITH_VFP
#ifdef WITH_VFP_D32
#define NUM_VFP_REGS 32
#else
#define NUM_VFP_REGS 16
#endif
#endif

/* Main entry point to get the backtrace from the crashing process */ /* Main entry point to get the backtrace from the crashing process */
extern int unwind_backtrace_with_ptrace(int tfd, pid_t pid, mapinfo *map, extern int unwind_backtrace_with_ptrace(int tfd, pid_t pid, mapinfo *map,
unsigned int sp_list[], unsigned int sp_list[],
Expand Down Expand Up @@ -278,7 +286,7 @@ void dump_registers(int tfd, int pid, bool at_fault)
" ip %08x sp %08x lr %08x pc %08x cpsr %08x\n", " ip %08x sp %08x lr %08x pc %08x cpsr %08x\n",
r.ARM_ip, r.ARM_sp, r.ARM_lr, r.ARM_pc, r.ARM_cpsr); r.ARM_ip, r.ARM_sp, r.ARM_lr, r.ARM_pc, r.ARM_cpsr);


#if __ARM_NEON__ #ifdef WITH_VFP
struct user_vfp vfp_regs; struct user_vfp vfp_regs;
int i; int i;


Expand All @@ -288,7 +296,7 @@ void dump_registers(int tfd, int pid, bool at_fault)
return; return;
} }


for (i = 0; i < 32; i += 2) { for (i = 0; i < NUM_VFP_REGS; i += 2) {
_LOG(tfd, only_in_tombstone, _LOG(tfd, only_in_tombstone,
" d%-2d %016llx d%-2d %016llx\n", " d%-2d %016llx d%-2d %016llx\n",
i, vfp_regs.fpregs[i], i+1, vfp_regs.fpregs[i+1]); i, vfp_regs.fpregs[i], i+1, vfp_regs.fpregs[i+1]);
Expand Down
2 changes: 2 additions & 0 deletions debuggerd/vfp.S
Expand Up @@ -19,6 +19,7 @@ crash:
fconstd d13, #13 fconstd d13, #13
fconstd d14, #14 fconstd d14, #14
fconstd d15, #15 fconstd d15, #15
#ifdef WITH_VFP_D32
fconstd d16, #16 fconstd d16, #16
fconstd d17, #17 fconstd d17, #17
fconstd d18, #18 fconstd d18, #18
Expand All @@ -35,6 +36,7 @@ crash:
fconstd d29, #29 fconstd d29, #29
fconstd d30, #30 fconstd d30, #30
fconstd d31, #31 fconstd d31, #31
#endif
mov r0, #0 mov r0, #0
str r0, [r0] str r0, [r0]
bx lr bx lr
Expand Down

0 comments on commit e951f60

Please sign in to comment.