From owner-svn-ports-all@freebsd.org Tue Jan 30 01:18:08 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 43EDDEC7E0E; Tue, 30 Jan 2018 01:18:08 +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 EB53E72000; Tue, 30 Jan 2018 01:18:07 +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 E6578102C3; Tue, 30 Jan 2018 01:18:07 +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 w0U1I7u1012483; Tue, 30 Jan 2018 01:18:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0U1I7xX012479; Tue, 30 Jan 2018 01:18:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801300118.w0U1I7xX012479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 30 Jan 2018 01:18:07 +0000 (UTC) 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 X-SVN-Group: ports-branches X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in branches/2018Q1/devel/gdb: . files/kgdb X-SVN-Commit-Revision: 460368 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: Tue, 30 Jan 2018 01:18:08 -0000 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 __FBSDID("$FreeBSD$"); -#include -#include #include #include