🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #10232

breakpoints on g++ programs

#10232
From: James Clark
Date: Fri, 03 Nov 1989 22:35
67 lines
2914 bytes
gdb 3.3 gets a segmentation fault on almost any attempt
to set a breakpoint on a C++ method. This happens both
on a sun4-os4 and i386gas-sysv3.2. For example,

Script started on Fri Nov  3 22:30:45 1989
yquem% cat bug.cc
struct A {
  foo();
};

A::foo()
{
}

main()
{
  return 0;
}
yquem% gcc -g -v bug.cc -lg++
gcc version 1.36
 /usr/local/lib/gcc-cpp -+ -v -undef -D__GNUC__ -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ bug.cc /usr/tmp/cca14589.cpp
GNU CPP version 1.36
 /usr/local/lib/gcc-cc1plus /usr/tmp/cca14589.cpp -quiet -dumpbase bug.cc -g -version -o /usr/tmp/cca14589.s
GNU C++ version 1.36.0- (based on GCC 1.36) (sparc) compiled by GNU C version 1.36.
default target switches: -mfpu -mepilogue
 /usr/local/lib/gcc-as -o bug.o /usr/tmp/cca14589.s
 /usr/local/lib/gcc-ld -e start -dc -dp -Bstatic /lib/crt0.o bug.o -lg++ /usr/local/lib/gcc-gnulib -lg -lc
yquem% /usr/local/gdb-3.3/gdb a.out
GDB 3.3, Copyright (C) 1989 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 /usr/jjc/a.out...done.
Type "help" for a list of commands.
(gdb) break A::foo
Reading in symbols for bug.cc...done.
Segmentation fault (core dumped)
yquem% exit
yquem% 
script done on Fri Nov  3 22:32:07 1989

The following seems to fix it. The line I've commented out doesn't
make any sense at all.

*** ../dist-gdb/symtab.c	Thu Sep 21 21:29:48 1989
--- symtab.c	Fri Nov  3 20:38:28 1989
***************
*** 1567,1573 ****
  		     that depends on knowing the name of D.  */
  		  if (class_name)
  		    {
! 		      while (*class_name++ != ' ');
  
  		      sym_class = lookup_symbol (class_name, 0, STRUCT_NAMESPACE, 0);
  		      for (method_counter = TYPE_NFN_FIELDS (SYMBOL_TYPE (sym_class)) - 1;
--- 1567,1573 ----
  		     that depends on knowing the name of D.  */
  		  if (class_name)
  		    {
! 		      /* while (*class_name++ != ' '); */
  
  		      sym_class = lookup_symbol (class_name, 0, STRUCT_NAMESPACE, 0);
  		      for (method_counter = TYPE_NFN_FIELDS (SYMBOL_TYPE (sym_class)) - 1;


James Clark
jjc@jclark.uucp
Technical Details
Message-ID: <8911032235.AA00838@jclark.uucp>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!samsung!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!relay.eu.net!jclark!jjc

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f5053,6f0a216fbe4582b6,start
X-Google-Attributes: gidf5053,public
X-Google-ArrivalTime: 1989-11-03 17:01:49 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!samsung!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!relay.eu.net!jclark!jjc
From: jclark!jjc@relay.eu.net (James Clark)
Newsgroups: gnu.gdb.bug
Subject: breakpoints on g++ programs
Message-ID: <8911032235.AA00838@jclark.uucp>
Date: 3 Nov 89 22:35:08 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 67
Posted: Fri Nov  3 23:35:08 1989