Hi,
we believe that gdb 5.0 has some shortcomings wrt calling C++
functions. The basic complaint is that it takes too long. (see the
attached example.)
When I call the C++ function for the first time it takes about 7
seconds (P-II / 266) before the result appears. I think that this
delay is long enough to be called a bug.
/*
c++ -g -o display-scm display-scm.cc
*/
#include <stdio.h>
extern "C" {
// maybe gdb 5.0 becomes quicker if it doesn't do fancy C++ typing?
void
c_display_scm (int k)
{
printf ("foo %d\n", k);
};
};
void
cc_display_scm (int k)
{
printf ("foo %d\n", k);
}
int
main (int argc, char **argv)
{
int i = 1+ 1;
return 0;
}
(gdb) r
Breakpoint 2, main (argc=1, argv=0xbffff544) at g2.cc:27
Current language: auto; currently c++
(gdb) n
(gdb) p c_display_scm(i) # instantaneous
foo 2
$1 = void
(gdb) p cc_display_scm(i) # 7 second delay
foo 2
$2 = void
(gdb) p cc_display_scm(i) # 2 second delay
foo 2
$3 = void
--
Han-Wen Nienhuys | [EMAIL PROTECTED] | http://www.cs.uu.nl/~hanwen/