aboutsummaryrefslogtreecommitdiffstats
path: root/debuggerd
diff options
context:
space:
mode:
authorBen Cheng <bccheng@android.com>2010-01-28 10:00:03 -0800
committerBen Cheng <bccheng@android.com>2010-01-28 10:00:03 -0800
commit2854db8969cd061d83a931769dfaf4e57108d9df (patch)
tree1af349a405b785346241ed3934fc423364d9ed90 /debuggerd
parent2f3d96ee5b6ba43b49d0e08c75b9a74b05f37b8b (diff)
downloadsystem_core-2854db8969cd061d83a931769dfaf4e57108d9df.tar.gz
system_core-2854db8969cd061d83a931769dfaf4e57108d9df.tar.bz2
system_core-2854db8969cd061d83a931769dfaf4e57108d9df.zip
Bug fix for pre-NEON platforms and enhancement for JIT debugging.
Use __ARM_NEON__ instead of __VFP_FP__ to detect the need to retrieve FP registers. Dump more code around PC and LR to facilitate JIT debugging.
Diffstat (limited to 'debuggerd')
-rw-r--r--debuggerd/debuggerd.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/debuggerd/debuggerd.c b/debuggerd/debuggerd.c
index 3757cd5f..7b987cf9 100644
--- a/debuggerd/debuggerd.c
+++ b/debuggerd/debuggerd.c
@@ -120,7 +120,7 @@ void dump_build_info(int tfd)
void dump_stack_and_code(int tfd, int pid, mapinfo *map,
int unwind_depth, unsigned int sp_list[],
- int frame0_pc_sane, bool at_fault)
+ bool at_fault)
{
unsigned int sp, pc, p, end, data;
struct pt_regs r;
@@ -132,19 +132,11 @@ void dump_stack_and_code(int tfd, int pid, mapinfo *map,
sp = r.ARM_sp;
pc = r.ARM_pc;
- /* Died because calling the weeds - dump
- * the code around the PC in the next frame instead.
- */
- if (frame0_pc_sane == 0) {
- pc = r.ARM_lr;
- }
-
- _LOG(tfd, only_in_tombstone,
- "\ncode around %s:\n", frame0_pc_sane ? "pc" : "lr");
+ _LOG(tfd, only_in_tombstone, "\ncode around pc:\n");
end = p = pc & ~3;
- p -= 16;
- end += 16;
+ p -= 32;
+ end += 32;
/* Dump the code around PC as:
* addr contents
@@ -163,12 +155,12 @@ void dump_stack_and_code(int tfd, int pid, mapinfo *map,
_LOG(tfd, only_in_tombstone, "%s\n", code_buffer);
}
- if (frame0_pc_sane) {
+ if ((unsigned) r.ARM_lr != pc) {
_LOG(tfd, only_in_tombstone, "\ncode around lr:\n");
end = p = r.ARM_lr & ~3;
- p -= 16;
- end += 16;
+ p -= 32;
+ end += 32;
/* Dump the code around LR as:
* addr contents
@@ -286,7 +278,7 @@ void dump_registers(int tfd, int pid, bool at_fault)
" 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__
+#if __ARM_NEON__
struct user_vfp vfp_regs;
int i;
@@ -435,8 +427,7 @@ void dump_crash_report(int tfd, unsigned pid, unsigned tid, bool at_fault)
dump_pc_and_lr(tfd, tid, milist, stack_depth, at_fault);
}
- dump_stack_and_code(tfd, tid, milist, stack_depth, sp_list, frame0_pc_sane,
- at_fault);
+ dump_stack_and_code(tfd, tid, milist, stack_depth, sp_list, at_fault);
while(milist) {
mapinfo *next = milist->next;