🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #38

gdb core dump on member function pointer

#38
From: Joseph
Date: Wed, 04 Nov 1992 22:14
69 lines
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
Technical Details
Message-ID: <9211042214.AA05848@mama.uucp>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!iac.UUCP!joseph

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gdb.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!iac.UUCP!joseph
From: joseph@iac.UUCP ( Joseph )
Subject: gdb core dump on member function pointer
Message-ID: <9211042214.AA05848@mama.uucp>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 4 Nov 1992 22:14:25 GMT
Approved: bug-gdb@prep.ai.mit.edu
Lines: 70