Hello!
I am having trouble on Solaris 5.6 or 5.7 using gdb 4.16 or 4.17. I
have tried a few options, but I'm stuck.
After I attach to a running process that is currently blocking, gdb
will also wait on the process block if I try to run a function from the
process.
For example if the following application a.out is running:
#include <stdio.h>
static char x = 'x';
extern int main(int argc, char *argv[])
{
putchar(getchar());
exit(0);
}
extern char retx(void)
{
return(x);
}
and I use gdb as followes:
gdb a.out
GNU gdb 4.17
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty"
for details.
This GDB was configured as "sparc-sun-solaris2.6"...
(gdb) attach 20516
Attaching to program `/home/zapi0a/a.out', 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() /* here we block */
$2 = 120 'x'
The "p x" in gdb is fine, but the command "p retx()" blocks until
return is passed on the a.out applications stdin stream.
Sorry if this is somewhere in the FAQ's...
Any work-around would be Great!
Maybe I could send the process a signal before having the print command
run the "retx()" finction.
Thanks in advance for any time you spend looking at this!
Best regards!
Alan Insley


Sent via Deja.com http://www.deja.com/
Before you buy.

Reply via email to