Thread View: gnu.gdb.bug
1 messages
1 total messages
Started by Joseph
Wed, 04 Nov 1992 22:14
gdb core dump on member function pointer
Author: Joseph
Date: Wed, 04 Nov 1992 22:14
Date: Wed, 04 Nov 1992 22:14
69 lines
2541 bytes
2541 bytes
This bug has been reported for a previous version of gdb,
and is present in 4.7.
/****************** C++ code ******************/
class X {
public:
void y(int i);
typedef void
(X::*IterateFunc)(int BlockNo);
void f(IterateFunc itf);
};
void X::y(int i) {
printf("i= %d\n", i);
}
void X::f(IterateFunc itf) {
(*itf)(4);
}
int main(int ac, char *av[])
{
X x;
x.f(& X::y);
}
/****************** C++ code ******************/
/****************** Compilation ***************/
compiled using g++ 2.2.2.
g++ -v -o b3 -g b3.cc
Reading specs from /lusr/local/lib/gcc-lib/sparc-sunos4/2.2.2/specs
gcc version 2.2.2
/lusr/local/lib/gcc-lib/sparc-sunos4/2.2.2/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix -g b3.cc /usr/tmp/cca09876.i
GNU CPP version 2.2.2 (sparc)
/lusr/local/lib/gcc-lib/sparc-sunos4/2.2.2/cc1plus /usr/tmp/cca09876.i -quiet -dumpbase b3.cc -g -version -o /usr/tmp/cca09876.s
GNU C++ version 2.2.2 (sparc) compiled by GNU C version 2.2.2.
b3.cc: In method `void X::y (int)':
b3.cc:12: warning: implicit declaration of function `printf'
as -o b3.o /usr/tmp/cca09876.s
/lusr/local/lib/gcc-lib/sparc-sunos4/2.2.2/ld -e start -dc -dp -o b3 /lib/crt0.o -L/lusr/local/lib/gcc-lib/sparc-sunos4/2.2.2 -L/lusr/local/lib b3.o -lg++ -lgcc -lc -lg -lgcc
/******************** GDB 4.7 compilation ***/
GDB has been configured for sparc (sunos4.1), with #define GCC_DEMANGLE_BUG on.
/********************* GDB 4.7 session *************/
Current directory is /home1/joseph/
GDB is free software and you are welcome to 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.
GDB 4.7, Copyright 1992 Free Software Foundation, Inc...
(gdb) break X::f
Breakpoint 1 at 0x22d4: file b3.cc, line 15.
(gdb) run
Starting program: /home1/joseph/b3
Inferior Gdb segmentation fault
-pepe
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads