[review] Document m68k floating point feature correspondence

Message ID gerrit.1571934987000.I4cd86acbe3449a29ce38327524c508c206b25b8f@gnutoolchain-gerrit.osci.io
State New, archived
Headers

Commit Message

Simon Marchi (Code Review) Oct. 24, 2019, 4:36 p.m. UTC
  Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/281
......................................................................

Document m68k floating point feature correspondence

From what I can tell, The m68k floating point target feature should
apparently always be called "org.gnu.gdb.coldfire.fp" -- even when the
primary feature is not "coldfire", because m68k_gdbarch_init only
checks for this feature when assigning register numbers.

However, the floating point registers are expected to match what gdb
thinks are the register sizes for the primary feature.  For example,
if the main feature is "coldfire", then the floating point registers
should be 64 bits.

See this note for some an instance of this confusion:

    https://lists.gnu.org/archive/html/qemu-devel/2017-06/msg04564.html

This patch documents the oddity.

Let me know what you think.  An alternate approach here might be to
make gdb adapt to the register sizes as actually reported.  I'm not
sure if this makes sense or not.

gdb/doc/ChangeLog
2019-10-24  Tom Tromey  <tromey@adacore.com>

	* gdb.texinfo (M68K Features): Document floating-point feature
	correspondence.

Change-Id: I4cd86acbe3449a29ce38327524c508c206b25b8f
---
M gdb/doc/ChangeLog
M gdb/doc/gdb.texinfo
2 files changed, 11 insertions(+), 0 deletions(-)
  

Comments

Simon Marchi (Code Review) Oct. 25, 2019, 8:57 p.m. UTC | #1
Luis Machado has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/281
......................................................................


Patch Set 1: Code-Review+1

It is a bit confusing. Was coldfire the only target supporting Floating Point registers at the time?

I happened to noticed that we only have coldfire.core in the XML description. Are we lacking a coldfire.fp XML in GDB? Is it only provided by non-GDB stubs?

In any case, the update looks OK to me.
  
Simon Marchi (Code Review) Oct. 25, 2019, 9:11 p.m. UTC | #2
Tom Tromey has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/281
......................................................................


Patch Set 1:

> Patch Set 1: Code-Review+1
> 
> It is a bit confusing. Was coldfire the only target supporting Floating Point registers at the time?

Nope!  I don't really know the history here.  Internally we discussed
maybe supporting an "m68k.fp" feature, but in the end decided it wasn't
worth the effort, since older versions of gdb would not support this anyway.

> I happened to noticed that we only have coldfire.core in the XML description. Are we lacking a coldfire.fp XML in GDB? Is it only provided by non-GDB stubs?

Yeah, I don't know why gdb doesn't have other XML descriptions for m68k.
In this case the "coldfire.fp" feature is coming from an XML description
that qemu supplies.
  
Simon Marchi (Code Review) Nov. 21, 2019, 7:45 p.m. UTC | #3
Tom Tromey has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/281
......................................................................


Patch Set 1:

Ping.  This is a minor documentation patch, probably got lost somewhere
in the gerrit noise.
  
Tom Tromey Dec. 4, 2019, 10:22 p.m. UTC | #4
>>>>> "Tom" == Tom Tromey (Code Review) <gerrit@gnutoolchain-gerrit.osci.io> writes:

Tom> Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/281
Tom> ......................................................................

Tom> Document m68k floating point feature correspondence
...

Tom> gdb/doc/ChangeLog
Tom> 2019-10-24  Tom Tromey  <tromey@adacore.com>

Tom> 	* gdb.texinfo (M68K Features): Document floating-point feature
Tom> 	correspondence.


Ping.


Tom
  
Tom Tromey Jan. 24, 2020, 6:21 p.m. UTC | #5
>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:

Tom> * gdb.texinfo (M68K Features): Document floating-point feature
Tom> correspondence.

Tom> Ping.

Ping again.

Tom
  
Eli Zaretskii Jan. 24, 2020, 8:05 p.m. UTC | #6
> From: Tom Tromey <tom@tromey.com>
> Cc: gdb-patches@sourceware.org
> Date: Fri, 24 Jan 2020 11:21:30 -0700
> 
> >>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:
> 
> Tom> * gdb.texinfo (M68K Features): Document floating-point feature
> Tom> correspondence.
> 
> Tom> Ping.
> 
> Ping again.

Sorry.  The patch is OK.
  

Patch

diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 0d0d905..2b80699 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,8 @@ 
+2019-10-24  Tom Tromey  <tromey@adacore.com>
+
+	* gdb.texinfo (M68K Features): Document floating-point feature
+	correspondence.
+
 2019-10-23  Tom Tromey  <tom@tromey.com>
 
 	* Makefile.in (READLINE_DIR): Update.
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 1208e4f..1fbf349 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -44346,6 +44346,12 @@ 
 This feature is optional.  If present, it should contain registers
 @samp{fp0} through @samp{fp7}, @samp{fpcontrol}, @samp{fpstatus} and
 @samp{fpiaddr}.
+
+Note that, despite the fact that this feature's name says
+@samp{coldfire}, it is used to describe any floating point registers.
+The size of the registers must match the main m68k flavor; so, for
+example, if the primary feature is reported as @samp{coldfire}, then
+64-bit floating point registers are required.
 @end table
 
 @node NDS32 Features