Path: utzoo!utgpu!watmath!iuvax!cica!tut.cis.ohio-state.edu!SIRIUS.CTR.COLUMBIA.EDU!jay From: jay@SIRIUS.CTR.COLUMBIA.EDU Newsgroups: gnu.g++.bug Subject: problem using gdb with libg++ arithmetic vectors Message-ID: <8910261805.AA00289@oboe.ctr.columbia.edu> Date: 26 Oct 89 18:05:47 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 89 I have been having problems using gdb to debug programs written using the generic arithmetic vectors provided by the genclass utility of libg++. I am using Version 1.35.0 of g++ and gcc on a Sun3/50 (with 68881) running SunOS4.0, with (what seems to be) version 1.35.1 of libg++, and version 3.2 of gdb. The problem is that gdb gives me a segmentation fault and dumps core whenever I try to print out an instance of the derived class doubleAVec. (It does fine with the base class doubleVec.) I generated the files double.Vec.[cc, h] and double.AVec.[cc,h] by: genclass double val AVec genclass double val Vec The test program: --------------------------------------------- #include #include main (int argc, char* argv[]) { doubleAVec control(10, 1.0); } --------------------------------------------- Following are the compilation and the gdb session: cd /home/elara/jay/src/gnu/bug/ make -k g++ -g -v -I. -c main.cc g++ version 1.35.0 /usr/local/lib/gcc/SunOS_4.x/gcc-cpp -+ -v -I. -undef -D__GNU__ -D__GNUG__ -D__cplusplus -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 main.cc /tmp/cca09409.cpp GNU CPP version 1.35 /usr/local/lib/gcc/SunOS_4.x/gcc-cc1plus /tmp/cca09409.cpp -quiet -dumpbase main.cc -noreg -version -G -o /tmp/cca09409.s GNU C++ version 1.35.0 (68k, MIT syntax) compiled by GNU C version 1.35. as -mc68020 /tmp/cca09409.s -o main.o g++ -g -v -I. -c double.AVec.cc g++ version 1.35.0 /usr/local/lib/gcc/SunOS_4.x/gcc-cpp -+ -v -I. -undef -D__GNU__ -D__GNUG__ -D__cplusplus -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 double.AVec.cc /tmp/cca09414.cpp GNU CPP version 1.35 /usr/local/lib/gcc/SunOS_4.x/gcc-cc1plus /tmp/cca09414.cpp -quiet -dumpbase double.AVec.cc -noreg -version -G -o /tmp/cca09414.s GNU C++ version 1.35.0 (68k, MIT syntax) compiled by GNU C version 1.35. as -mc68020 /tmp/cca09414.s -o double.AVec.o g++ -g -v -I. -c double.Vec.cc g++ version 1.35.0 /usr/local/lib/gcc/SunOS_4.x/gcc-cpp -+ -v -I. -undef -D__GNU__ -D__GNUG__ -D__cplusplus -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 double.Vec.cc /tmp/cca09430.cpp GNU CPP version 1.35 /usr/local/lib/gcc/SunOS_4.x/gcc-cc1plus /tmp/cca09430.cpp -quiet -dumpbase double.Vec.cc -noreg -version -G -o /tmp/cca09430.s GNU C++ version 1.35.0 (68k, MIT syntax) compiled by GNU C version 1.35. as -mc68020 /tmp/cca09430.s -o double.Vec.o g++ -g -v -I. -o buggy main.o double.AVec.o double.Vec.o g++ version 1.35.0 /usr/local/lib/gcc/SunOS_4.x/gcc-ld++ -o buggy -C -dc -dp -Bstatic /usr/local/lib/gcc/SunOS_4.x/crt0+.o /lib/Mcrt1.o main.o double.AVec.o double.Vec.o -lg++ /usr/local/lib/gcc/SunOS_4.x/gcc-gnulib -lg -lc Compilation finished at Thu Oct 26 11:01:53 Current directory is /home/elara/jay/src/gnu/bug/ GDB 3.2, Copyright (C) 1988 Free Software Foundation, Inc. There is ABSOLUTELY NO WARRANTY for GDB; type "info warranty" for details. GDB is free software and you are welcome to distribute copies of it under certain conditions; type "info copying" to see the conditions. Reading symbol data from /home/elara/jay/src/gnu/bug/buggy...done. Type "help" for a list of commands. (gdb) break main Reading in symbols for main.cc...done. Breakpoint 1 at 0x220e: file main.cc, line 5. (gdb) run Starting program: /home/elara/jay/src/gnu/bug/buggy Bpt 1, main (argc=1, argv=(char **) 0xefffd40) (main.cc line 7) (gdb) list 2 #include 3 4 main (int argc, char* argv[]) 5 { 6 doubleAVec control(10, 1.0); 7 } 8 (gdb) info locals control = { Inferior Gdb segmentation fault (core dumped) Am I missing something here?