aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2023-09-13 15:34:07 +0000
committerKyle Evans <kevans@FreeBSD.org>2023-09-13 15:34:26 +0000
commita22f1db084fb50880a0df90f9a0f031a7fc34921 (patch)
treefe577f80cc01dea426c42257978b9ad9e3233f6b
parent4fd25f1452ad64c38ad4ce0bb3d82cfabb28bd25 (diff)
downloadports-a22f1db084fb50880a0df90f9a0f031a7fc34921.tar.gz
ports-a22f1db084fb50880a0df90f9a0f031a7fc34921.zip
devel/gdb: kgdb: fix aarch64 trapframe handling
regcache_map_entry_size() doesn't do the magic to convert size == 0 to register_size, so we must supply sizes for all registers if we're going to use it. This fixes handling of the trapframe so that we can actually unwind properly, where-as before we would end up with, e.g., #6 0xffff0000004b4860 in kdb_trap (type=60, code=0, tf=<optimized out>) at /usr/src/sys/kern/subr_kdb.c:790 #7 <signal handler called> #8 <signal handler called> #9 <signal handler called> #10 <signal handler called> #11 <signal handler called> Reported by: Mark Millard Approved by: jhb (implicit, kgdb maintainer) MFH: 2023Q3
-rw-r--r--devel/gdb/Makefile2
-rw-r--r--devel/gdb/files/kgdb/aarch64-fbsd-kern.c18
2 files changed, 10 insertions, 10 deletions
diff --git a/devel/gdb/Makefile b/devel/gdb/Makefile
index 921a14b566de..f72743a1dfa8 100644
--- a/devel/gdb/Makefile
+++ b/devel/gdb/Makefile
@@ -1,6 +1,6 @@
PORTNAME= gdb
DISTVERSION= 13.1
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= devel
MASTER_SITES= GNU
diff --git a/devel/gdb/files/kgdb/aarch64-fbsd-kern.c b/devel/gdb/files/kgdb/aarch64-fbsd-kern.c
index 4d813c786b52..68b12130fa83 100644
--- a/devel/gdb/files/kgdb/aarch64-fbsd-kern.c
+++ b/devel/gdb/files/kgdb/aarch64-fbsd-kern.c
@@ -126,13 +126,13 @@ aarch64_fbsd_supply_pcb(struct regcache *regcache, CORE_ADDR pcb_addr)
static const struct regcache_map_entry aarch64_fbsd_trapframe_map[] =
{
- { 1, AARCH64_SP_REGNUM, 0 },
- { 1, AARCH64_LR_REGNUM, 0 },
- { 1, AARCH64_PC_REGNUM, 0 },
- { 1, AARCH64_CPSR_REGNUM, 0 },
+ { 1, AARCH64_SP_REGNUM, 8 },
+ { 1, AARCH64_LR_REGNUM, 8 },
+ { 1, AARCH64_PC_REGNUM, 8 },
+ { 1, AARCH64_CPSR_REGNUM, 8 },
{ 1, REGCACHE_MAP_SKIP, 8 }, /* esr */
{ 1, REGCACHE_MAP_SKIP, 8 }, /* far */
- { 30, AARCH64_X0_REGNUM, 0 }, /* x0 ... x29 */
+ { 30, AARCH64_X0_REGNUM, 8 }, /* x0 ... x29 */
{ 0 },
};
@@ -141,12 +141,12 @@ static const struct regcache_map_entry aarch64_fbsd_trapframe_map[] =
static const struct regcache_map_entry aarch64_fbsd13_trapframe_map[] =
{
- { 1, AARCH64_SP_REGNUM, 0 },
- { 1, AARCH64_LR_REGNUM, 0 },
- { 1, AARCH64_PC_REGNUM, 0 },
+ { 1, AARCH64_SP_REGNUM, 8 },
+ { 1, AARCH64_LR_REGNUM, 8 },
+ { 1, AARCH64_PC_REGNUM, 8 },
{ 1, AARCH64_CPSR_REGNUM, 4 },
{ 1, REGCACHE_MAP_SKIP, 4 }, /* esr */
- { 30, AARCH64_X0_REGNUM, 0 }, /* x0 ... x29 */
+ { 30, AARCH64_X0_REGNUM, 8 }, /* x0 ... x29 */
{ 0 },
};