summaryrefslogtreecommitdiffstats
path: root/debuggerd
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-07-14 16:10:15 -0700
committerElliott Hughes <enh@google.com>2014-07-14 18:56:53 -0700
commitaae5d437556d877f2a198601394ba8ea7a559a70 (patch)
tree2db66516bb38bb42263eaeae2bb1a307b5aed502 /debuggerd
parent71bbc6789fb6750d8fddda0a3ff9a87f09a32c74 (diff)
downloadsystem_core-aae5d437556d877f2a198601394ba8ea7a559a70.tar.gz
system_core-aae5d437556d877f2a198601394ba8ea7a559a70.tar.bz2
system_core-aae5d437556d877f2a198601394ba8ea7a559a70.zip
Add missing arm64 registers.
Also fix dumping of arm64's vector registers, which are actually 128 bits wide. Also move the arm/arm64 FP registers to the tombstone. (We've never dumped them at all for the other architectures.) (cherry picked from commit b40c50351ebd9fb40b76a3169ad5cc6a25c453f1) Change-Id: Ic646fb9ea01e9beb42e1757feb8742c1d4efafa7
Diffstat (limited to 'debuggerd')
-rw-r--r--debuggerd/arm/machine.cpp6
-rw-r--r--debuggerd/arm64/machine.cpp44
-rw-r--r--debuggerd/utility.h17
3 files changed, 34 insertions, 33 deletions
diff --git a/debuggerd/arm/machine.cpp b/debuggerd/arm/machine.cpp
index 82700669c..50e78c508 100644
--- a/debuggerd/arm/machine.cpp
+++ b/debuggerd/arm/machine.cpp
@@ -82,13 +82,13 @@ void dump_registers(log_t* log, pid_t tid) {
user_vfp vfp_regs;
if (ptrace(PTRACE_GETVFPREGS, tid, 0, &vfp_regs)) {
- _LOG(log, logtype::REGISTERS, "cannot get registers: %s\n", strerror(errno));
+ _LOG(log, logtype::FP_REGISTERS, "cannot get FP registers: %s\n", strerror(errno));
return;
}
for (size_t i = 0; i < 32; i += 2) {
- _LOG(log, logtype::REGISTERS, " d%-2d %016llx d%-2d %016llx\n",
+ _LOG(log, logtype::FP_REGISTERS, " d%-2d %016llx d%-2d %016llx\n",
i, vfp_regs.fpregs[i], i+1, vfp_regs.fpregs[i+1]);
}
- _LOG(log, logtype::REGISTERS, " scr %08lx\n", vfp_regs.fpscr);
+ _LOG(log, logtype::FP_REGISTERS, " scr %08lx\n", vfp_regs.fpscr);
}
diff --git a/debuggerd/arm64/machine.cpp b/debuggerd/arm64/machine.cpp
index ec664bd20..8b17d536c 100644
--- a/debuggerd/arm64/machine.cpp
+++ b/debuggerd/arm64/machine.cpp
@@ -15,17 +15,14 @@
* limitations under the License.
*/
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdio.h>
+#include <elf.h>
#include <errno.h>
+#include <inttypes.h>
+#include <string.h>
#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/user.h>
#include <sys/uio.h>
-#include <linux/elf.h>
#include "../utility.h"
#include "../machine.h"
@@ -79,19 +76,18 @@ void dump_registers(log_t* log, pid_t tid) {
for (int i = 0; i < 28; i += 4) {
_LOG(log, logtype::REGISTERS,
- " x%-2d %016lx x%-2d %016lx x%-2d %016lx x%-2d %016lx\n",
- i, (uint64_t)r.regs[i],
- i+1, (uint64_t)r.regs[i+1],
- i+2, (uint64_t)r.regs[i+2],
- i+3, (uint64_t)r.regs[i+3]);
+ " x%-2d %016llx x%-2d %016llx x%-2d %016llx x%-2d %016llx\n",
+ i, r.regs[i],
+ i+1, r.regs[i+1],
+ i+2, r.regs[i+2],
+ i+3, r.regs[i+3]);
}
- _LOG(log, logtype::REGISTERS, " x28 %016lx x29 %016lx x30 %016lx\n",
- (uint64_t)r.regs[28], (uint64_t)r.regs[29], (uint64_t)r.regs[30]);
-
- _LOG(log, logtype::REGISTERS, " sp %016lx pc %016lx\n",
- (uint64_t)r.sp, (uint64_t)r.pc);
+ _LOG(log, logtype::REGISTERS, " x28 %016llx x29 %016llx x30 %016llx\n",
+ r.regs[28], r.regs[29], r.regs[30]);
+ _LOG(log, logtype::REGISTERS, " sp %016llx pc %016llx pstate %016llx\n",
+ r.sp, r.pc, r.pstate);
struct user_fpsimd_state f;
io.iov_base = &f;
@@ -102,11 +98,15 @@ void dump_registers(log_t* log, pid_t tid) {
return;
}
- for (int i = 0; i < 32; i += 4) {
- _LOG(log, logtype::REGISTERS, " v%-2d %016lx v%-2d %016lx v%-2d %016lx v%-2d %016lx\n",
- i, (uint64_t)f.vregs[i],
- i+1, (uint64_t)f.vregs[i+1],
- i+2, (uint64_t)f.vregs[i+2],
- i+3, (uint64_t)f.vregs[i+3]);
+ for (int i = 0; i < 32; i += 2) {
+ _LOG(log, logtype::FP_REGISTERS,
+ " v%-2d %016" PRIx64 "%016" PRIx64 " v%-2d %016" PRIx64 "%016" PRIx64 "\n",
+ i,
+ static_cast<uint64_t>(f.vregs[i] >> 64),
+ static_cast<uint64_t>(f.vregs[i]),
+ i+1,
+ static_cast<uint64_t>(f.vregs[i+1] >> 64),
+ static_cast<uint64_t>(f.vregs[i+1]));
}
+ _LOG(log, logtype::FP_REGISTERS, " fpsr %08x fpcr %08x\n", f.fpsr, f.fpcr);
}
diff --git a/debuggerd/utility.h b/debuggerd/utility.h
index f2e2d2959..518305dc5 100644
--- a/debuggerd/utility.h
+++ b/debuggerd/utility.h
@@ -2,16 +2,16 @@
**
** Copyright 2008, The Android Open Source Project
**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
**
-** http://www.apache.org/licenses/LICENSE-2.0
+** http://www.apache.org/licenses/LICENSE-2.0
**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
** limitations under the License.
*/
@@ -54,6 +54,7 @@ enum logtype {
HEADER,
THREAD,
REGISTERS,
+ FP_REGISTERS,
BACKTRACE,
MAPS,
MEMORY,