Date: Tue, 30 Jan 2018 01:18:07 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r460368 - in branches/2018Q1/devel/gdb: . files/kgdb Message-ID: <201801300118.w0U1I7xX012479@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb (src,doc committer) Date: Tue Jan 30 01:18:07 2018 New Revision: 460368 URL: https://svnweb.freebsd.org/changeset/ports/460368 Log: MFH: r460050 KGDB fixes for amd64 and aarch64. - Update the amd64 kernel support to recognize mchk_calltrap as a trapframe generator. - Remove some unneeded headers from fbsd-kld.c. - Various fixes to get stack traces working for aarch64 kernels: - Map the LR register from the PCB to PC instead of LR. - Skip the PC register from the PCB as it isn't initialized to anything. - Correct the register cache map for the PCB. The old one had the offsets of pcb_sp and pcb_pc reversed. - Don't map all of the saved general purpose registers in a trapframe to X1 rather than X0 .. X29. - Use correct name for el0 trapframe entry points. Reviewed by: pizzamig (maintainer) Differential Revision: https://reviews.freebsd.org/D13977 Approved by: ports-secteam (swills) Modified: branches/2018Q1/devel/gdb/Makefile branches/2018Q1/devel/gdb/files/kgdb/aarch64-fbsd-kern.c branches/2018Q1/devel/gdb/files/kgdb/amd64fbsd-kern.c branches/2018Q1/devel/gdb/files/kgdb/fbsd-kld.c Directory Properties: branches/2018Q1/ (props changed) Modified: branches/2018Q1/devel/gdb/Makefile ============================================================================== --- branches/2018Q1/devel/gdb/Makefile Tue Jan 30 01:16:41 2018 (r460367) +++ branches/2018Q1/devel/gdb/Makefile Tue Jan 30 01:18:07 2018 (r460368) @@ -3,7 +3,7 @@ PORTNAME= gdb PORTVERSION= 8.0.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MASTER_SITES= GNU Modified: branches/2018Q1/devel/gdb/files/kgdb/aarch64-fbsd-kern.c ============================================================================== --- branches/2018Q1/devel/gdb/files/kgdb/aarch64-fbsd-kern.c Tue Jan 30 01:16:41 2018 (r460367) +++ branches/2018Q1/devel/gdb/files/kgdb/aarch64-fbsd-kern.c Tue Jan 30 01:18:07 2018 (r460368) @@ -45,9 +45,9 @@ static const struct regcache_map_entry aarch64_fbsd_pcbmap[] = { { 30, AARCH64_X0_REGNUM, 8 }, /* x0 ... x29 */ - { 1, AARCH64_LR_REGNUM, 8 }, - { 1, AARCH64_SP_REGNUM, 8 }, { 1, AARCH64_PC_REGNUM, 8 }, + { 1, REGCACHE_MAP_SKIP, 8 }, + { 1, AARCH64_SP_REGNUM, 8 }, { 0 } }; @@ -100,7 +100,7 @@ aarch64_fbsd_trapframe_cache (struct frame_info *this_ trad_frame_set_reg_addr (cache, AARCH64_PC_REGNUM, sp + 16); trad_frame_set_reg_addr (cache, AARCH64_CPSR_REGNUM, sp + 24); for (i = 0; i < 30; i++) - trad_frame_set_reg_addr (cache, AARCH64_X0_REGNUM + 1, sp + 32 + i * 8); + trad_frame_set_reg_addr (cache, AARCH64_X0_REGNUM + i, sp + 32 + i * 8); /* Read $PC from trap frame. */ pc = read_memory_unsigned_integer (sp + 16, 8, byte_order); @@ -149,9 +149,9 @@ aarch64_fbsd_trapframe_sniffer (const struct frame_unw find_pc_partial_function (get_frame_func (this_frame), &name, NULL, NULL); return (name && ((strcmp (name, "handle_el1h_sync") == 0) || (strcmp (name, "handle_el1h_irq") == 0) - || (strcmp (name, "handle_el0h_sync") == 0) - || (strcmp (name, "handle_el0h_irq") == 0) - || (strcmp (name, "handle_el0h_error") == 0) + || (strcmp (name, "handle_el0_sync") == 0) + || (strcmp (name, "handle_el0_irq") == 0) + || (strcmp (name, "handle_el0_error") == 0) || (strcmp (name, "fork_trampoline") == 0))); } Modified: branches/2018Q1/devel/gdb/files/kgdb/amd64fbsd-kern.c ============================================================================== --- branches/2018Q1/devel/gdb/files/kgdb/amd64fbsd-kern.c Tue Jan 30 01:16:41 2018 (r460367) +++ branches/2018Q1/devel/gdb/files/kgdb/amd64fbsd-kern.c Tue Jan 30 01:18:07 2018 (r460368) @@ -205,6 +205,7 @@ amd64fbsd_trapframe_sniffer (const struct frame_unwind find_pc_partial_function (get_frame_func (this_frame), &name, NULL, NULL); return (name && ((strcmp (name, "calltrap") == 0) || (strcmp (name, "fork_trampoline") == 0) + || (strcmp (name, "mchk_calltrap") == 0) || (strcmp (name, "nmi_calltrap") == 0) || (name[0] == 'X' && name[1] != '_'))); } Modified: branches/2018Q1/devel/gdb/files/kgdb/fbsd-kld.c ============================================================================== --- branches/2018Q1/devel/gdb/files/kgdb/fbsd-kld.c Tue Jan 30 01:16:41 2018 (r460367) +++ branches/2018Q1/devel/gdb/files/kgdb/fbsd-kld.c Tue Jan 30 01:18:07 2018 (r460368) @@ -27,8 +27,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include <sys/param.h> -#include <sys/stat.h> #include <fcntl.h> #include <libgen.h>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801300118.w0U1I7xX012479>