b3f11165aa
This factors out all the yy-variables remapping to a single file, instead of each parser having to do the same, with different prefixes. With this, a parser just needs to define the prefix they want and include yy-remap.h, which does the dirty job. Note this renames the c_error, ada_error, etc. functions. Writing the remapping pattern as: #define yyerror GDB_YY_REMAP (error) instead of: #define yyerror GDB_YY_REMAP (yyerror) would have avoided the renaming. However, that would be problematic if we have a macro 'foo' in scope, when we write: #define yyfoo GDB_YY_REMAP (foo) as that would expand 'foo'. The c_yyerror etc. naming end ups indicating that this is a yacc related function more clearly, so feels like a good change, anyway. gdb/ChangeLog: 2016-04-22 Pedro Alves <palves@redhat.com> * ada-exp.y: Remove all yy symbol remappings. (GDB_YY_REMAP_PREFIX): Define. Include "yy-remap.h". * ada-lang.c (ada_language_defn): Adjust. * ada-lang.h (ada_error): Rename to ... (ada_yyerror): ... this. * c-exp.y: Remove all yy symbol remappings. (GDB_YY_REMAP_PREFIX): Define. Include "yy-remap.h". * c-lang.c (c_language_defn, cplus_language_defn) (asm_language_defn, minimal_language_defn): Adjust. * c-lang.h (c_error): Rename to ... (c_yyerror): ... this. * d-exp.y: Remove all yy symbol remappings. (GDB_YY_REMAP_PREFIX): Define. Include "yy-remap.h". * d-lang.c (d_language_defn): Adjust. * d-lang.h (d_error): Rename to ... (d_yyerror): ... this. * f-exp.y: Remove all yy symbol remappings. (GDB_YY_REMAP_PREFIX): Define. Include "yy-remap.h". * f-lang.c (f_language_defn): Adjust. * f-lang.h (f_error): Rename to ... (f_yyerror): ... this. * go-exp.y: Remove all yy symbol remappings. (GDB_YY_REMAP_PREFIX): Define. Include "yy-remap.h". * go-lang.c (go_language_defn): Adjust. * go-lang.h (go_error): Rename to ... (go_yyerror): ... this. * jv-exp.y: Remove all yy symbol remappings. (GDB_YY_REMAP_PREFIX): Define. Include "yy-remap.h". * jv-lang.c (java_language_defn): Adjust. * jv-lang.h (java_error): Rename to ... (java_yyerror): ... this. * m2-exp.y: Remove all yy symbol remappings. (GDB_YY_REMAP_PREFIX): Define. Include "yy-remap.h". * m2-lang.c (m2_language_defn): Adjust. * m2-lang.h (m2_error): Rename to ... (m2_yyerror): ... this. * objc-exp.y: Remove all yy symbol remappings. (GDB_YY_REMAP_PREFIX): Define. Include "yy-remap.h". * objc-lang.c (objc_language_defn): Adjust. * opencl-lang.c (opencl_language_defn): Adjust. * p-exp.y: Remove all yy symbol remappings. (GDB_YY_REMAP_PREFIX): Define. Include "yy-remap.h". * p-lang.c (pascal_language_defn): Adjust. * p-lang.h (pascal_error): Rename to ... (pascal_yyerror): ... this. * yy-remap.h: New file.
94 lines
2.6 KiB
C
94 lines
2.6 KiB
C
/* Go language support definitions for GDB, the GNU debugger.
|
|
|
|
Copyright (C) 2012-2016 Free Software Foundation, Inc.
|
|
|
|
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 3 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, see <http://www.gnu.org/licenses/>. */
|
|
|
|
#if !defined (GO_LANG_H)
|
|
#define GO_LANG_H 1
|
|
|
|
struct type_print_options;
|
|
|
|
#include "gdbtypes.h"
|
|
#include "symtab.h"
|
|
#include "value.h"
|
|
|
|
struct parser_state;
|
|
|
|
struct builtin_go_type
|
|
{
|
|
struct type *builtin_void;
|
|
struct type *builtin_char;
|
|
struct type *builtin_bool;
|
|
struct type *builtin_int;
|
|
struct type *builtin_uint;
|
|
struct type *builtin_uintptr;
|
|
struct type *builtin_int8;
|
|
struct type *builtin_int16;
|
|
struct type *builtin_int32;
|
|
struct type *builtin_int64;
|
|
struct type *builtin_uint8;
|
|
struct type *builtin_uint16;
|
|
struct type *builtin_uint32;
|
|
struct type *builtin_uint64;
|
|
struct type *builtin_float32;
|
|
struct type *builtin_float64;
|
|
struct type *builtin_complex64;
|
|
struct type *builtin_complex128;
|
|
};
|
|
|
|
enum go_type
|
|
{
|
|
GO_TYPE_NONE, /* Not a Go object. */
|
|
GO_TYPE_STRING
|
|
};
|
|
|
|
/* Defined in go-exp.y. */
|
|
|
|
extern int go_parse (struct parser_state *);
|
|
|
|
extern void go_yyerror (char *);
|
|
|
|
/* Defined in go-lang.c. */
|
|
|
|
extern const char *go_main_name (void);
|
|
|
|
extern enum go_type go_classify_struct_type (struct type *type);
|
|
|
|
extern char *go_demangle (const char *mangled, int options);
|
|
|
|
extern char *go_symbol_package_name (const struct symbol *sym);
|
|
|
|
extern char *go_block_package_name (const struct block *block);
|
|
|
|
extern const struct builtin_go_type *builtin_go_type (struct gdbarch *);
|
|
|
|
/* Defined in go-typeprint.c. */
|
|
|
|
extern void go_print_type (struct type *type, const char *varstring,
|
|
struct ui_file *stream, int show, int level,
|
|
const struct type_print_options *flags);
|
|
|
|
/* Defined in go-valprint.c. */
|
|
|
|
extern void go_val_print (struct type *type, const gdb_byte *valaddr,
|
|
int embedded_offset, CORE_ADDR address,
|
|
struct ui_file *stream, int recurse,
|
|
const struct value *val,
|
|
const struct value_print_options *options);
|
|
|
|
#endif /* !defined (GO_LANG_H) */
|