Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Nov 2019 11:28:43 +0000 (UTC)
From:      Leandro Lupori <luporl@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r354239 - head/contrib/gdb/gdb
Message-ID:  <201911011128.xA1BShOC057227@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911011128.xA1BShOC057227>