From owner-svn-src-head@freebsd.org Fri Nov 1 11:28:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA78A15A191; Fri, 1 Nov 2019 11:28:43 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474KhC502dz46b0; Fri, 1 Nov 2019 11:28:43 +0000 (UTC) (envelope-from luporl@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 8E859A50E; Fri, 1 Nov 2019 11:28:43 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA1BShnt057228; Fri, 1 Nov 2019 11:28:43 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA1BShOC057227; Fri, 1 Nov 2019 11:28:43 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201911011128.xA1BShOC057227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Fri, 1 Nov 2019 11:28:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354239 - head/contrib/gdb/gdb X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/contrib/gdb/gdb X-SVN-Commit-Revision: 354239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Nov 2019 11:28:43 -0000 Author: luporl Date: Fri Nov 1 11:28:43 2019 New Revision: 354239 URL: https://svnweb.freebsd.org/changeset/base/354239 Log: [PPC64] Fix GDB sigtramp detection Current implementation of ppcfbsd_pc_in_sigtramp() seems to take only 32-bit PowerPC in account, as on 64-bit PowerPC most kernel instruction addresses will be wrongly reported as in sigtramp. This change adds proper sigtramp detection for PPC64. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D22199 Modified: head/contrib/gdb/gdb/ppcfbsd-tdep.c Modified: head/contrib/gdb/gdb/ppcfbsd-tdep.c ============================================================================== --- head/contrib/gdb/gdb/ppcfbsd-tdep.c Fri Nov 1 09:16:58 2019 (r354238) +++ head/contrib/gdb/gdb/ppcfbsd-tdep.c Fri Nov 1 11:28:43 2019 (r354239) @@ -487,6 +487,12 @@ ppcfbsd_pc_in_sigtramp (CORE_ADDR pc, char *func_name) return (pc >= 0x7fffef00U) ? 1 : 0; } +static int +ppc64_fbsd_pc_in_sigtramp (CORE_ADDR pc, char *func_name) +{ + return (pc >= 0x3fffffffffffe000U && pc <= 0x3fffffffffffefffU) ? 1 : 0; +} + /* NetBSD is confused. It appears that 1.5 was using the correct SVr4 convention but, 1.6 switched to the below broken convention. For the moment use the broken convention. Ulgh!. */ @@ -518,10 +524,9 @@ ppcfbsd_init_abi (struct gdbarch_info info, /* FreeBSD doesn't support the 128-bit `long double' from the psABI. */ set_gdbarch_long_double_bit (gdbarch, 64); - set_gdbarch_pc_in_sigtramp (gdbarch, ppcfbsd_pc_in_sigtramp); - if (tdep->wordsize == 4) { + set_gdbarch_pc_in_sigtramp (gdbarch, ppcfbsd_pc_in_sigtramp); set_gdbarch_return_value (gdbarch, ppcfbsd_return_value); set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets); @@ -529,6 +534,7 @@ ppcfbsd_init_abi (struct gdbarch_info info, if (tdep->wordsize == 8) { + set_gdbarch_pc_in_sigtramp (gdbarch, ppc64_fbsd_pc_in_sigtramp); set_gdbarch_convert_from_func_ptr_addr (gdbarch, ppc64_fbsd_convert_from_func_ptr_addr);