🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #678

Parsing C++ method names

#678
From: Per Bothner
Date: Fri, 20 Jan 1989 01:52
46 lines
1749 bytes
I'm trying to use gdb 3.0 (running on VAX Ultrix) to debug C++ programs.
The command:
b ClassName::methodName
causes a crash in decode_line_1 (symtab.c).

One problem is that the parsing is done wrong. The patch below fixes
that problem. However, it still crashes because inheritance does not
work (as mentioned in a previous bug report).
A temporary fix for the latter problem to comment out the lines 1277-1279:
#if 0
                  if (TYPE_N_BASECLASSES (t))
                    t = TYPE_BASECLASS(t, 1);
                  else
#endif

*** symtab.c.dist	Tue Dec 20 15:02:35 1988
--- symtab.c	Thu Jan 19 17:02:01 1989
***************
*** 1202,1211
  	{
  	  /* Extract the class name.  */
  	  p1 = p;
! 	  while (p != *argptr && p[-1] == ' ') --p;
! 	  copy = (char *) alloca (p - *argptr + 1);
! 	  bcopy (*argptr, copy, p - *argptr);
! 	  copy[p - *argptr] = 0;
  
  	  /* Discard the class name from the arg.  */
  	  p = p1 + 2;

--- 1202,1211 -----
  	{
  	  /* Extract the class name.  */
  	  p1 = p;
! 	  while (p != *argptr && p[-1] != ' ' && p[-1] != '\t') --p;
! 	  copy = (char *) alloca (p1 - *argptr + 1);
! 	  bcopy (*argptr, copy, p1 - *argptr);
! 	  copy[p1 - *argptr] = 0;
  
  	  /* Discard the class name from the arg.  */
  	  p = p1 + 2;

-- 
	--Per Bothner
Western Software Lab, Digital Equipment, 100 Hamilton Ave, Palo Alto CA 94301
bothner@wsl.dec.com ...!decwrl!bothner
Technical Details
Message-ID: <1031@bacchus.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!xanth!ames!eos!agate!ucbvax!decwrl!bothner

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!xanth!ames!eos!agate!ucbvax!decwrl!bothner
From: bothner@decwrl.dec.com (Per Bothner)
Newsgroups: gnu.gdb.bug
Subject: Parsing C++ method names
Message-ID: <1031@bacchus.dec.com>
Date: 20 Jan 89 01:52:58 GMT
Organization: DEC Western Research Lab
Lines: 46