🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Per Bothner Fri, 20 Jan 1989 01:52
Parsing C++ method names
#678
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads