🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #7024

Trouble with dbx on a SPARC

#7024
From: gnu
Date: Mon, 18 Mar 1991 17:28
22 lines
1639 bytes
The Sun C compiler before SunOS 4.1 would output incorrect debug
information about parameters shorter than an "int".  The debug information
claimed that the parameter was a short at offset XXX.  However the
parameter really was an int at offset XXX.  If you wanted to treat it like
a short, you would have to look at offset XXX+2.

DBX apparently was able to deal with that somehow, and a kludge was added
to gdb to also deal with it.

They fixed the compiler in SunOS 4.1, so it now claims the short parameter
is at offset XXX+2, where it really is.

Perhaps DBX was not changed correspondingly.

GDB can be changed to handle this by defining BELIEVE_PCC_PROMOTION in the
config file (m-sun*.h).  I changed GDB to handle both 4.0.x and 4.1 by
offsetting the symbol if it points at an int-aligned location, and leaving
it alone if it appears to have already been offset to where the parameter
really is.  This lets you run the same GDB binary on SunOS 4.0.x and 4.1
machines.  The change (in dbxread.c) will be in some future GDB release.

	John Gilmore
Technical Details
Message-ID: <1929@brchh104.bnr.ca>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!bnrgate!brtph3!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!bnrgate!brtph3!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request
From: gnu@toad.com
Newsgroups: comp.sys.sun
Subject: Trouble with dbx on a SPARC
Keywords: Software
Message-ID: <1929@brchh104.bnr.ca>
Date: 18 Mar 91 17:28:00 GMT
Sender: news@brchh104.bnr.ca
Organization: Sun-Spots
Lines: 22
Approved: Sun-Spots@rice.edu
X-Original-Date: Mon, 04 Mar 91 02:41:58 -0800
X-Refs:  Original: v10n27
X-Sun-Spots-Digest: Volume 10, Issue 53, message 16
X-Note: Submissions: sun-spots@rice.edu, Admin: sun-spots-request@rice.edu