[gnu.gdb.bug] Parsing C++ method names

bothner@decwrl.dec.com (Per Bothner) (01/20/89)

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