Hi!

On Solaris 2.6 or 2.7 using gdb 4.17 or 4.18 I cannot call a function in an
attached process,
If the process is waiting for input.

Any fix or workaround would be of great help!

For example the following application will cause gdb to hang when running
retx() in an expression:
#include <stdio.h>
#include <math.h>
static char x = 'x';
double y;

char retx(void) {  return(x); }

main() {
  putchar(getchar());
  y = sqrt(4.0);
}


The gdb session may look like this:
(gdb) attach 20516
Attaching to program `/home/t', process 20516
Reading symbols from /usr/lib/libc.so.1...done.
Reading symbols from /usr/lib/libdl.so.1...done.
Reading symbols from /usr/platform/SUNW,Ultra-
1/lib/libc_psr.so.1...done.
Symbols already loaded for /usr/lib/libc.so.1
Symbols already loaded for /usr/lib/libdl.so.1
Symbols already loaded for /usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1
0xef6b8680 in _read ()
(gdb) p x
$1 = 120 'x'
(gdb) p retx()           <== This doesn't return until the application gets
input.
$2 = 120 'x'

I can print x.
I can even disassemble retx, but I cannot call retx().

When the gdb command 'p retx()' is entered the gdb session will block until
the applications read block is satisfied.

Best Regards,
Alan Insley


Reply via email to