summaryrefslogtreecommitdiffstats
path: root/debuggerd/debuggerd.c
diff options
context:
space:
mode:
authorBen Cheng <bccheng@google.com>2009-12-17 12:50:58 -0800
committerBen Cheng <bccheng@google.com>2009-12-17 12:53:06 -0800
commitbdcff7d66ef8f6602e017d03cf4ffa57bac39b92 (patch)
treebb14c4e3fb025e293da1c613467a4472e2a6879d /debuggerd/debuggerd.c
parentb202c54aca4d84086a4dcc0f3c0bbc02d1dd9625 (diff)
downloadsystem_core-bdcff7d66ef8f6602e017d03cf4ffa57bac39b92.zip
system_core-bdcff7d66ef8f6602e017d03cf4ffa57bac39b92.tar.gz
system_core-bdcff7d66ef8f6602e017d03cf4ffa57bac39b92.tar.bz2
Dump VFP registers and status word when native app crashes.
Bug: 2226399 Caveat: d0/d1 appear to be clobbered by ptrace. It will be tracked by a new bug.
Diffstat (limited to 'debuggerd/debuggerd.c')
-rw-r--r--debuggerd/debuggerd.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/debuggerd/debuggerd.c b/debuggerd/debuggerd.c
index 145135f..3757cd5 100644
--- a/debuggerd/debuggerd.c
+++ b/debuggerd/debuggerd.c
@@ -285,6 +285,24 @@ void dump_registers(int tfd, int pid, bool at_fault)
_LOG(tfd, only_in_tombstone,
" 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);
+
+#if __VFP_FP__
+ struct user_vfp vfp_regs;
+ int i;
+
+ if(ptrace(PTRACE_GETVFPREGS, pid, 0, &vfp_regs)) {
+ _LOG(tfd, only_in_tombstone,
+ "cannot get registers: %s\n", strerror(errno));
+ return;
+ }
+
+ for (i = 0; i < 32; i += 2) {
+ _LOG(tfd, only_in_tombstone,
+ " d%-2d %016llx d%-2d %016llx\n",
+ i, vfp_regs.fpregs[i], i+1, vfp_regs.fpregs[i+1]);
+ }
+ _LOG(tfd, only_in_tombstone, " scr %08lx\n\n", vfp_regs.fpscr);
+#endif
}
const char *get_signame(int sig)