Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Nov 2020 16:35:44 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r368108 - head/sys/arm/include
Message-ID:  <202011271635.0ARGZiFN074747@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Fri Nov 27 16:35:43 2020
New Revision: 368108
URL: https://svnweb.freebsd.org/changeset/base/368108

Log:
  arm: Correctly report the size of FPA registers to GDB
  
  Modern ARM systems do not have an FPA unit but GDB reserves register
  indices for FPA registers and expects the stub to know their sizes.
  
  PR:		251022
  Submitted by:	Dmitry Salychev <dsl@mcusim.org>
  MFC after:	2 weeks

Modified:
  head/sys/arm/include/gdb_machdep.h

Modified: head/sys/arm/include/gdb_machdep.h
==============================================================================
--- head/sys/arm/include/gdb_machdep.h	Fri Nov 27 16:29:54 2020	(r368107)
+++ head/sys/arm/include/gdb_machdep.h	Fri Nov 27 16:35:43 2020	(r368108)
@@ -36,9 +36,13 @@
 #define	GDB_REG_PC	15
 
 static __inline size_t
-gdb_cpu_regsz(int regnum __unused)
+gdb_cpu_regsz(int regnum)
 {
-	return (sizeof(int));
+	/*
+	 * GDB expects the FPA registers f0-f7, each 96 bits wide, to be placed
+	 * in between the PC and CSPR in response to a "g" packet.
+	 */
+	return (regnum >= 16 && regnum <= 23 ? 12 : sizeof(int));
 }
 
 static __inline int



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