🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #10203

Bug report on gdb 3.5 for sparc architecture

#10203
From: Soohong Kim
Date: Tue, 13 Mar 1990 00:56
137 lines
7436 bytes
Hi! I am reporting a bug in gdb 3.x (tested with versions 3.3 thru 3.5)
for "sparc" architecture. (I used a SparcStation-1, a sun4 and a sun-3 to
verify this.) The problem is with wrong values printed for function call
arguments in the display of stack frames.
In the following, I enclosed two session scripts showing differences
between a correct output from gdb 3.5 on sun-3 and an incorrect output
from gdb 3.5 on SparcStation-1.
====================================================
- Correct output (on sun-3)
====================================================
% gdb -q artistII
Reading symbol data from /home/soohong/tools/II/ar2/artistII...done.
(gdb) b countgroup
Reading in symbols for group.c... and artist.c...done.
Breakpoint 1 at 0x9aa2: file group.c, line 55.
(gdb) run -r2 fract -q
Starting program: /home/soohong/tools/II/ar2/artistII -r2 fract -q
******** Artist - Version 5.99 - Last updated  1/22/90 at 23:17:01 ********

Options: module(fract) row(2) accept(ramp)

Bpt 1, countgroup (tre=(struct trenode *) 0x7f524, lev=0) (group.c line 61)
61		cnt = 0;
(gdb) where
#0  countgroup (tre=(struct trenode *) 0x7f524, lev=0) (group.c line 61)
#1  0x59d6 in counttree (...) (...)
#2  0x34bc in configinit (...) (...)
#3  0x289a in artist (nam=(char *) 0xefffb78 "fract", lop=1, grp=0, eva=0) (artist.c line 217)
#4  0x27b8 in main (argc=0, argv=(char **) 0xefffb0c) (artist.c line 189)
(gdb) up 1
Reading in symbols for tree.c...done.
#1  0x59d6 in counttree (tre=(struct trenode *) 0x7f524, lev=0) (tree.c line 117)
117				return (countgroup(tre, lev));
(gdb) up 1
Reading in symbols for config.c...done.
#2  0x34bc in configinit (lop=1, grp=0) (config.c line 151)
151			while (((tmp = counttree(tre, ini)) < 24) && (ini < hei)) {
(gdb) where
#0  countgroup (tre=(struct trenode *) 0x7f524, lev=0) (group.c line 61)
61		cnt = 0;
#1  0x59d6 in counttree (tre=(struct trenode *) 0x7f524, lev=0) (tree.c line 117)
#2  0x34bc in configinit (lop=1, grp=0) (config.c line 151)
#3  0x289a in artist (nam=(char *) 0xefffb78 "fract", lop=1, grp=0, eva=0) (artist.c line 217)
#4  0x27b8 in main (argc=0, argv=(char **) 0xefffb0c) (artist.c line 189)
====================================================
- Incorrect output (on SparcStation-1)
====================================================
Script started on Mon Mar 12 17:18:00 1990
% gdb -q artistII
Reading symbol data from /home/soohong/tools/II/artistII/artistII...done.
(gdb) b countgroup
Reading in symbols for group.c... and artist.c...done.
Breakpoint 1 at 0xcb7c: file group.c, line 61.
(gdb) run -r2 fract -q
Starting program: /home/soohong/tools/II/artistII/artistII -r2 fract -q
******** Artist - Version 5.99 - Last updated  1/22/90 at 23:17:01 ********

Options: module(fract) row(2) accept(ramp)

Bpt 1, countgroup (tre=(struct trenode *) 0x6f570, lev=-134219392) (group.c line 61)
61		cnt = 0;
(gdb) where
#0  countgroup (tre=(struct trenode *) 0x6f570, lev=-134219392) (group.c line 61)
#1  0x6bd4 in counttree (...) (...)
#2  0x3a88 in configinit (...) (...)
#3  0x2b6c in artist (nam=(char *) 0xf7fffb75 "fract", lop=1, grp=0, eva=0) (artist.c line 217)
#4  0x2a38 in main (argc=0, argv=(char **) 0xf7fffb04) (artist.c line 189)
(gdb) up 1
Reading in symbols for tree.c...done.
#1  0x6bd4 in counttree (tre=(struct trenode *) 0x0, lev=128) (tree.c line 117)
117				return (countgroup(tre, lev));
(gdb) up 1
Reading in symbols for config.c...done.
#2  0x3a88 in configinit (lop=1, grp=0) (config.c line 151)
151			while (((tmp = counttree(tre, ini)) < 24) && (ini < hei)) {
(gdb) where
#0  countgroup (tre=(struct trenode *) 0x6f570, lev=-134219392) (group.c line 61)
61		cnt = 0;
#1  0x6bd4 in counttree (tre=(struct trenode *) 0x0, lev=128) (tree.c line 117)
#2  0x3a88 in configinit (lop=1, grp=0) (config.c line 151)
#3  0x2b6c in artist (nam=(char *) 0xf7fffb75 "fract", lop=1, grp=0, eva=0) (artist.c line 217)
#4  0x2a38 in main (argc=0, argv=(char **) 0xf7fffb04) (artist.c line 189)
(gdb) do 2
#0  countgroup (tre=(struct trenode *) 0x6f570, lev=-134219392) (group.c line 61)
61		cnt = 0;
(gdb) info frame
Stack level 0, frame at 0xf7fff888:
 pc = 0xcb7c in countgroup (group.c line 61); saved pc 0x6bd4
 called by frame at 0xf7fff8e8
 Arglist at 0xf7fff888, args: tre=(struct trenode *) 0x6f570, lev=-134219392
 Previous frame's sp is 0xf7fff888
 Saved registers:
  l0 at 0xf7fff828, l1 at 0xf7fff82c, l2 at 0xf7fff830, l3 at 0xf7fff834
  l4 at 0xf7fff838, l5 at 0xf7fff83c, l6 at 0xf7fff840, l7 at 0xf7fff844
  i0 at 0xf7fff848, i1 at 0xf7fff84c, i2 at 0xf7fff850, i3 at 0xf7fff854
  i4 at 0xf7fff858, i5 at 0xf7fff85c, fp at 0xf7fff860, i7 at 0xf7fff864
  pc at 0xf7fff864
(gdb) p tre
$1 = (struct trenode *) 0x7e524
(gdb) p lev
$2 = 0
(gdb) x/64w $sp
0xf7fff828:	0x00901085	0x00007080	0x00003a70	0x00000000
0xf7fff838:	0x00000002	0x00000000	0xf812f520	0x00000000
0xf7fff848:	0x0007e524	0x00000000	0x00022000	0x00000006
0xf7fff858:	0x00000007	0x0008a620	0xf7fff888	0x00006bcc
0xf7fff868:	0x00000000	0x00000004	0xf7fff898	0x00010118
0xf7fff878:	0xf7fff8a0	0xf775a3ac	0x82050002	0x000170c5
0xf7fff888:	0x00401086	0x00003a54	0x00003a58	0x00000000
0xf7fff898:	0x00000001	0xf80dc800	0xf80d5400	0xffffef58
0xf7fff8a8:	0x0007e524	0x00000000	0x0008d6a4	0x00000007
0xf7fff8b8:	0x00000008	0x00078e1c	0xf7fff8e8	0x00003a80
0xf7fff8c8:	0x00000001	0x0006f570	0xf7fff980	0x0001007c
0xf7fff8d8:	0xf812f520	0xf77a20dc	0x00023a5b	0xffffffff
0xf7fff8e8:	0x00000080	0xf7756950	0xf7756954	0x00000000
0xf7fff8f8:	0x00000006	0xf80dc800	0x00000028	0xffffef58
0xf7fff908:	0x00000001	0x00000000	0x00000000	0x00000008
0xf7fff918:	0x00000001	0x0007e524	0xf7fff958	0x00002b64
====================================================
- Notes
====================================================
Note that, as $1 and $2 above shows, the values of tre and lev
are 0x7e524 and 0, repectively. However #0 shows tre = 0x6f570 and
lev = -134219392 (= 0xf7fff980). Also, the values shown in #1 (tre = 0x0,
lev=128) are incorrect. They are 0x7e524 and 0, respectively.
In the stack dump above, the value for tre in frame #0 is at 0xf7fff848
and for lev at 0xf7fff84c. The value for tre in frame #1 is at 0xf7fff8a8
and for lev at 0xf7fff8ac. But gdb thinks that these values for frame #0 are
at addresses 0xf7fff8cc and 0xf7fff8d0 which are off by 0x84 bytes.
   I hoped I could fix the problem but due to my lack of knowledge on
sparc architecture, I can't do it. Do I have to wait until version 3.6
gets available?
---Soohong Kim
===================
soohong@psuvax1.cs.psu.edu   soohong@psuvax1.bitnet
UUCP: psuvax1!soohong
USPS: 333 Whitmore lab, University Park, PA 16802   phone:(814)234-0938
Technical Details
Message-ID: <9003130056.AA03312@blitz.cs.psu.edu>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!sunic!uupsi!rpi!brutus.cs.uiuc.edu!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!BLITZ.CS.PSU.EDU!soohong

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f5053,16aa3170377a7f99,start
X-Google-Attributes: gidf5053,public
X-Google-ArrivalTime: 1990-03-12 16:56:07 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!sunic!uupsi!rpi!brutus.cs.uiuc.edu!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!BLITZ.CS.PSU.EDU!soohong
From: soohong@BLITZ.CS.PSU.EDU (Soohong Kim)
Newsgroups: gnu.gdb.bug
Subject: Bug report on gdb 3.5 for sparc architecture
Message-ID: <9003130056.AA03312@blitz.cs.psu.edu>
Date: 13 Mar 90 00:56:07 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 137
Posted: Tue Mar 13 01:56:07 1990