static unsigned int
cplus_compute_string_hash (const char *string0)
{
- const char *p, *last_scope;
-
/* If '<' doesn't appear at all in STRING), there is no way we could
be dealing with a template name. */
if (find_toplevel_char (string0, '<') == NULL)
return default_compute_string_hash (string0);
/* Locate the last qualified component of STRING0. */
- p = find_toplevel_string (string0, "::");
- last_scope = NULL;
+ const char *p = find_toplevel_string (string0, "::");
+ const char *last_scope = NULL;
+
while (p != NULL)
{
last_scope = p;
and not be a template at all. */
if ((p - last_scope) > 8 && strncmp (p - 8, "operator", 8) == 0)
{
- /* Skip <,= */
+ /* Skip <,=. */
while (strchr ("<=", *p) != NULL)
++p;
a template function itself. */
if (p == NULL)
return default_compute_string_hash (string0);
- else
- {
- unsigned int hash;
- char *copy = ASTRDUP (string0);
- copy[p - string0] = '\0';
+ char *copy = ASTRDUP (string0);
- /* It *is a template, compute the hash based only until P. */
- hash = default_compute_string_hash (copy);
- /* !!keiths: Probably should snarf dict_hash/minsym_hash_iw
- and do this by length. What about cp_entire_prefix_len? */
- return hash;
- }
+ copy[p - string0] = '\0';
+
+ /* It is a template, compute the hash based only until P. */
+ return default_compute_string_hash (copy);
}
\f
exception on failure. This is suitable for use as the
la_get_compile_instance language method. */
-extern struct compile_instance *c_get_compile_context (void);
+extern compile::compile_instance *c_get_compile_context (void);
/* Create a new instance of the C++ compiler and return it. The new
compiler is owned by the caller and must be freed using the destroy
exception on failure. This is suitable for use as the
la_get_compile_instance language method. */
-extern struct compile_instance *cplus_get_compile_context (void);
+extern compile::compile_instance *cplus_get_compile_context (void);
/* This takes the user-supplied text and returns a new bit of code to
compile.
This is used as the la_compute_program language method; see that
for a description of the arguments. */
-extern std::string c_compute_program (struct compile_instance *inst,
+extern std::string c_compute_program (compile::compile_instance *inst,
const char *input,
struct gdbarch *gdbarch,
const struct block *expr_block,
This is used as the la_compute_program language method; see that
for a description of the arguments. */
-extern std::string cplus_compute_program (struct compile_instance *inst,
+extern std::string cplus_compute_program (compile::compile_instance *inst,
const char *input,
struct gdbarch *gdbarch,
const struct block *expr_block,
|| is_destructor_name (physname)
|| method_name[0] == '~';
- /* Do not print out artificial or "duplicate" methods. */
+ /* Do not print out artificial or alias methods. */
if (TYPE_FN_FIELD_ARTIFICIAL (f, j)
- || TYPE_FN_FIELD_DUPLICATE (f, j))
+ || TYPE_FN_FIELD_ALIAS (f, j))
continue;
inner_cleanup = make_cleanup (null_cleanup, NULL);
template <typename INSTTYPE, typename FUNCTYPE, typename CTXTYPE,
typename BASE_VERSION_TYPE, typename API_VERSION_TYPE>
-struct compile_instance *
+compile::compile_instance *
get_compile_context (const char *fe_libcc, const char *fe_context,
BASE_VERSION_TYPE base_version,
API_VERSION_TYPE api_version)
/* A C-language implementation of get_compile_context. */
-struct compile_instance *
+compile::compile_instance *
c_get_compile_context (void)
{
+ using namespace compile;
+
return get_compile_context
<compile_c_instance, gcc_c_fe_context_function, gcc_c_context,
gcc_base_api_version, gcc_c_api_version>
/* A C++-language implementation of get_compile_context. */
-struct compile_instance *
+compile::compile_instance *
cplus_get_compile_context (void)
{
using namespace compile;
macro_for_each_in_scope (scope->file, scope->line, print_one_macro, file);
}
-
/* Generate a structure holding all the registers used by the function
we're generating. */
generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch,
const unsigned char *registers_used)
{
+ int i;
int seen = 0;
fputs_unfiltered ("struct " COMPILE_I_SIMPLE_REGISTER_STRUCT_TAG " {\n",
stream);
if (registers_used != NULL)
- for (int i = 0; i < gdbarch_num_regs (gdbarch); ++i)
+ for (i = 0; i < gdbarch_num_regs (gdbarch); ++i)
{
if (registers_used[i])
{
/* The types used for C and C++ program computations. */
-typedef compile_program<compile_c_instance, c_push_user_expression,
+typedef compile_program<compile::compile_c_instance, c_push_user_expression,
pop_user_expression_nop, c_add_code_header,
c_add_code_footer,
c_add_input> c_compile_program;
/* The la_compute_program method for C. */
std::string
-c_compute_program (struct compile_instance *inst,
+c_compute_program (compile::compile_instance *inst,
const char *input,
struct gdbarch *gdbarch,
const struct block *expr_block,
CORE_ADDR expr_pc)
{
+ using namespace compile;
+
compile_c_instance *c_inst = static_cast<compile_c_instance *> (inst);
c_compile_program program (c_inst, gdbarch);
/* The la_compute_program method for C++. */
std::string
-cplus_compute_program (struct compile_instance *inst,
+cplus_compute_program (compile::compile_instance *inst,
const char *input,
struct gdbarch *gdbarch,
const struct block *expr_block,
\f
+using namespace compile;
+
/* See description in compile-c.h. */
char *
scope.) */
static void
-convert_one_symbol (struct compile_c_instance *context,
+convert_one_symbol (compile_c_instance *context,
struct block_symbol sym,
int is_global,
int is_local)
itself, and DOMAIN is the domain which was searched. */
static void
-convert_symbol_sym (struct compile_c_instance *context, const char *identifier,
+convert_symbol_sym (compile_c_instance *context, const char *identifier,
struct block_symbol sym, domain_enum domain)
{
const struct block *static_block;
to use and BMSYM is the minimal symbol to convert. */
static void
-convert_symbol_bmsym (struct compile_c_instance *context,
+convert_symbol_bmsym (compile_c_instance *context,
struct bound_minimal_symbol bmsym)
{
struct minimal_symbol *msym = bmsym.minsym;
enum gcc_c_oracle_request request,
const char *identifier)
{
- struct compile_c_instance *context = (struct compile_c_instance *) datum;
+ compile_c_instance *context = static_cast<compile_c_instance *> (datum);
domain_enum domain;
int found = 0;
gcc_symbol_address (void *datum, struct gcc_c_context *gcc_context,
const char *identifier)
{
- struct compile_c_instance *context = (struct compile_c_instance *) datum;
+ compile_c_instance *context = static_cast<compile_c_instance *> (datum);
gcc_address result = 0;
int found = 0;
#include "compile-internal.h"
#include "compile-c.h"
+using namespace compile;
+
/* Convert a pointer type to its gcc representation. */
static gcc_type
-convert_pointer (struct compile_c_instance *context, struct type *type)
+convert_pointer (compile_c_instance *context, struct type *type)
{
gcc_type target = context->convert_type (TYPE_TARGET_TYPE (type));
/* Convert an array type to its gcc representation. */
static gcc_type
-convert_array (struct compile_c_instance *context, struct type *type)
+convert_array (compile_c_instance *context, struct type *type)
{
gcc_type element_type;
struct type *range = TYPE_INDEX_TYPE (type);
/* Convert a struct or union type to its gcc representation. */
static gcc_type
-convert_struct_or_union (struct compile_c_instance *context, struct type *type)
+convert_struct_or_union (compile_c_instance *context, struct type *type)
{
int i;
gcc_type result;
/* Convert an enum type to its gcc representation. */
static gcc_type
-convert_enum (struct compile_c_instance *context, struct type *type)
+convert_enum (compile_c_instance *context, struct type *type)
{
gcc_type int_type, result;
int i;
/* Convert a function type to its gcc representation. */
static gcc_type
-convert_func (struct compile_c_instance *context, struct type *type)
+convert_func (compile_c_instance *context, struct type *type)
{
int i;
gcc_type result, return_type;
/* Convert an integer type to its gcc representation. */
static gcc_type
-convert_int (struct compile_c_instance *context, struct type *type)
+convert_int (compile_c_instance *context, struct type *type)
{
if (context->c_version () >= GCC_C_FE_VERSION_1)
{
/* Convert a floating-point type to its gcc representation. */
static gcc_type
-convert_float (struct compile_c_instance *context, struct type *type)
+convert_float (compile_c_instance *context, struct type *type)
{
if (context->c_version () >= GCC_C_FE_VERSION_1)
return context->float_type (TYPE_LENGTH (type), TYPE_NAME (type));
/* Convert the 'void' type to its gcc representation. */
static gcc_type
-convert_void (struct compile_c_instance *context, struct type *type)
+convert_void (compile_c_instance *context, struct type *type)
{
return context->void_type ();
}
/* Convert a boolean type to its gcc representation. */
static gcc_type
-convert_bool (struct compile_c_instance *context, struct type *type)
+convert_bool (compile_c_instance *context, struct type *type)
{
return context->bool_type ();
}
/* Convert a qualified type to its gcc representation. */
static gcc_type
-convert_qualified (struct compile_c_instance *context, struct type *type)
+convert_qualified (compile_c_instance *context, struct type *type)
{
struct type *unqual = make_unqualified_type (type);
gcc_type unqual_converted;
/* Convert a complex type to its gcc representation. */
static gcc_type
-convert_complex (struct compile_c_instance *context, struct type *type)
+convert_complex (compile_c_instance *context, struct type *type)
{
gcc_type base = context->convert_type (TYPE_TARGET_TYPE (type));
returns the gcc type. */
static gcc_type
-convert_type_basic (struct compile_c_instance *context, struct type *type)
+convert_type_basic (compile_c_instance *context, struct type *type)
{
/* If we are converting a qualified type, first convert the
unqualified type and then apply the qualifiers. */
return context->error (_("cannot convert gdb type to gcc type"));
}
+/* Default compile flags for C. */
+
+const char *compile_c_instance::m_default_cflags = "-std=gnu11"
+ /* Otherwise the .o file may need
+ "_Unwind_Resume" and
+ "__gcc_personality_v0". */
+ " -fno-exceptions"
+ " -Wno-implicit-function-declaration";
+
gcc_type
compile_c_instance::convert_type (struct type *type)
{
extern gcc_c_symbol_address_function gcc_symbol_address;
-/* A subclass of compile_instance that is specific to the C front
- end. */
-
-class compile_c_instance
- : public compile_instance
+namespace compile
{
- public:
- compile_c_instance (struct gcc_base_context *base, const char *options)
- : compile_instance (base, options)
+ /* A subclass of compile_instance that is specific to the C front
+ end. */
+
+ class compile_c_instance
+ : public compile_instance
+ {
+ public:
+
+ compile_c_instance (struct gcc_base_context *base, const char *options)
+ : compile_instance (base, options)
{
}
- explicit compile_c_instance (struct gcc_c_context *gcc_c)
- : compile_instance (&gcc_c->base,
- "-std=gnu11"
- /* Otherwise the .o file may need
- "_Unwind_Resume" and
- "__gcc_personality_v0". */
- " -fno-exceptions"
- " -Wno-implicit-function-declaration"),
- m_context (gcc_c)
- {
- m_context->c_ops->set_callbacks (m_context, gcc_convert_symbol,
- gcc_symbol_address, this);
- }
+ explicit compile_c_instance (struct gcc_c_context *gcc_c)
+ : compile_instance (&gcc_c->base, m_default_cflags), m_context (gcc_c)
+ {
+ m_context->c_ops->set_callbacks (m_context, gcc_convert_symbol,
+ gcc_symbol_address, this);
+ }
- ~compile_c_instance ()
+ ~compile_c_instance ()
{
m_gcc_fe->ops->destroy (m_gcc_fe);
}
- /* Convert a gdb type, TYPE, to a GCC type.
+ /* Convert a gdb type, TYPE, to a GCC type.
+
+ The new GCC type is returned. */
- The new GCC type is returned. */
+ gcc_type convert_type (struct type *type);
- gcc_type convert_type (struct type *type);
+ /* Plug-in forwards */
- /* Plug-in forwards */
+ unsigned int c_version () const;
- unsigned int c_version () const;
+ bool tagbind (const char *name, gcc_type tagged_type, const char *filename,
+ unsigned int line_number);
- bool tagbind (const char *name, gcc_type tagged_type, const char *filename,
- unsigned int line_number);
+ bool build_constant (gcc_type type, const char *name, unsigned long value,
+ const char *filename, unsigned int line_number);
- bool build_constant (gcc_type type, const char *name, unsigned long value,
- const char *filename, unsigned int line_number);
+ gcc_decl build_decl (const char *name, enum gcc_c_symbol_kind sym_kind,
+ gcc_type sym_type, const char *substitution_name,
+ gcc_address address, const char *filename,
+ unsigned int line_number);
- gcc_decl build_decl (const char *name, enum gcc_c_symbol_kind sym_kind,
- gcc_type sym_type, const char *substitution_name,
- gcc_address address, const char *filename,
- unsigned int line_number);
+ bool bind (gcc_decl decl, bool is_global);
- bool bind (gcc_decl decl, bool is_global);
+ gcc_type error (const char *message);
- gcc_type error (const char *message);
+ gcc_type build_pointer_type (gcc_type base_type);
- gcc_type build_pointer_type (gcc_type base_type);
+ gcc_type build_vla_array_type (gcc_type element_type,
+ const char *upper_bound_name);
- gcc_type build_vla_array_type (gcc_type element_type,
- const char *upper_bound_name);
+ gcc_type build_vector_type (gcc_type element_type, int num_elements);
- gcc_type build_vector_type (gcc_type element_type, int num_elements);
+ gcc_type build_array_type (gcc_type element_type, int num_elements);
- gcc_type build_array_type (gcc_type element_type, int num_elements);
+ gcc_type build_record_type ();
- gcc_type build_record_type ();
+ gcc_type build_union_type ();
- gcc_type build_union_type ();
+ bool build_add_field (gcc_type record_or_union_type, const char *field_name,
+ gcc_type field_type, unsigned long bitsize,
+ unsigned long bitpos);
- bool build_add_field (gcc_type record_or_union_type, const char *field_name,
- gcc_type field_type, unsigned long bitsize,
- unsigned long bitpos);
+ bool finish_record_or_union (gcc_type record_or_union_type,
+ unsigned long size_in_bytes);
- bool finish_record_or_union (gcc_type record_or_union_type,
- unsigned long size_in_bytes);
+ gcc_type int_type (bool is_unsigned, unsigned long size_in_bytes,
+ const char *builtin_name);
- gcc_type int_type (bool is_unsigned, unsigned long size_in_bytes,
- const char *builtin_name);
+ gcc_type int_type (bool is_unsigned, unsigned long size_in_bytes);
- gcc_type int_type (bool is_unsigned, unsigned long size_in_bytes);
+ gcc_type build_enum_type (gcc_type underlying_int_type);
- gcc_type build_enum_type (gcc_type underlying_int_type);
+ bool build_add_enum_constant (gcc_type enum_type, const char *name,
+ unsigned long value);
- bool build_add_enum_constant (gcc_type enum_type, const char *name,
- unsigned long value);
+ bool finish_enum_type (gcc_type enum_type);
- bool finish_enum_type (gcc_type enum_type);
+ gcc_type build_function_type (gcc_type return_value,
+ const struct gcc_type_array *argument_types,
+ bool is_varargs);
- gcc_type build_function_type (gcc_type return_value,
- const struct gcc_type_array *argument_types,
- bool is_varargs);
+ gcc_type char_type ();
- gcc_type char_type ();
+ gcc_type float_type (unsigned long size_in_bytes, const char *builtin_name);
- gcc_type float_type (unsigned long size_in_bytes, const char *builtin_name);
+ gcc_type float_type (unsigned long size_in_bytes);
- gcc_type float_type (unsigned long size_in_bytes);
+ gcc_type void_type ();
- gcc_type void_type ();
+ gcc_type bool_type ();
- gcc_type bool_type ();
+ gcc_type build_qualified_type (gcc_type unqualified_type,
+ enum gcc_qualifiers qualifiers);
- gcc_type build_qualified_type (gcc_type unqualified_type,
- enum gcc_qualifiers qualifiers);
+ gcc_type build_complex_type (gcc_type element_type);
- gcc_type build_complex_type (gcc_type element_type);
+ private:
-private:
+ /* Default compiler flags for C. */
+ static const char *m_default_cflags;
- /* The GCC C context. */
- struct gcc_c_context *m_context;
+ /* The GCC C context. */
+ struct gcc_c_context *m_context;
+ };
};
/* Emit code to compute the address for all the local variables in
register is needed to compute a local variable. */
extern unsigned char *generate_c_for_variable_locations
- (compile_instance *compiler,
+ (compile::compile_instance *compiler,
string_file &stream,
struct gdbarch *gdbarch,
const struct block *block,
compile_cplus_instance::maybe_define_new_function_template
(const struct symbol *sym, struct type *parent_type, int f_idx,
int m_idx)
-
+
{
if (sym != NULL && SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION (sym))
{
*ignore = true;
return field_name; /* C? */
- case unknown_ctor:
+ case not_ctor:
#if DEBUG_XTOR
printf ("unknown_ctr -- ignored\n");
#endif
*ignore = true;
return field_name; /* D? */
- case unknown_dtor:
+ case not_dtor:
#if DEBUG_XTOR
- printf ("unknown_dtor -- ignored\n");
+ printf ("not_dtor -- ignored\n");
#endif
*ignore = true;
return field_name; /* unknown */
\f
+/* Default compile flags for C++. */
+
+const char *compile_cplus_instance::m_default_cflags = "-std=gnu++11";
+
/* See compile-cplus.h. */
compile_cplus_instance::compile_cplus_instance (struct gcc_cp_context *gcc_fe)
- : compile_instance (&gcc_fe->base,
- "-std=gnu++11"),
- m_context (gcc_fe),
- m_function_template_defns (new function_template_defn_map_t ()),
- m_class_template_defns (new class_template_defn_map_t ())
+ : compile_instance (&gcc_fe->base, m_default_cflags),
+ m_context (gcc_fe),
+ m_function_template_defns (new function_template_defn_map_t ()),
+ m_class_template_defns (new class_template_defn_map_t ())
{
gcc_fe->cp_ops->set_callbacks (gcc_fe, gcc_cplus_convert_symbol,
gcc_cplus_symbol_address,
void leave_scope ();
- /* !!keiths: YUCK!
- Plug-in forwards */
+ /* Plug-in forwards */
gcc_type get_bool_type ();
bool finish_enum_type (gcc_type enum_type);
- /* NAME for debugging */
+ /* NAME is for debugging only. */
+
bool finish_class_type (const char *name, unsigned long size_in_bytes);
gcc_type get_float_type (unsigned long size_in_bytes,
gcc_expr build_literal_expr (gcc_type type, unsigned long value);
- /* DECL_DESC for debugging only */
+ /* DECL_DESC is for debugging only. */
+
gcc_decl build_decl (const char *decl_desc, const char *name,
enum gcc_cp_symbol_kind sym_kind,
gcc_type sym_type, const char *substitution_name,
const char *filename,
unsigned int line_number);
- /* NAME is for debugging only */
+ /* NAME is for debugging only. */
+
bool pop_binding_level (const char *name);
bool push_namespace (const char *name);
(struct template_symbol *concrete, gcc_address address,
const char *filename, unsigned int line_number);
- /* NAME only for debugging */
+ /* NAME is for debugging only. */
+
gcc_type start_class_type (const char *name, gcc_decl typedecl,
const struct gcc_vbase_array *base_classes,
const char *filename,
const char *filename,
unsigned int line_number);
- /* GENERIC only for debugging */
+ /* GENERIC is for debugging only. */
+
bool start_template_decl (const char *generic);
gcc_type get_void_type ();
private:
+ /* Default compiler flags for C++. */
+ static const char *m_default_cflags;
+
/* Enumerate the template arguments of template DEFN into DEST. */
void enumerate_template_arguments
#include "defs.h"
#include "gcc-c-interface.h"
-#include "compile-internal.h"
#include <string>
#include <unordered_map>
struct block;
-/* An object of this type holds state associated with a given
- compilation job. */
-
-class compile_instance
+namespace compile
{
-public:
+ /* An object of this type holds state associated with a given
+ compilation job. */
- compile_instance (struct gcc_base_context *gcc_fe, const char *options)
- : m_gcc_fe (gcc_fe), m_gcc_target_options (options)
+ class compile_instance
{
- }
+ public:
- virtual ~compile_instance ()
- {
- }
+ compile_instance (struct gcc_base_context *gcc_fe, const char *options)
+ : m_gcc_fe (gcc_fe), m_gcc_target_options (options)
+ {
+ }
- /* Returns the GCC options to be passed during compilation. */
+ virtual ~compile_instance ()
+ {
+ }
- const std::string &gcc_target_options () const
- {
- return m_gcc_target_options;
- }
+ /* Returns the GCC options to be passed during compilation. */
- /* Insert GCC_TYPE into the type cache for TYPE.
+ const std::string &gcc_target_options () const
+ {
+ return m_gcc_target_options;
+ }
- It is ok for a given type to be inserted more than once, provided that
- the exact same association is made each time. */
+ /* Insert GCC_TYPE into the type cache for TYPE.
- void insert_type (struct type *type, gcc_type gcc_type);
+ It is ok for a given type to be inserted more than once, provided that
+ the exact same association is made each time. */
- /* Associate SYMBOL with some error text. */
+ void insert_type (struct type *type, gcc_type gcc_type);
- void insert_symbol_error (const struct symbol *sym, std::string text);
+ /* Associate SYMBOL with some error text. */
- /* Emit the error message corresponding to SYM, if one exists, and
- arrange for it not to be emitted again. */
+ void insert_symbol_error (const struct symbol *sym, std::string text);
- void error_symbol_once (const struct symbol *sym);
+ /* Emit the error message corresponding to SYM, if one exists, and
+ arrange for it not to be emitted again. */
- /* These currently just forward to the underlying ops
- vtable. */
+ void error_symbol_once (const struct symbol *sym);
- /* Set the plug-in print callback. */
+ /* These currently just forward to the underlying ops
+ vtable. */
- void set_print_callback (void (*print_function) (void *, const char *),
- void *datum);
+ /* Set the plug-in print callback. */
- /* Return the plug-in's front-end version. */
+ void set_print_callback (void (*print_function) (void *, const char *),
+ void *datum);
- unsigned int version () const;
+ /* Return the plug-in's front-end version. */
- /* Set the plug-in's verbosity level. */
+ unsigned int version () const;
- void set_verbose (int level);
+ /* Set the plug-in's verbosity level. */
- /* Set the plug-in driver program. */
+ void set_verbose (int level);
- void set_driver_filename (const char *filename);
+ /* Set the plug-in driver program. */
- /* Set the regular expression used to match the configury triplet
- prefix to the compiler. */
+ void set_driver_filename (const char *filename);
- void set_triplet_regexp (const char *regexp);
+ /* Set the regular expression used to match the configury triplet
+ prefix to the compiler. */
- /* Set compilation arguments. */
+ void set_triplet_regexp (const char *regexp);
- char *set_arguments (int argc, char **argv);
+ /* Set compilation arguments. */
- /* !!keiths: YUCK! */
+ char *set_arguments (int argc, char **argv);
- char *set_arguments (const char *regexp, int argc, char **argv);
+ /* As above for protocol version 0. */
- /* Set the filename of the program to compile. */
+ char *set_arguments (const char *regexp, int argc, char **argv);
- void set_source_file (const char *filename);
+ /* Set the filename of the program to compile. */
- /* Compile the previously specified source file to FILENAME. */
+ void set_source_file (const char *filename);
- bool compile (const char *filename);
+ /* Compile the previously specified source file to FILENAME. */
- /* Same as above, but for earlier protocol versions. */
+ bool compile (const char *filename);
- bool compile (const char *filename, int verbose_level);
+ /* Same as above, but for earlier protocol versions. */
- /* Set the scope type for this compile. */
+ bool compile (const char *filename, int verbose_level);
- void set_scope (enum compile_i_scope_types scope)
- {
- m_scope = scope;
- }
+ /* Set the scope type for this compile. */
- /* Return the scope type. */
+ void set_scope (enum compile_i_scope_types scope)
+ {
+ m_scope = scope;
+ }
- enum compile_i_scope_types scope () const
- {
- return m_scope;
- }
+ /* Return the scope type. */
- /* Set the block to be used for symbol searches. */
+ enum compile_i_scope_types scope () const
+ {
+ return m_scope;
+ }
- void set_block (const struct block *block)
- {
- m_block = block;
- }
+ /* Set the block to be used for symbol searches. */
- /* Return the search block. */
+ void set_block (const struct block *block)
+ {
+ m_block = block;
+ }
- const struct block *block () const
- {
- return m_block;
- }
+ /* Return the search block. */
+
+ const struct block *block () const
+ {
+ return m_block;
+ }
-protected:
+ protected:
- /* Map types used by the compile instance for caching type conversions.
- and error tracking. */
+ /* Map types used by the compile instance for caching type conversions.
+ and error tracking. */
- typedef std::pair<struct type *, gcc_type> type_map_item_t;
- typedef std::unordered_map<struct type *, gcc_type> type_map_t;
- typedef std::pair<const struct symbol *, std::string> symbol_err_map_item_t;
- typedef std::unordered_map<const struct symbol *, std::string>
+ typedef std::pair<struct type *, gcc_type> type_map_item_t;
+ typedef std::unordered_map<struct type *, gcc_type> type_map_t;
+ typedef std::pair<const struct symbol *, std::string> symbol_err_map_item_t;
+ typedef std::unordered_map<const struct symbol *, std::string>
symbol_err_map_t;
- /* The GCC front end. */
- struct gcc_base_context *m_gcc_fe;
+ /* The GCC front end. */
+ struct gcc_base_context *m_gcc_fe;
- /* The "scope" of this compilation. */
- enum compile_i_scope_types m_scope;
+ /* The "scope" of this compilation. */
+ enum compile_i_scope_types m_scope;
- /* The block in which an expression is being parsed. */
- const struct block *m_block;
+ /* The block in which an expression is being parsed. */
+ const struct block *m_block;
- /* Specify "-std=gnu11", "-std=gnu++11" or similar. These options are put
- after CU's DW_AT_producer compilation options to override them. */
- std::string m_gcc_target_options;
+ /* Specify "-std=gnu11", "-std=gnu++11" or similar. These options are put
+ after CU's DW_AT_producer compilation options to override them. */
+ std::string m_gcc_target_options;
- /* Map from gdb types to gcc types. */
- type_map_t m_type_map;
+ /* Map from gdb types to gcc types. */
+ type_map_t m_type_map;
- /* Map from gdb symbols to gcc error messages to emit. */
- symbol_err_map_t m_symbol_err_map;
+ /* Map from gdb symbols to gcc error messages to emit. */
+ symbol_err_map_t m_symbol_err_map;
+ };
};
/* Define the headers and footers for different scopes. */
generated above. */
static void
-get_args (const struct compile_instance *compiler, struct gdbarch *gdbarch,
- int *argcp, char ***argvp)
+get_args (const compile::compile_instance *compiler,
+ struct gdbarch *gdbarch, int *argcp, char ***argvp)
{
const char *cs_producer_options;
int argc_compiler;
static void
cleanup_compile_instance (void *arg)
{
- struct compile_instance *inst = (struct compile_instance *) arg;
+ compile::compile_instance *inst
+ = static_cast<compile::compile_instance *> (arg);
delete inst;
}
compile_to_object (struct command_line *cmd, const char *cmd_string,
enum compile_i_scope_types scope)
{
- struct compile_instance *compiler;
+ compile::compile_instance *compiler;
struct cleanup *cleanup, *inner_cleanup;
const struct block *expr_block;
CORE_ADDR trash_pc, expr_pc;
get_args (compiler, gdbarch, &argc, &argv);
make_cleanup_freeargv (argv);
- /* !!keiths: This should be hidden at this level! */
if (compiler->version ()>= GCC_FE_VERSION_1)
error_message = compiler->set_arguments (argc, argv);
else
/* See description in compile-internal.h. */
void
-compile_instance::insert_type (struct type *type, gcc_type gcc_type)
+compile::compile_instance::insert_type (struct type *type, gcc_type gcc_type)
{
type_map_t::iterator pos = m_type_map.find (type);
/* See description in compile-internal.h. */
void
-compile_instance::insert_symbol_error (const struct symbol *sym,
- std::string text)
+compile::compile_instance::insert_symbol_error (const struct symbol *sym,
+ std::string text)
{
symbol_err_map_t::iterator pos = m_symbol_err_map.find (sym);
/* See description in compile-internal.h. */
void
-compile_instance::error_symbol_once (const struct symbol *sym)
+compile::compile_instance::error_symbol_once (const struct symbol *sym)
{
symbol_err_map_t::iterator pos = m_symbol_err_map.find (sym);
if (pos == m_symbol_err_map.end () || pos->second.length () == 0)
/* Set the plug-in print callback. */
void
-compile_instance::set_print_callback
+compile::compile_instance::set_print_callback
(void (*print_function) (void *, const char *), void *datum)
{
FORWARD (set_print_callback, print_function, datum);
/* Return the plug-in's front-end version. */
unsigned int
-compile_instance::version () const
+compile::compile_instance::version () const
{
return m_gcc_fe->ops->version;
}
/* Set the plug-in's verbosity level. */
void
-compile_instance::set_verbose (int level)
+compile::compile_instance::set_verbose (int level)
{
FORWARD (set_verbose, level);
}
/* Set the plug-in driver program. */
void
-compile_instance::set_driver_filename (const char *filename)
+compile::compile_instance::set_driver_filename (const char *filename)
{
- /* !!keiths: Possible leak??? */
FORWARD (set_driver_filename, filename);
}
prefix to the compiler. */
void
-compile_instance::set_triplet_regexp (const char *regexp)
+compile::compile_instance::set_triplet_regexp (const char *regexp)
{
- /* !!keiths: Leak? */
FORWARD (set_triplet_regexp, regexp);
}
/* Set compilation arguments. */
char *
-compile_instance::set_arguments (int argc, char **argv)
+compile::compile_instance::set_arguments (int argc, char **argv)
{
return FORWARD (set_arguments, argc, argv);
}
-/* !!keiths: YUCK! */
+/* As above, for protocol version 0. */
char *
-compile_instance::set_arguments (const char *regexp, int argc, char **argv)
+compile::compile_instance::set_arguments (const char *regexp, int argc, char
+ **argv)
{
return FORWARD (set_arguments_v0, regexp, argc, argv);
}
/* Set the filename of the program to compile. */
void
-compile_instance::set_source_file (const char *filename)
+compile::compile_instance::set_source_file (const char *filename)
{
FORWARD (set_source_file, filename);
}
/* Compile the previously specified source file to FILENAME. */
bool
-compile_instance::compile (const char *filename)
+compile::compile_instance::compile (const char *filename)
{
return FORWARD (compile, filename);
}
/* As above, but for an earlier compile protocol. */
bool
-compile_instance::compile (const char *filename, int verbose_level)
+compile::compile_instance::compile (const char *filename, int verbose_level)
{
return FORWARD (compile_v0, filename, verbose_level);
}
non-zero. */
enum ctor_kinds {
+ /* Unrecognized or not a constructor. */
+ not_ctor = 0,
+
/* Initialize a complete object, including virtual bases, using
memory provided by caller. */
- complete_object_ctor = 1,
+ complete_object_ctor,
/* Initialize a base object of some larger object. */
base_object_ctor,
unified_ctor,
/* Deprecated? */
- object_ctor_group,
-
- /* Unknown constructor, e.g., no linkage name. */
- unknown_ctor
+ object_ctor_group
};
/* Return non-zero iff NAME is the mangled name of a constructor.
non-zero. */
enum dtor_kinds {
+ /* Unrecognized or not a destructor. */
+ not_dtor = 0,
+
/* A destructor which finalizes the entire object, and then calls
`delete' on its storage. */
- deleting_dtor = 1,
+ deleting_dtor,
/* A destructor which finalizes the entire object, but does not call
`delete'. */
unified_dtor,
/* Deprecated? */
- object_dtor_group,
-
- /* Unknown destructor, e.g., no linkage name. */
- unknown_dtor
+ object_dtor_group
};
/* Kinds of template arguments. */
if (tsymbol->linkage_name == NULL)
{
- /* !!keiths: I can't even issue a good error message! */
- warning (_("Template symbol has no linkage name."));
+ warning (_("Template symbol \"%s\" has no linkage name."),
+ SYMBOL_NATURAL_NAME (&tsymbol->base));
return;
}
info = dpi.get ();
}
- /* !!keiths will certainly require extensive testing/revision. */
-
/* Determine the return type index. */
ret_comp = info->tree;
if (ret_comp->type == DEMANGLE_COMPONENT_TYPED_NAME)
char *gdb_demangle (const char *name, int options);
-/* Find the fn_field for the method with symbol METHOD_SYMBOL in its
- parent class. If XTOR_ONLY is non-zero, any symbols not representing a
- constructor or destructor will return NULL. */
-
-extern struct fn_field *cp_find_method_field (struct symbol *method_symbol,
- int xtor_only);
-
/* Decode template information for TSYMBOL. This function determines whether
the template's return and argument types are concrete types or template
parameters. The symbol's obstack is used to allocate any needed memory.
{
case DW_TAG_subprogram:
addr = gdbarch_adjust_dwarf2_addr (gdbarch, pdi->lowpc + baseaddr);
- if (pdi->is_external || cu->language == language_ada || cu->language == language_cplus)
+ if (pdi->is_external || cu->language == language_ada
+ || cu->language == language_cplus)
{
/* brobecker/2007-12-26: Normally, only "external" DIEs are part
of the global scope. But in Ada, we want to be able to access
methods[idx] = new_fn_field (name_die, name_cu, type_die, type_cu,
parent_type, name, idx, i);
- /* If this is an aliased xtor, mark it as a duplicate so that
+ /* If this is an aliased xtor, mark it as an alias so that
it will be ignored during symbol searches and type printing. */
if (name_die != type_die)
- TYPE_FN_FIELD_DUPLICATE (methods, idx) = 1;
+ TYPE_FN_FIELD_ALIAS (methods, idx) = 1;
return;
}
if (linkage_name != NULL)
{
enum ctor_kinds ctor_kind;
- enum dtor_kinds dtor_kind = (enum dtor_kinds) 0;
+ enum dtor_kinds dtor_kind = not_dtor;
ctor_kind = is_constructor_name (linkage_name);
- if (ctor_kind == 0)
+ if (ctor_kind == not_ctor)
dtor_kind = is_destructor_name (linkage_name);
/* GCC outputs imported_declaration for C1 constructors
and D1 destructors which alias to the C4/D4/unified
ctor/dtor listed in the parent class's DIE tree.
Deal with those here. */
- if (ctor_kind != 0 || dtor_kind != 0)
+ if (ctor_kind != not_ctor || dtor_kind != not_dtor)
{
struct die_info *imported_die, *spec_die, *parent_die;
struct die_info *type_die;
struct dwarf2_cu *cu)
{
const char *linkage_name = dw2_linkage_name (die, cu);
- enum ctor_kinds ctor_kind;
if (linkage_name == NULL || cu->language != language_cplus)
return;
- ctor_kind = is_constructor_name (linkage_name);
- if (ctor_kind == 0)
+ enum ctor_kinds ctor_kind = is_constructor_name (linkage_name);
+
+ if (ctor_kind == not_ctor)
{
enum dtor_kinds dtor_kind = is_destructor_name (linkage_name);
- if (dtor_kind == 0)
+ if (dtor_kind == not_dtor)
return;
}
|| die->tag == DW_TAG_class_type
|| die->tag == DW_TAG_structure_type
|| die->tag == DW_TAG_union_type
- || die->tag == DW_TAG_enumeration_type
- /*|| die->tag == DW_TAG_namespace*/);
+ || die->tag == DW_TAG_enumeration_type);
fp = &new_field->field;
accessibility = dwarf2_default_access_attribute (die, cu);
switch (accessibility)
{
-#if 1
case DW_ACCESS_public:
fp->is_public = 1;
break;
-#endif
case DW_ACCESS_private:
fp->is_private = 1;
break;
const char *fieldname;
const char *type_name;
int len;
- const char *linkage_name;
/* If there is a linkage name, use it to determine if this DIE represents
a constructor. */
- linkage_name = dw2_linkage_name (die, cu);
+ const char *linkage_name = dw2_linkage_name (die, cu);
+
if (linkage_name != NULL)
- return is_constructor_name (linkage_name) != 0;
+ return is_constructor_name (linkage_name) != not_ctor;
/* Many older versions of GCC do not output DW_AT_linkage_name for
constructors. In that case, fallback to a heuristic test. */
static int
dwarf2_is_destructor (struct die_info *die, struct dwarf2_cu *cu)
{
- const char *fieldname;
- const char *linkage_name;
-
/* If there is a linkage name, use it to determine if this DIE represents
a destructor. */
- linkage_name = dw2_linkage_name (die, cu);
+ const char *linkage_name = dw2_linkage_name (die, cu);
+
if (linkage_name != NULL)
- return is_destructor_name (linkage_name) != 0;
+ return is_destructor_name (linkage_name) != not_dtor;
if (die->parent == NULL)
return 0;
&& die->parent->tag != DW_TAG_class_type)
return 0;
- fieldname = dwarf2_name (die, cu);
+ const char *fieldname = dwarf2_name (die, cu);
+
return (fieldname != NULL && *fieldname == '~');
}
fnfield.is_constructor = dwarf2_is_constructor (name_die, type_cu);
if (fnfield.is_constructor)
{
- const char *linkage_name;
+ const char *linkage_name = dw2_linkage_name (name_die, name_cu);
- linkage_name = dw2_linkage_name (name_die, name_cu);
- if (linkage_name == NULL)
- fnfield.cdtor_type.ctor_kind = unknown_ctor;
- else
+ if (linkage_name != NULL)
{
fnfield.cdtor_type.ctor_kind = is_constructor_name (linkage_name);
- gdb_assert (fnfield.cdtor_type.ctor_kind != 0);
+ gdb_assert (fnfield.cdtor_type.ctor_kind != not_ctor);
}
}
else
fnfield.is_destructor = dwarf2_is_destructor (name_die, name_cu);
if (fnfield.is_destructor)
{
- const char *linkage_name;
-
- /* The linkage name can be NULL coming from objfiles created by the
- GCC compile plug-in. This special case should be handled by
- dwarf2_add_member_fn. */
- linkage_name = dw2_linkage_name (name_die, name_cu);
- if (linkage_name == NULL)
- fnfield.cdtor_type.dtor_kind = unknown_dtor;
- else
+ const char *linkage_name = dw2_linkage_name (name_die, name_cu);
+
+ if (linkage_name != NULL)
{
fnfield.cdtor_type.dtor_kind = is_destructor_name (linkage_name);
- gdb_assert (fnfield.cdtor_type.dtor_kind != 0);
+ gdb_assert (fnfield.cdtor_type.dtor_kind != not_dtor);
}
}
}
}
}
-#if 1
if (die->child != NULL)
{
struct die_info *child_die = die->child;
child_die = sibling_die (child_die);
}
}
-#else
- /* !!keiths: HACK! This works around GDB not being able to
- define the contents of a namespace. */
- process_structure_scope (die, cu);
-#endif
}
/* Read a Fortran module as type. This DIE can be only a declaration used for
{
if (child->tag == DW_TAG_subprogram)
{
- const char *linkage_name;
+ const char *linkage_name = dw2_linkage_name (child, cu);
- linkage_name = dw2_linkage_name (child, cu);
if (linkage_name != NULL)
{
char *actual_name
{
type = check_typedef (type);
gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
- || TYPE_CODE (type) == TYPE_CODE_UNION
- || TYPE_CODE (type) == TYPE_CODE_NAMESPACE /* !!keiths */);
+ || TYPE_CODE (type) == TYPE_CODE_UNION);
if (!HAVE_CPLUS_STRUCT (type))
ALLOCATE_CPLUS_STRUCT_TYPE (type);
TYPE_RAW_CPLUS_SPECIFIC (type)->vptr_fieldno = fieldno;
*/
#include "hashtab.h"
-#include "cp-abi.h" /* !!keiths: YUCK! */
+#include "cp-abi.h"
/* Forward declarations for prototypes. */
struct field;
/* * True if this function is aliased to an existing fn_field,
false otherwise. These functions should be skipped during symbol
lookups or type printing. */
- unsigned int is_duplicate : 1;
+ unsigned int is_alias : 1;
/* * Unused. */
struct symbol **arguments;
/* * Default values. An array with n_arguments elements. Note that this
- array only describes this particular instance! It will not describe default
- values for /all/ template instances (unless this instance uses all the defaults).
- This is a DWARF limitation. */
+ array only describes this particular instance! It will not describe
+ default values for /all/ template instances (unless this instance uses
+ all the defaults). This is a DWARF limitation. */
struct symbol **default_arguments;
/* * The kinds of arguments. An array with n_arguments elements. */
#define TYPE_FN_FIELD_STUB(thisfn, n) ((thisfn)[n].is_stub)
#define TYPE_FN_FIELD_CONSTRUCTOR(thisfn, n) ((thisfn)[n].is_constructor)
#define TYPE_FN_FIELD_DESTRUCTOR(thisfn, n) ((thisfn)[n].is_destructor)
-#define TYPE_FN_FIELD_DUPLICATE(thisfn, n) ((thisfn)[n].is_duplicate)
+#define TYPE_FN_FIELD_ALIAS(thisfn, n) ((thisfn)[n].is_alias)
#define TYPE_FN_FIELD_FCONTEXT(thisfn, n) ((thisfn)[n].fcontext)
#define TYPE_FN_FIELD_VOFFSET(thisfn, n) ((thisfn)[n].voffset-2)
#define TYPE_FN_FIELD_VIRTUAL_P(thisfn, n) ((thisfn)[n].voffset > 1)
|| startswith (name, "__dt__"))
return complete_object_dtor;
else
- return (enum dtor_kinds) 0;
+ return not_dtor;
}
static enum ctor_kinds
|| startswith (name, "__ct__"))
return complete_object_ctor;
else
- return (enum ctor_kinds) 0;
+ return not_ctor;
}
static int
switch (libiberty_kind)
{
case 0:
- kind = (enum ctor_kinds) 0;
+ kind = not_ctor;
break;
case gnu_v3_complete_object_ctor:
kind = complete_object_ctor;
switch (libiberty_kind)
{
case 0:
- kind = (enum dtor_kinds) 0;
+ kind = not_dtor;
break;
case gnu_v3_deleting_dtor:
kind = deleting_dtor;
struct type_print_options;
struct lang_varobj_ops;
struct parser_state;
-struct compile_instance;
+
+namespace compile
+{
+ class compile_instance;
+};
#define MAX_FORTRAN_DIMS 7 /* Maximum number of F77 array dims. */
instance is owned by its caller and must be deallocated by
calling its 'destroy' method. */
- struct compile_instance *(*la_get_compile_instance) (void);
+ compile::compile_instance *(*la_get_compile_instance) (void);
/* This method must be defined if 'la_get_gcc_context' is defined.
If 'la_get_gcc_context' is not defined, then this method is
parsed.
EXPR_PC is the PC at which the expression is being parsed. */
- std::string (*la_compute_program) (struct compile_instance *inst,
+ std::string (*la_compute_program) (compile::compile_instance *inst,
const char *input,
struct gdbarch *gdbarch,
const struct block *expr_block,
return collector.symbols;
}
-/* See cp-support.h for description. This function is defined here because all
- the support routines for it are defined in this file. */
-
-struct fn_field *
-cp_find_method_field (struct symbol *method_symbol, int xtor_only)
-{
- struct linespec_state state;
- VEC (block_symbol_d) *syms;
- VEC (symtab_ptr) *file_symtabs = NULL;
- struct cleanup *cleanup;
- struct block_symbol *class_sym;
- char *class_name, *method_name;
- const char *last, *p, *method_fullname;
-
- /* Sanity check: if the symbol's type isn't actually a method, do not
- bother attempting to find a fn_field for it. */
- if (TYPE_CODE (SYMBOL_TYPE (method_symbol)) != TYPE_CODE_METHOD)
- return NULL;
-
- /* Find class/method names. */
- method_fullname = SYMBOL_NATURAL_NAME (method_symbol);
- last = NULL;
- p = find_toplevel_string (method_fullname, "::");
- while (p != NULL)
- {
- last = p;
- p = find_toplevel_string (p + 2, "::");
- }
-
- class_name = XNEWVEC (char, last - method_fullname + 1);
- cleanup = make_cleanup (xfree, class_name);
- strncpy (class_name, method_fullname, last - method_fullname);
- class_name[last - method_fullname] = '\0';
- last += 2;
- method_name = XNEWVEC (char, strlen (last) + 1);
- make_cleanup (xfree, method_name);
- strcpy (method_name, last);
-
- if (xtor_only)
- {
- int len;
- char *n = class_name;
- char *raw_class = cp_func_name (class_name);
-
- if (raw_class != NULL)
- n = raw_class;
-
- /* !!keiths; This test isn't perfect in the general case, but it
- should be enough for our compiler-centric case which is always
- well-defined. Consider moving this code to compile/ somewhere. */
- len = strlen (method_name);
- if (!(strncmp (method_name, n, len) == 0
- && (n[len] == '\0' || n[len] == '<'))
- || method_name[0] != '~')
- {
- /* Not a constructor or destructor -- return. */
- xfree (raw_class);
- do_cleanups (cleanup);
- return NULL;
- }
-
- xfree (raw_class);
- }
-
- memset (&state, 0, sizeof (struct linespec_state));
- state.language = language_def (language_cplus);
- VEC_safe_push (symtab_ptr, file_symtabs, symbol_symtab (method_symbol));
- cleanup = make_cleanup (VEC_cleanup (symtab_ptr), &file_symtabs);
- syms = lookup_prefix_sym (&state, file_symtabs, class_name);
- make_cleanup (VEC_cleanup (block_symbol_d), &syms);
-
- if (!VEC_empty (block_symbol_d, syms))
- {
- int i;
- struct type *class_type;
-
- /* !!keiths: Can we expect more than one? I don't think so. */
- gdb_assert (VEC_length (block_symbol_d, syms) == 1);
- class_sym = VEC_index (block_symbol_d, syms, 0);
- class_type = SYMBOL_TYPE (class_sym->symbol);
-
- /* CLASS_SYM is the parent class... Loop over fn_fields defined in this
- class looking for the one of matching name and type. */
- for (i = 0; i < TYPE_NFN_FIELDS (class_type); ++i)
- {
- int j;
- const char *name = TYPE_FN_FIELDLIST_NAME (class_type, i);
- struct fn_field *fields = TYPE_FN_FIELDLIST1 (class_type, i);
-
- if (!streq (name, method_name))
- continue;
-
- for (j = 0; j < TYPE_FN_FIELDLIST_LENGTH (class_type, i); ++j)
- {
- if (streq (SYMBOL_LINKAGE_NAME (method_symbol),
- TYPE_FN_FIELD_PHYSNAME (fields, j)))
- {
- do_cleanups (cleanup);
- return &TYPE_FN_FIELD (fields, j);
- }
- }
- }
- }
-
- do_cleanups (cleanup);
- return NULL;
-}
-
/* A qsort comparison function for symbols. The resulting order does
not actually matter; we just need to be able to sort them so that
symbols with the same program space end up next to each other. */
#include "gdb_vecs.h"
#include "gdbtypes.h"
#include "common/enum-flags.h"
-#include "cp-abi.h" /* !!keiths; YUCK! Need enum template_argument_kinds! */
/* Opaque declarations. */
struct ui_file;
struct template_symbol *allocate_template_symbol (struct objfile *);
+/* Result of a multi-symbol search. */
+
struct search_multiple_result
{
+ /* Matching debug symbols. */
VEC (block_symbol_d) *symbols;
+
+ /* Matching non-debug symbols. */
VEC (bound_minimal_symbol_d) *minimal_symbols;
};
/* Free the result of search_symbols_multiple. */
-extern void
- free_search_multiple_result (struct search_multiple_result *);
+extern void free_search_multiple_result (struct search_multiple_result *);
/* A cleanup function for the return result of search_symbols_multiple. */
-extern void
- search_multiple_result_cleanup (void *);
+extern void search_multiple_result_cleanup (void *);
#endif /* !defined(SYMTAB_H) */
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-load_lib compiler-support.exp
+load_lib compile-support.exp
standard_testfile
/* This testcase is part of GDB, the GNU debugger.
- Copyright 2014-2016 Free Software Foundation, Inc.
+ Copyright 2014-2017 Free Software Foundation, Inc.
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
};
struct VirtualBase2 : VirtualBase {};
-
+
VirtualBase::VirtualBase (void)
{
- z = 24;
+ z = 24;
}
VirtualBase::~VirtualBase (void)
{
int var;
static const int public_static_var = 12;
-
+
private:
int private_var = 0;
int private_method (void);
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-load_lib compiler-support.exp
+load_lib compile-support.exp
standard_testfile .c compile-shlib.c compile-constvar.S compile-nodebug.c
} else {
untested "print constvar value"
}
-
-
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-load_lib compiler-support.exp
-
standard_testfile
with_test_prefix "nodebug" {
# integration.
load_lib dwarf.exp
-load_lib compiler-support.exp
# This test can only be run on targets which support DWARF-2 and use gas.
if {![dwarf2_support]} {
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-load_lib compiler-support.exp
-
standard_testfile
if { [prepare_for_testing "failed to prepare" "$testfile"] } {
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-load_lib compiler-support.exp
-
standard_testfile .c compile-setjmp-mod.c
if { [prepare_for_testing "failed to prepare" $testfile] } {
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. */
-load_lib compiler-support.exp
-
standard_testfile .c
if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-load_lib compiler-support.exp
-
standard_testfile .c compile-shlib.c compile-constvar.S compile-nodebug.c
get_compiler_info
+ A::stempmethod ()
+ A::stempmethod (0); // break here
}
-
# Namespace-qualified template tests.
-load_lib compiler-support.exp
+load_lib compile-support.exp
standard_testfile .cc
# (Very) simple method tests.
-load_lib compiler-support.exp
+load_lib compile-support.exp
standard_testfile .cc
# (Very) simple inheritance tests.
-load_lib compiler-support.exp
+load_lib compile-support.exp
standard_testfile .cc
# (Very) simple method tests.
-load_lib compiler-support.exp
+load_lib compile-support.exp
standard_testfile .cc
# (Very) simple method tests.
-load_lib compiler-support.exp
+load_lib compile-support.exp
standard_testfile .cc
# (Very) simple virtual method/inheritance tests.
-load_lib compiler-support.exp
+load_lib compile-support.exp
standard_testfile .cc
var += s.s4int_; /* break here */
return S4::get_svar () - 10 * s.get_var ();
}
-
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-load_lib compiler-support.exp
+load_lib compile-support.exp
standard_testfile .cc
+ defaultvals<int, 20> ()
+ deduct (0); // break here
}
-
# (Very) simple template tests.
-load_lib compiler-support.exp
+load_lib compile-support.exp
standard_testfile .cc
# (Very) simple virtual method/inheritance tests.
-load_lib compiler-support.exp
+load_lib compile-support.exp
standard_testfile .cc
# (Very) simple method tests.
-load_lib compiler-support.exp
+load_lib compile-support.exp
standard_testfile .cc
/* Count the number of non-aliased/duplicated methods. */
for (k = 0; k < TYPE_FN_FIELDLIST_LENGTH (type, i); ++k)
{
- if (!TYPE_FN_FIELD_DUPLICATE (f, k))
+ if (!TYPE_FN_FIELD_ALIAS (f, k))
++j;
}
--j;
j = -1;
for (ii = 0; ii < len; ++ii)
{
- /* Skip artificial methods. This is necessary if,
- for example, the user wants to "print
+ /* Skip artificial and aliased methods. This is necessary
+ if, for example, the user wants to "print
subclass::subclass" with only one user-defined
constructor. There is no ambiguity in this case.
We are careful here to allow artificial methods
if they are the unique result. */
if (TYPE_FN_FIELD_ARTIFICIAL (f, ii)
- || TYPE_FN_FIELD_DUPLICATE (f, ii))
+ || TYPE_FN_FIELD_ALIAS (f, ii))
{
if (j == -1)
j = ii;
/* Desired method is ambiguous if more than one
method is defined. */
if (j != -1 && !TYPE_FN_FIELD_ARTIFICIAL (f, j)
- && !TYPE_FN_FIELD_DUPLICATE (f, j))
+ && !TYPE_FN_FIELD_ALIAS (f, j))
error (_("non-unique member `%s' requires "
"type instantiation"), name);