Article View: gnu.gcc.bug
Article #1184GCC2.2.2/dbx bug
From: Sam McCall
Date: Fri, 09 Oct 1992 20:27
Date: Fri, 09 Oct 1992 20:27
92 lines
3484 bytes
3484 bytes
i've run into the following bizarre behavior with gcc 2.2.2 and
dbx on a sparcstation running sunos 4.1.1B and 4.1.2.
when i install breakpoints in loops with dbx and then step through
them, dbx reports that the address/process is no longer writeable.
this worked with gcc 1.39, same hardware and operating system.
is this a bug with dbx that's being massaged by gcc, or is it truly
a problem with the code generated by gcc?
i'd appreciate responses sent directly to me, as i can't read this
group as often as i'd like.
email: Sam.McCall@ucdavis.edu
------------- typescript follows --------------
Script started on Fri Oct 9 13:20:12 1992
chip% ls
./ ../ t.c typescript
chip% gcc -v -g -o t t.c
Reading specs from /usr/pkg/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/specs
gcc version 2.2.2
/usr/pkg/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/cpp -lang-c -v -undef -D__GNUC__=2 -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix -g t.c /usr/tmp/cca11655.i
GNU CPP version 2.2.2 (sparc)
/usr/pkg/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/cc1 /usr/tmp/cca11655.i -quiet -dumpbase t.c -g -version -o /usr/tmp/cca11655.s
GNU C version 2.2.2 (sparc) compiled by GNU C version 2.2.2.
as -o t.o /usr/tmp/cca11655.s
/usr/pkg/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/ld -e start -dc -dp -o t /lib/crt0.o -L/usr/pkg/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2 -L/usr/pkg/gnu/lib t.o -lgcc -lc -lg -lgcc
chip% dbx t
Reading symbolic information...
Read 117 symbols
(dbx) list
6 {
7 long v[100];
8 int i;
9
10 for(i=0;i<100;i++)
11 v[i]=(long)i*i;
12 for(i=100;i;i--)
13 printf("v[%d] is %ld\n",i);
14 }
(dbx) stop at 10
(2) stop at "/home1/ccsam/tmp/t.c":10
(dbx) run
Running: t
stopped in main at line 10 in file "t.c"
10 for(i=0;i<100;i++)
(dbx) step
stopped in main at line 11 in file "t.c"
11 v[i]=(long)i*i;
(dbx) step
stopped in main at line 10 in file "t.c"
10 for(i=0;i<100;i++)
(dbx) step
can't write to process (address 0x10022b8)
May be unwriteable address, unwriteable process, etc (see ptrace(2))
(dbx) quit
chip% dbx t
Reading symbolic information...
Read 117 symbols
(dbx) stop at 13
(2) stop at "/home1/ccsam/tmp/t.c":13
(dbx) run
Running: t
stopped in main at line 13 in file "t.c"
13 printf("v[%d] is %ld\n",i);
(dbx) step
v[100] is 0
stopped in main at line 12 in file "t.c"
12 for(i=100;i;i--)
(dbx) step
can't write to process (address 0x1002304)
May be unwriteable address, unwriteable process, etc (see ptrace(2))
(dbx) quit
chip% cat t.c
#include <stdio.h>
main(ac,av)
int ac;
char **av;
{
long v[100];
int i;
for(i=0;i<100;i++)
v[i]=(long)i*i;
for(i=100;i;i--)
printf("v[%d] is %ld\n",i);
}
chip%
script done on Fri Oct 9 13:21:16 1992
Technical Details
Message-ID:
<17995@ucdavis.ucdavis.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucdavis.edu!samccallShow Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucdavis.edu!samccall From: samccall@ucdavis.edu (Sam McCall) Subject: GCC2.2.2/dbx bug Message-ID: <17995@ucdavis.ucdavis.edu> Sender: gnulists@ai.mit.edu Organization: Computing Services, UC Davis Distribution: gnu Date: Fri, 9 Oct 1992 20:27:35 GMT Approved: bug-gcc@prep.ai.mit.edu Lines: 93