🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #701

Symmetry GCC 1.35 register numbering

#701
From: sequent!fubar
Date: Wed, 11 Oct 1989 16:54
44 lines
1897 bytes
	GDB fails to find register variables in GCC-compiled programs
on the Symmetry, since GCC uses a different register numbering scheme.
The following addition to config/tm-seq386.h will make GCC use the
same numbering scheme as Dynix cc, and fixes the problem in all cases
except one.  The case that still fails is a "register double" in the
%ecx/%ebx register pair; the other register pairs that GCC uses happen
to come one after the other in the register order (and thus pointers
into the register array in GDB happen to do the right thing), this
pair does not.

	-J

---
	-Jay Vosburgh, Sequent Computer Systems, Inc; uunet!sequent!fubar


*** config/tm-seq386.B	Sat Sep 16 19:24:01 1989
--- config/tm-seq386.h	Tue Oct 10 14:05:06 1989
***************
*** 23,28 ****
--- 23,44 ----
  
  #include "tm-bsd386.h"
  
+ /* The following makes gcc and Dynix cc use the same numbers,
+  * this saves complication in gdb.
+  */
+ 
+ #undef DBX_REGISTER_NUMBER
+ 
+ /* gcc order is ax, dx, cx, bx, si, di, bp, sp, st, st(1), st(2)...st(7)
+  * dbx order is ax, dx, cx, st(0), st(1), bx, si, di, st(2), st(3),
+  * 		st(4), st(5), st(6), st(7), sp, bp
+  *
+  * This macro assumes that st(2) ... st(7) comes after st(1)
+  */
+ #define DBX_REGISTER_NUMBER(n) \
+ ((n)==0?0 :(n)==1?1 :(n)==2?2 :(n)==3?5 :(n)==4?6 :(n)==5?7 :(n)==6?15 \
+  :(n)==7?14 :(n)==8?3 :(n)==9?4 :(n-2))
+ 
  /* By default, target has a 80387.  */
  
  #define TARGET_DEFAULT 1
Technical Details
Message-ID: <8910111701.AA09144@uunet.uu.net>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!ucbvax!tut.cis.ohio-state.edu!UUNET.UU.NET!sequent!fubar

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!ucbvax!tut.cis.ohio-state.edu!UUNET.UU.NET!sequent!fubar
From: sequent!fubar@UUNET.UU.NET
Newsgroups: gnu.gcc.bug
Subject: Symmetry GCC 1.35 register numbering
Message-ID: <8910111701.AA09144@uunet.uu.net>
Date: 11 Oct 89 16:54:56 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: Campus Crusade for Cthulhu
Lines: 44