Thread View: gnu.gcc.bug
1 messages
1 total messages
Started by Sam McCall
Fri, 09 Oct 1992 20:27
GCC2.2.2/dbx bug
Author: 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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads