From owner-svn-ports-all@freebsd.org Fri Jan 26 19:57:25 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B0B5EC62A7; Fri, 26 Jan 2018 19:57:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1A6283B4E; Fri, 26 Jan 2018 19:57:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E6CF200D8; Fri, 26 Jan 2018 19:57:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0QJvOwX066406; Fri, 26 Jan 2018 19:57:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0QJvORW066401; Fri, 26 Jan 2018 19:57:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801261957.w0QJvORW066401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 26 Jan 2018 19:57:24 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r460050 - in head/devel/gdb: . files/kgdb X-SVN-Group: ports-head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/devel/gdb: . files/kgdb X-SVN-Commit-Revision: 460050 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jan 2018 19:57:25 -0000 Author: jhb (src,doc committer) Date: Fri Jan 26 19:57:23 2018 New Revision: 460050 URL: https://svnweb.freebsd.org/changeset/ports/460050 Log: 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) MFH: 2018Q1 Differential Revision: https://reviews.freebsd.org/D13977 Modified: head/devel/gdb/Makefile head/devel/gdb/files/kgdb/aarch64-fbsd-kern.c head/devel/gdb/files/kgdb/amd64fbsd-kern.c head/devel/gdb/files/kgdb/fbsd-kld.c Modified: head/devel/gdb/Makefile ============================================================================== --- head/devel/gdb/Makefile Fri Jan 26 19:35:51 2018 (r460049) +++ head/devel/gdb/Makefile Fri Jan 26 19:57:23 2018 (r460050) @@ -3,7 +3,7 @@ PORTNAME= gdb PORTVERSION= 8.0.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MASTER_SITES= GNU Modified: head/devel/gdb/files/kgdb/aarch64-fbsd-kern.c ============================================================================== --- head/devel/gdb/files/kgdb/aarch64-fbsd-kern.c Fri Jan 26 19:35:51 2018 (r460049) +++ head/devel/gdb/files/kgdb/aarch64-fbsd-kern.c Fri Jan 26 19:57:23 2018 (r460050) @@ -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: head/devel/gdb/files/kgdb/amd64fbsd-kern.c ============================================================================== --- head/devel/gdb/files/kgdb/amd64fbsd-kern.c Fri Jan 26 19:35:51 2018 (r460049) +++ head/devel/gdb/files/kgdb/amd64fbsd-kern.c Fri Jan 26 19:57:23 2018 (r460050) @@ -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: head/devel/gdb/files/kgdb/fbsd-kld.c ============================================================================== --- head/devel/gdb/files/kgdb/fbsd-kld.c Fri Jan 26 19:35:51 2018 (r460049) +++ head/devel/gdb/files/kgdb/fbsd-kld.c Fri Jan 26 19:57:23 2018 (r460050) @@ -27,8 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include -#include #include #include