Article View: gnu.gdb.bug
Article #8866GDB and F77 on Sun
From: Tom Wurgler
Date: Thu, 09 Jul 1992 14:10
Date: Thu, 09 Jul 1992 14:10
93 lines
3945 bytes
3945 bytes
Hello.
I am attempting to use GDB and am having some difficulties. I'm hoping that
you can either clear them up or inform me that I am just out of luck.
Here is the problem:
I am trying to debug a F77 program on a Sun SPARCstation 1. It pretty much
works. There are just certain times when I get an error (in GDB) that I do
not know how to get around. GDB seems to have no problems until I attempt
to reference a variable that is used in a subroutine call to an outside
package (such as SunPHIGS). Here is a bit to show you what I mean:
59 c Open workstation 1.
60
61 iconid = 0
62 call popwk(iwkid, iconid, igrscr)
63
Watch what happens if I break in this routine at line 62:
(gdb) b 62
Breakpoint 1 at 0x3225c: file stm36.f, line 62.
(gdb) run 123
Starting program: /usr2/export/home/benedetto/programs/stmmn/stmmn.exe 123
This is STMMN - $Revision: 2.1 $
Breakpoint 1, stm36 () at stm36.f:62
(gdb) p igrscr
$1 = Cannot access memory at address 0x33ee270.
(gdb) p iconid
$2 = Cannot access memory at address 0x33ee268.
(gdb) p iwkid
$3 = 1
(gdb) whatis igrscr
type = int
(gdb) whatis iconid
type = int
(gdb) whatis iwkid
type = int
(gdb) i add igrscr
Symbol "igrscr" is static storage at address 0x33ee270.
(gdb) i add iconid
Symbol "iconid" is static storage at address 0x33ee268.
(gdb) i add iwkid
Symbol "iwkid" is static storage at address 0xa2cd8.
(gdb)
FYI iwkid is in COMMON and igrscr and iconid are just local variables.
More often than not the variables that I use when calling a subroutine are
NOT in COMMON and so I see "Cannot access memory at address 0x........" alot.
My question (which should be fairly clear by now) is:
(1) Is there something that I can do to my F77 code or to GDB OR when I
compile in order to get around this problem? (That is, I want to be
able to print out any and all variables in a routine.)
-OR-
(2) Am I stuck with this because it is a "feature" of Suns?
I have this same problem with both gdb v4.4 and v4.5. I have built GDB with
(1) Sun's cc, (2) gcc v1.40, and (3) gcc v2.2.2 and get the same results
each time.
Here is my environment:
Sun workstation, SPARCstation 1.
SunOS 4.1.1 (SunOS Release 4.1.1 (GENERIC) #1: Thu Oct 11 10:25:14 PDT 1990)
GDB versions 4.4 and 4.5. I used "sun4os4" when I configured.
I used Sun's cc the first time. Then I edited
the Makefiles and added "CC=gcc" somewhere at the
top and rebuilt. I used gcc versions 1.40 and
2.2.2.
F77 version 1.4. I usually use the "-g -C" switches but I get the same
results using just "-g".
The "outside" package that I am using in SunPHIGS version 1.3.
A colleague of mine is getting similar results using SunPHIGS version 2.0.
Any answer that you could give me would be appreciated. I check my email
usually only in the mornings and evenings because I have to dial up the
local university to get it. So if you have further questions I can answer
them after I dial in to get the mail...
Thanks for any light that you can shed upon this...
Bill Benedetto
wurgler@zippysun.math.uakron.edu
Technical Details
Message-ID:
<9207091410.AA09905@zippysun.math.uakron.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!zippysun.math.uakron.edu!wurglerShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5053,89027e7a3172f7d5,start X-Google-Attributes: gidf5053,public X-Google-ArrivalTime: 1992-07-09 01:29:26 PST Newsgroups: gnu.gdb.bug Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!zippysun.math.uakron.edu!wurgler From: wurgler@zippysun.math.uakron.edu (Tom Wurgler) Subject: GDB and F77 on Sun Message-ID: <9207091410.AA09905@zippysun.math.uakron.edu> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Thu, 9 Jul 1992 14:10:57 GMT Approved: bug-gdb@prep.ai.mit.edu Lines: 94