(yylex): Don't return THIS.
* cp-valprint.c (vtbl_ptr_name_old): Delete.
(cp_is_vtbl_ptr_type): Don't check vtbl_ptr_name_old.
* demangle.c (cplus_markers): Update comment. Put '$'
first. Remove CPLUS_MARKER.
(_initialize_demangler): Don't call set_cplus_marker_for_demangling.
* jv-exp.y (THIS): Delete token and grammar rule.
(yylex): Don't return THIS.
* mips-tdep.c (mips_dump_tdep): Don't dump CPLUS_MARKER.
* objc-exp.y (THIS): Delete token and grammar rule.
(yylex): Don't return THIS.
* p-exp.y (yylex): Remove reference to CPLUS_MARKER.
* stabsread.c (vptr_name, vb_name): Replace CPLUS_MARKER with '$'.
(read_member_functions): Likewise for opname.
(read_tilde_fields): Use is_cplus_marker.
* defs.h (CPLUS_MARKER): Don't define.
* config/tm-sysv4.h (CPLUS_MARKER): Likewise.
* config/i386/xm-i386sco.h (CPLUS_MARKER): Likewise.
* config/mips/tm-irix3.h (CPLUS_MARKER): Likewise.
* config/mips/tm-irix6.h (CPLUS_MARKER): Likewise.
* config/rs6000/tm-rs6000.h (CPLUS_MARKER): Likewise.
* config/i386/tm-i386v4.h: Delete file.
* config/djgpp/fnchange.lst: Delete tm-i386v4.h.
* config/i386/tm-i386sol2.h: Include "i386/tm-i386.h" instead.
* config/i386/tm-i386v42mp.h: Include "i386/tm-i386.h" instead.
* config/i386/tm-ptx.h: Include "i386/tm-i386.h" instead.
* config/i386/i386gnu.mt (TM_FILE): Use tm-i386.h.
* config/i386/i386sco5.mt (TM_FILE): Likewise.
* config/i386/i386v4.mt (TM_FILE): Likewise.
* config/i386/ncr3000.mt (TM_FILE): Likewise.
+2002-10-11 Daniel Jacobowitz <drow@mvista.com>
+
+ * c-exp.y (THIS): Delete token and grammar rule.
+ (yylex): Don't return THIS.
+ * cp-valprint.c (vtbl_ptr_name_old): Delete.
+ (cp_is_vtbl_ptr_type): Don't check vtbl_ptr_name_old.
+ * demangle.c (cplus_markers): Update comment. Put '$'
+ first. Remove CPLUS_MARKER.
+ (_initialize_demangler): Don't call set_cplus_marker_for_demangling.
+ * jv-exp.y (THIS): Delete token and grammar rule.
+ (yylex): Don't return THIS.
+ * mips-tdep.c (mips_dump_tdep): Don't dump CPLUS_MARKER.
+ * objc-exp.y (THIS): Delete token and grammar rule.
+ (yylex): Don't return THIS.
+ * p-exp.y (yylex): Remove reference to CPLUS_MARKER.
+ * stabsread.c (vptr_name, vb_name): Replace CPLUS_MARKER with '$'.
+ (read_member_functions): Likewise for opname.
+ (read_tilde_fields): Use is_cplus_marker.
+
+ * defs.h (CPLUS_MARKER): Don't define.
+ * config/tm-sysv4.h (CPLUS_MARKER): Likewise.
+ * config/i386/xm-i386sco.h (CPLUS_MARKER): Likewise.
+ * config/mips/tm-irix3.h (CPLUS_MARKER): Likewise.
+ * config/mips/tm-irix6.h (CPLUS_MARKER): Likewise.
+ * config/rs6000/tm-rs6000.h (CPLUS_MARKER): Likewise.
+
+ * config/i386/tm-i386v4.h: Delete file.
+ * config/djgpp/fnchange.lst: Delete tm-i386v4.h.
+ * config/i386/tm-i386sol2.h: Include "i386/tm-i386.h" instead.
+ * config/i386/tm-i386v42mp.h: Include "i386/tm-i386.h" instead.
+ * config/i386/tm-ptx.h: Include "i386/tm-i386.h" instead.
+ * config/i386/i386gnu.mt (TM_FILE): Use tm-i386.h.
+ * config/i386/i386sco5.mt (TM_FILE): Likewise.
+ * config/i386/i386v4.mt (TM_FILE): Likewise.
+ * config/i386/ncr3000.mt (TM_FILE): Likewise.
+
2002-10-10 Marko Mlinar <markom@opencores.org>
* infrun.c (resume): Convert #ifdef HAVE_NONSTEPPABLE_WATCHPOINT into C,
%token <opcode> ASSIGN_MODIFY
/* C++ */
-%token THIS
%token TRUEKEYWORD
%token FALSEKEYWORD
;
/* C++. */
-exp : THIS
- { write_exp_elt_opcode (OP_THIS);
- write_exp_elt_opcode (OP_THIS); }
- ;
-
exp : TRUEKEYWORD
{ write_exp_elt_opcode (OP_LONG);
write_exp_elt_type (builtin_type_bool);
{
if (STREQN (tokstart, "true", 4))
return TRUEKEYWORD;
-
- if (STREQN (tokstart, "this", 4))
- {
- static const char this_name[] =
- { CPLUS_MARKER, 't', 'h', 'i', 's', '\0' };
-
- if (lookup_symbol (this_name, expression_context_block,
- VAR_NAMESPACE, (int *) NULL,
- (struct symtab **) NULL))
- return THIS;
- }
}
break;
case 3:
@V@/gdb/config/i386/nm-i386v42mp.h @V@/gdb/config/i386/nm-v42mp.h
@V@/gdb/config/i386/tm-i386mk.h @V@/gdb/config/i386/tm-mk.h
@V@/gdb/config/i386/tm-i386sol2.h @V@/gdb/config/i386/tm-sol2.h
-@V@/gdb/config/i386/tm-i386v4.h @V@/gdb/config/i386/tm-v4.h
@V@/gdb/config/i386/tm-i386v42mp.h @V@/gdb/config/i386/tm-v42mp.h
@V@/gdb/config/i386/xm-i386mach.h @V@/gdb/config/i386/xm-mach.h
@V@/gdb/config/i386/xm-i386mk.h @V@/gdb/config/i386/xm-mk.h
# Target: Intel 386 running the GNU Hurd
TDEPFILES= i386-tdep.o i387-tdep.o i386gnu-tdep.o
-TM_FILE= tm-i386v4.h
+TM_FILE= tm-i386.h
# Target: Intel 386 running SCO Open Server 5
TDEPFILES= i386-tdep.o i387-tdep.o
-TM_FILE= tm-i386v4.h
+TM_FILE= tm-i386.h
# Target: Intel 386 running SVR4
TDEPFILES= i386-tdep.o i387-tdep.o
-TM_FILE= tm-i386v4.h
+TM_FILE= tm-i386.h
# Target: Intel 386 running SVR4
TDEPFILES= i386-tdep.o i387-tdep.o solib.o solib-svr4.o solib-legacy.o
-TM_FILE= tm-i386v4.h
+TM_FILE= tm-i386.h
#ifndef TM_I386SOL2_H
#define TM_I386SOL2_H 1
-#include "i386/tm-i386v4.h"
+#include "i386/tm-i386.h"
/* The SunPRO compiler puts out 0 instead of the address in N_SO symbols,
and for SunPRO 3.0, N_FUN symbols too. */
+++ /dev/null
-/* Macro definitions for GDB on an Intel i386 running SVR4.
- Copyright 1991, 1994, 1995, 1998, 1999, 2000, 2002
- Free Software Foundation, Inc.
- Written by Fred Fish at Cygnus Support (fnf@cygnus.com)
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef TM_I386V4_H
-#define TM_I386V4_H 1
-
-/* Pick up most of what we need from the generic i386 target include file. */
-#include "i386/tm-i386.h"
-
-/* It is unknown which, if any, SVR4 assemblers do not accept dollar signs
- in identifiers. The default in G++ is to use dots instead, for all SVR4
- systems, so we make that our default also. FIXME: There should be some
- way to get G++ to tell us what CPLUS_MARKER it is using, perhaps by
- stashing it in the debugging information as part of the name of an
- invented symbol ("gcc_cplus_marker$" for example). */
-
-#undef CPLUS_MARKER
-#define CPLUS_MARKER '.'
-
-#endif /* ifndef TM_I386V4_H */
/* pick up more generic x86 sysv4 stuff */
-#include "i386/tm-i386v4.h"
+#include "i386/tm-i386.h"
/* define to select for other sysv4.2mp weirdness (see procfs.c) */
#include <sys/reg.h>
#ifdef SEQUENT_PTX4
-#include "i386/tm-i386v4.h"
+#include "i386/tm-i386.h"
#else /* !SEQUENT_PTX4 */
#include "i386/tm-i386.h"
#endif
GDB does not currently support the termio/job control combination. */
#undef HAVE_TERMIO
#define HAVE_TERMIOS
-
-/* SCO's assembler doesn't grok dollar signs in identifiers.
- So we use dots instead. This item must be coordinated with G++. */
-#undef CPLUS_MARKER
-#define CPLUS_MARKER '.'
#include "mips/tm-bigmips.h"
-/* SGI's assembler doesn't grok dollar signs in identifiers.
- So we use dots instead. This item must be coordinated with G++. */
-#undef CPLUS_MARKER
-#define CPLUS_MARKER '.'
-
/* Redefine register numbers for SGI. */
#undef NUM_REGS
#include "mips/tm-bigmips64.h"
#include "solib.h"
-/* SGI's assembler doesn't grok dollar signs in identifiers.
- So we use dots instead. This item must be coordinated with G++. */
-#undef CPLUS_MARKER
-#define CPLUS_MARKER '.'
-
/* Redefine register numbers for SGI. */
#undef NUM_REGS
#define TEXT_SEGMENT_BASE 0x10000000
-/* AIX's assembler doesn't grok dollar signs in identifiers.
- So we use dots instead. This item must be coordinated with G++. */
-#undef CPLUS_MARKER
-#define CPLUS_MARKER '.'
-
/* Return whether PC in function NAME is in code that should be skipped when
single-stepping. */
where the function itself actually starts. If not, return 0. */
#define SKIP_TRAMPOLINE_CODE(pc) find_solib_trampoline_target (pc)
-
-/* It is unknown which, if any, SVR4 assemblers do not accept dollar signs
- in identifiers. The default in G++ is to use dots instead, for all SVR4
- systems, so we make that our default also. FIXME: There should be some
- way to get G++ to tell us what CPLUS_MARKER it is using, perhaps by
- stashing it in the debugging information as part of the name of an
- invented symbol ("gcc_cplus_marker$" for example). */
-
-#undef CPLUS_MARKER
-#define CPLUS_MARKER '.'
}
}
-/* This was what it was for gcc 2.4.5 and earlier. */
-static const char vtbl_ptr_name_old[] =
-{
- CPLUS_MARKER, 'v', 't', 'b', 'l', '_', 'p', 't', 'r', '_',
- 't', 'y', 'p', 'e', 0
-};
-
-/* It was changed to this after 2.4.5. */
+/* GCC versions after 2.4.5 use this. */
const char vtbl_ptr_name[] = "__vtbl_ptr_type";
-/* HP aCC uses different names */
+/* HP aCC uses different names. */
const char hpacc_vtbl_ptr_name[] = "__vfp";
const char hpacc_vtbl_ptr_type_name[] = "__vftyp";
-
/* Return truth value for assertion that TYPE is of the type
"pointer to virtual function". */
{
char *typename = type_name_no_tag (type);
- return (typename != NULL
- && (STREQ (typename, vtbl_ptr_name)
- || STREQ (typename, vtbl_ptr_name_old)));
+ return (typename != NULL && !strcmp (typename, vtbl_ptr_name));
}
/* Return truth value for the assertion that TYPE is of the type
#define STREQ(a,b) (*(a) == *(b) ? !strcmp ((a), (b)) : 0)
#define STREQN(a,b,c) (*(a) == *(b) ? !strncmp ((a), (b), (c)) : 0)
-/* The character GNU C++ uses to build identifiers that must be unique from
- the program's identifiers (such as $this and $$vptr). */
-#define CPLUS_MARKER '$' /* May be overridden to '.' for SysV */
-
/* Check if a character is one of the commonly used C++ marker characters. */
extern int is_cplus_marker (int);
set_demangling_command ((char *) NULL, 0, (struct cmd_list_element *) NULL);
}
-/* In order to allow a single demangler executable to demangle strings
- using various common values of CPLUS_MARKER, as well as any specific
- one set at compile time, we maintain a string containing all the
- commonly used ones, and check to see if the marker we are looking for
- is in that string. CPLUS_MARKER is usually '$' on systems where the
- assembler can deal with that. Where the assembler can't, it's usually
- '.' (but on many systems '.' is used for other things). We put the
- current defined CPLUS_MARKER first (which defaults to '$'), followed
- by the next most common value, followed by an explicit '$' in case
- the value of CPLUS_MARKER is not '$'.
-
- We could avoid this if we could just get g++ to tell us what the actual
- cplus marker character is as part of the debug information, perhaps by
- ensuring that it is the character that terminates the gcc<n>_compiled
- marker symbol (FIXME). */
-
-static char cplus_markers[] =
-{CPLUS_MARKER, '.', '$', '\0'};
+/* G++ uses a special character to indicate certain internal names. Which
+ character it is depends on the platform:
+ - Usually '$' on systems where the assembler will accept that
+ - Usually '.' otherwise (this includes most sysv4-like systems and most
+ ELF targets)
+ - Occasionally '_' if neither of the above is usable
+
+ We check '$' first because it is the safest, and '.' often has another
+ meaning. We don't currently try to handle '_' because the precise forms
+ of the names are different on those targets. */
+
+static char cplus_markers[] = {'$', '.', '\0'};
int
is_cplus_marker (int c)
/* Set the default demangling style chosen at compilation time. */
set_demangling_style (DEFAULT_DEMANGLING_STYLE);
- set_cplus_marker_for_demangling (CPLUS_MARKER);
}
%token <opcode> ASSIGN_MODIFY
-%token THIS SUPER NEW
+%token SUPER NEW
%left ','
%right '=' ASSIGN_MODIFY
PrimaryNoNewArray:
Literal
-| THIS
- { write_exp_elt_opcode (OP_THIS);
- write_exp_elt_opcode (OP_THIS); }
| '(' Expression ')'
| ClassInstanceCreationExpression
| FieldAccess
yylval.lval = 1;
return BOOLEAN_LITERAL;
}
- if (current_language->la_language == language_cplus
- && STREQN (tokstart, "this", 4))
- {
- static const char this_name[] =
- { CPLUS_MARKER, 't', 'h', 'i', 's', '\0' };
-
- if (lookup_symbol (this_name, expression_context_block,
- VAR_NAMESPACE, (int *) NULL,
- (struct symtab **) NULL))
- return THIS;
- }
break;
case 3:
if (STREQN (tokstart, "int", 3))
"mips_dump_tdep: CAUSE_REGNUM = %d\n",
CAUSE_REGNUM);
fprintf_unfiltered (file,
- "mips_dump_tdep: CPLUS_MARKER = %c\n",
- CPLUS_MARKER);
- fprintf_unfiltered (file,
"mips_dump_tdep: DO_REGISTERS_INFO # %s\n",
XSTRING (DO_REGISTERS_INFO));
fprintf_unfiltered (file,
%token <opcode> ASSIGN_MODIFY
-/* C++ */
-%token THIS
-
%left ','
%left ABOVE_COMMA
%right '=' ASSIGN_MODIFY
write_exp_elt_opcode (OP_NSSTRING); }
;
-/* C++. */
-exp : THIS
- { write_exp_elt_opcode (OP_THIS);
- write_exp_elt_opcode (OP_THIS); }
- ;
-
-/* end of C++. */
-
block : BLOCKNAME
{
if ($1.sym != 0)
return ENUM;
if (STREQN (tokstart, "long", 4))
return LONG;
- if (current_language->la_language == language_cplus
- && STREQN (tokstart, "this", 4))
- {
- static const char this_name[] = {
- CPLUS_MARKER, 't', 'h', 'i', 's', '\0'
- };
-
- if (lookup_symbol (this_name, expression_context_block,
- VAR_NAMESPACE, (int *) NULL,
- (struct symtab **) NULL))
- return THIS;
- }
break;
case 3:
if (STREQN (tokstart, "int", 3))
{
/* here we search for 'this' like
inserted in FPC stabs debug info */
- static const char this_name[] =
- { /* CPLUS_MARKER,*/ 't', 'h', 'i', 's', '\0' };
+ static const char this_name[] = "this";
if (lookup_symbol (this_name, expression_context_block,
VAR_NAMESPACE, (int *) NULL,
void stabsread_clear_cache (void);
-static const char vptr_name[] =
-{'_', 'v', 'p', 't', 'r', CPLUS_MARKER, '\0'};
-static const char vb_name[] =
-{'_', 'v', 'b', CPLUS_MARKER, '\0'};
+static const char vptr_name[] = "_vptr$";
+static const char vb_name[] = "_vb$";
/* Define this as 1 if a pcc declaration of a char or short argument
gives the correct address. Otherwise assume pcc gives the
/* This lets the user type "break operator+".
We could just put in "+" as the name, but that wouldn't
work for "*". */
- static char opname[32] =
- {'o', 'p', CPLUS_MARKER};
+ static char opname[32] = "op$";
char *o = opname + 3;
/* Skip past '::'. */
i >= TYPE_N_BASECLASSES (t);
--i)
{
- if (!strncmp (TYPE_FIELD_NAME (t, i), vptr_name,
- sizeof (vptr_name) - 1))
+ char *name = TYPE_FIELD_NAME (t, i);
+ if (!strncmp (name, vptr_name, sizeof (vptr_name) - 2)
+ && is_cplus_marker (name[sizeof (vptr_name) - 1]))
{
TYPE_VPTR_FIELDNO (type) = i;
goto gotit;