+2020-06-17 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * ada-lang.c (ada_language_data): Delete la_compute_program
+ initializer.
+ * c-lang.c (c_language_data): Likewise.
+ (c_language::compute_program): New member function.
+ (cplus_language_data): Delete la_compute_program initializer.
+ (cplus_language::compute_program): New member function.
+ (asm_language_data): Delete la_compute_program initializer.
+ (minimal_language_data): Likewise.
+ * c-lang.h (c_compute_program): Update comment.
+ (cplus_compute_program): Likewise.
+ * compile/compile-c-support.c (c_compute_program): Likewise.
+ (cplus_compute_program): Likewise.
+ * compile/compile.c (compile_to_object): Update call to
+ la_compute_program.
+ * d-lang.c (d_language_data): Delete la_compute_program
+ initializer.
+ * f-lang.c (f_language_data): Likewise.
+ * go-lang.c (go_language_data): Likewise.
+ * language.c (unknown_language_data): Likewise.
+ (auto_language_data): Likewise.
+ * language.h (language_data): Delete la_compute_program field.
+ (language_defn::compute_program): New member function.
+ * m2-lang.c (m2_language_data): Delete la_compute_program
+ initializer.
+ * objc-lang.c (objc_language_data): Likewise.
+ * opencl-lang.c (opencl_language_data): Likewise.
+ * p-lang.c (pascal_language_data): Likewise.
+ * rust-lang.c (rust_language_data): Likewise.
+
2020-06-17 Andrew Burgess <andrew.burgess@embecosm.com>
* ada-lang.c (ada_language_data) Delete
ada_watch_location_expression,
ada_get_symbol_name_matcher, /* la_get_symbol_name_matcher */
&ada_varobj_ops,
- NULL,
ada_is_string_type,
"(...)" /* la_struct_too_deep_ellipsis */
};
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
&c_varobj_ops,
- c_compute_program,
c_is_string_type_p,
"{...}" /* la_struct_too_deep_ellipsis */
};
return c_get_compile_context ();
}
+ /* See language.h. */
+ std::string compute_program (compile_instance *inst,
+ const char *input,
+ struct gdbarch *gdbarch,
+ const struct block *expr_block,
+ CORE_ADDR expr_pc) const override
+ {
+ return c_compute_program (inst, input, gdbarch, expr_block, expr_pc);
+ }
+
/* See language.h. */
void print_type (struct type *type, const char *varstring,
c_watch_location_expression,
cp_get_symbol_name_matcher,
&cplus_varobj_ops,
- cplus_compute_program,
c_is_string_type_p,
"{...}" /* la_struct_too_deep_ellipsis */
};
return cplus_get_compile_context ();
}
+ /* See language.h. */
+ std::string compute_program (compile_instance *inst,
+ const char *input,
+ struct gdbarch *gdbarch,
+ const struct block *expr_block,
+ CORE_ADDR expr_pc) const override
+ {
+ return cplus_compute_program (inst, input, gdbarch, expr_block, expr_pc);
+ }
+
/* See language.h. */
unsigned int search_name_hash (const char *name) const override
{
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
&default_varobj_ops,
- NULL,
c_is_string_type_p,
"{...}" /* la_struct_too_deep_ellipsis */
};
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
&default_varobj_ops,
- NULL,
c_is_string_type_p,
"{...}" /* la_struct_too_deep_ellipsis */
};
/* 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
+ This is used as the compute_program language method; see that
for a description of the arguments. */
extern std::string c_compute_program (compile_instance *inst,
/* 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
+ This is used as the compute_program language method; see that
for a description of the arguments. */
extern std::string cplus_compute_program (compile_instance *inst,
cplus_add_code_header, c_add_code_footer,
cplus_add_input> cplus_compile_program;
-/* The la_compute_program method for C. */
+/* The compute_program method for C. */
std::string
c_compute_program (compile_instance *inst,
return program.compute (input, expr_block, expr_pc);
}
-/* The la_compute_program method for C++. */
+/* The compute_program method for C++. */
std::string
cplus_compute_program (compile_instance *inst,
error (_("Neither a simple expression, or a multi-line specified."));
std::string code
- = current_language->la_compute_program (compiler.get (), input, gdbarch,
- expr_block, expr_pc);
+ = current_language->compute_program (compiler.get (), input, gdbarch,
+ expr_block, expr_pc);
if (compile_debug)
fprintf_unfiltered (gdb_stdlog, "debug output:\n\n%s", code.c_str ());
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
&default_varobj_ops,
- NULL,
c_is_string_type_p,
"{...}" /* la_struct_too_deep_ellipsis */
};
c_watch_location_expression,
cp_get_symbol_name_matcher, /* la_get_symbol_name_matcher */
&default_varobj_ops,
- NULL,
f_is_string_type_p,
"(...)" /* la_struct_too_deep_ellipsis */
};
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
&default_varobj_ops,
- NULL,
go_is_string_type_p,
"{...}" /* la_struct_too_deep_ellipsis */
};
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
&default_varobj_ops,
- NULL,
default_is_string_type_p,
"{...}" /* la_struct_too_deep_ellipsis */
};
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
&default_varobj_ops,
- NULL,
default_is_string_type_p,
"{...}" /* la_struct_too_deep_ellipsis */
};
/* Various operations on varobj. */
const struct lang_varobj_ops *la_varobj_ops;
- /* This method must be defined if 'la_get_gcc_context' is defined.
- If 'la_get_gcc_context' is not defined, then this method is
- ignored.
-
- This takes the user-supplied text and returns a new bit of code
- to compile.
-
- INST is the compiler instance being used.
- INPUT is the user's input text.
- GDBARCH is the architecture to use.
- EXPR_BLOCK is the block in which the expression is being
- parsed.
- EXPR_PC is the PC at which the expression is being parsed. */
-
- std::string (*la_compute_program) (compile_instance *inst,
- const char *input,
- struct gdbarch *gdbarch,
- const struct block *expr_block,
- CORE_ADDR expr_pc);
-
/* Return true if TYPE is a string type. */
bool (*la_is_string_type_p) (struct type *type);
return nullptr;
}
+ /* This method must be overridden if 'get_compile_instance' is
+ overridden.
+
+ This takes the user-supplied text and returns a new bit of code
+ to compile.
+
+ INST is the compiler instance being used.
+ INPUT is the user's input text.
+ GDBARCH is the architecture to use.
+ EXPR_BLOCK is the block in which the expression is being
+ parsed.
+ EXPR_PC is the PC at which the expression is being parsed. */
+
+ virtual std::string compute_program (compile_instance *inst,
+ const char *input,
+ struct gdbarch *gdbarch,
+ const struct block *expr_block,
+ CORE_ADDR expr_pc) const
+ {
+ gdb_assert_not_reached ("language_defn::compute_program");
+ }
+
/* Hash the given symbol search name. */
virtual unsigned int search_name_hash (const char *name) const;
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
&default_varobj_ops,
- NULL,
m2_is_string_type_p,
"{...}" /* la_struct_too_deep_ellipsis */
};
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
&default_varobj_ops,
- NULL,
c_is_string_type_p,
"{...}" /* la_struct_too_deep_ellipsis */
};
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
&default_varobj_ops,
- NULL,
c_is_string_type_p,
"{...}" /* la_struct_too_deep_ellipsis */
};
c_watch_location_expression,
NULL, /* la_compare_symbol_for_completion */
&default_varobj_ops,
- NULL,
pascal_is_string_type_p,
"{...}" /* la_struct_too_deep_ellipsis */
};
rust_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
&default_varobj_ops,
- NULL,
rust_is_string_type_p,
"{...}" /* la_struct_too_deep_ellipsis */
};