consult@GARNET.BERKELEY.EDU (Central Consulting) (10/18/89)
I have received (and verified the following bug) when using gdb version
3.1 on a Vax 8800 (garnet) running Ultrix 3.0.
The program just reads a string from standard input and prints
it on standard output:
#include <stdio.h>
main()
{
char line[100];
printf("Enter string: ");
if (scanf("%s", line) != 1) {
printf("Error!\n");
} else {
printf("String is %s.\n", line);
}
}
If I run this program with Gdb on Garnet, here's what happens:
garnet: gdb a.out
GDB 3.1, Copyright (C) 1988 Free Software Foundation, Inc.
There is ABSOLUTELY NO WARRANTY for GDB; type "info
warranty" for details. GDB is free software and you are
welcome to distribute copies of it under certain
conditions; type "info copying" to see the conditions.
Reading symbol data from
/garnet_m/c60b1/ouster/a.out...done.
Type "help" for a list of commands.
(gdb) r
Starting program: /garnet_m/c60b1/ouster/a.out
Enter string:
(gdb)
Apparently Gdb is not making the process the controlling one
for the terminal, so it can't read standard input. Without the
ability to read from the terminal, we're going to be in big
trouble in 60B. By the way, this program works fine if it's
run from the shell rather than from Gdb.
The same bug does not occur when running version 2.8:
I've placed a new copy of gdb in a directory called
"garnet:~c60b1/gdb". It is actually version 2.8, taken from an
MIT distribution file on Janus and compiled for Vaxes. Despite
it's age, it seem to work on Janus and Garnet, at least with
your sample file. I've left the test file source and binary
(compiled on garnet with gcc) in that directory, for
reference.
Here's the output now:
--------------------------------------------------------------------------
% cd /garnet_m/c60b1/gdb
% ./gdb test.out
GDB 2.8, Copyright (C) 1988 Free Software Foundation, Inc.
There is ABSOLUTELY NO WARRANTY for GDB; type "info warranty"
for details. GDB is free software and you are welcome to
distribute copies of it under certain conditions; type
"info copying" to see the conditions.
Reading symbol data from /garnet_m/c60b1/gdb/test.out...done.
Type "help" for a list of commands.
(gdb) r
Starting program: /garnet_m/c60b1/gdb/test.out
Enter string: asdafadsf
String is asdafadsf.
Program exited normally.
Regards, Michele Tomkin