* 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.
This commit is contained in:
Daniel Jacobowitz 2002-10-11 14:02:39 +00:00
parent 6d12fc3d08
commit 8343f86c90
24 changed files with 64 additions and 179 deletions

View File

@ -1,3 +1,39 @@
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,

View File

@ -199,7 +199,6 @@ static int parse_number (char *, int, int, YYSTYPE *);
%token <opcode> ASSIGN_MODIFY
/* C++ */
%token THIS
%token TRUEKEYWORD
%token FALSEKEYWORD
@ -532,11 +531,6 @@ exp : STRING
;
/* 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);
@ -1615,17 +1609,6 @@ yylex ()
{
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:

View File

@ -88,7 +88,6 @@
@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

View File

@ -1,3 +1,3 @@
# 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

View File

@ -1,3 +1,3 @@
# 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

View File

@ -1,3 +1,3 @@
# Target: Intel 386 running SVR4
TDEPFILES= i386-tdep.o i387-tdep.o
TM_FILE= tm-i386v4.h
TM_FILE= tm-i386.h

View File

@ -1,3 +1,3 @@
# 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

View File

@ -21,7 +21,7 @@
#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. */

View File

@ -1,39 +0,0 @@
/* 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 */

View File

@ -24,7 +24,7 @@
/* 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) */

View File

@ -30,7 +30,7 @@
#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

View File

@ -33,8 +33,3 @@
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 '.'

View File

@ -21,11 +21,6 @@
#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

View File

@ -22,11 +22,6 @@
#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

View File

@ -27,11 +27,6 @@
#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. */

View File

@ -35,13 +35,3 @@ extern int in_plt_section (CORE_ADDR, char *);
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 '.'

View File

@ -161,21 +161,13 @@ cp_print_class_method (char *valaddr,
}
}
/* 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". */
@ -184,9 +176,7 @@ cp_is_vtbl_ptr_type (struct type *type)
{
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

View File

@ -157,10 +157,6 @@ typedef bfd_vma CORE_ADDR;
#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);

View File

@ -150,24 +150,18 @@ set_demangling_style (char *style)
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 '$'.
/* 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 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). */
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[] =
{CPLUS_MARKER, '.', '$', '\0'};
static char cplus_markers[] = {'$', '.', '\0'};
int
is_cplus_marker (int c)
@ -204,5 +198,4 @@ Use `set demangle-style' without arguments for a list of demangling styles.",
/* Set the default demangling style chosen at compilation time. */
set_demangling_style (DEFAULT_DEMANGLING_STYLE);
set_cplus_marker_for_demangling (CPLUS_MARKER);
}

View File

@ -179,7 +179,7 @@ static int parse_number (char *, int, int, YYSTYPE *);
%token <opcode> ASSIGN_MODIFY
%token THIS SUPER NEW
%token SUPER NEW
%left ','
%right '=' ASSIGN_MODIFY
@ -365,9 +365,6 @@ Primary:
PrimaryNoNewArray:
Literal
| THIS
{ write_exp_elt_opcode (OP_THIS);
write_exp_elt_opcode (OP_THIS); }
| '(' Expression ')'
| ClassInstanceCreationExpression
| FieldAccess
@ -1167,17 +1164,6 @@ yylex ()
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))

View File

@ -6193,9 +6193,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
fprintf_unfiltered (file,
"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));

View File

@ -203,9 +203,6 @@ parse_number PARAMS ((char *, int, int, YYSTYPE *));
%token <opcode> ASSIGN_MODIFY
/* C++ */
%token THIS
%left ','
%left ABOVE_COMMA
%right '=' ASSIGN_MODIFY
@ -613,14 +610,6 @@ exp : NSSTRING /* ObjC NextStep NSString constant
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)
@ -1631,18 +1620,6 @@ yylex ()
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))

View File

@ -1358,8 +1358,7 @@ yylex ()
{
/* 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,

View File

@ -185,10 +185,8 @@ resolve_symbol_reference (struct objfile *, struct symbol *, char *);
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
@ -3179,8 +3177,7 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
/* 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 '::'. */
@ -4138,8 +4135,9 @@ read_tilde_fields (struct field_info *fip, char **pp, struct type *type,
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;