This is a follow-up to the bug report I filed a few days ago. I have
fixed one of the bugs, but the second bug (the one which prevents
calling functions from gdb) appears to be an interaction with Solaris
2.7 patches.
We have a number of different Sun machines (Sparcs, Ultra-1s,
Ultra-5s, 450s, 6500s, etc.), some running at different patch levels.
The ones at patch level 106541-07 or below don't exhibit any problems
with gdb-4.17 or gdb-4.18. However, the machines at patch level
106541-08 and 106541-09 exhibit the bug. To make matters more
confusing, all versions of gdb work on another machine with patch
level 106541-09, but that machine has lots of other patches not on any
other machines.
In any case, we are about to undertake the project of trying to figure
out which Sun patches cause and/or fix the problem. Of course, Sun
won't help because gdb is not a Sun product. And RedHat/Cygnus won't
be able to help because they'd need to reproduce our patch-level
environment to even generate the problem. Very frustrating.
If anyone out there has the same problem that we do, please send me
some e-mail and let me know what patch level your machine is running
at. All of our problems are occurring on Ultras running 64-bit
kernels.
Thanks in advance,
-- David Magerman
[EMAIL PROTECTED]
P.S. - Here is a brief summary of the bug:
Given the program:
foo.C:
---------
int baz(int k) { return k; }
int main() { int i = baz(15); return 0; }
compiled using g++-2.95.2, I get the following behavior:
bat:~> gdb-4.18 a.out
GNU gdb 4.18
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.7"...
(gdb) break main
Breakpoint 1 at 0x10568: file foo.C, line 2.
(gdb) run
Starting program: /home/magerman/a.out
Breakpoint 1, main () at foo.C:2
2 int main() { int i = baz(15); return 0; }
(gdb) print baz(20)
Program received signal SIGSEGV, Segmentation fault.
<function called from gdb>
The program being debugged stopped while in a function called from GDB.
When the function (baz(int)) is done executing, GDB will silently
stop (instead of continuing to evaluate the expression containing
the function call).
(gdb) quit
bat:~>