gdb: Convert language la_read_var_value field to a method
This commit changes the language_data::la_read_var_value function pointer member variable into a member function of language_defn. An interesting aspect of this change is that the implementation of language_defn::read_var_value is actually in findvar.c. This is partly historical, the new language_defn::read_var_value is a rename of default_read_var_value, which was already in that file, but also, that is the file that contains the helper functions needed by the read_var_value method, so it makes sens that the method implementation should continue to live there (I think). There should be no user visible changes after this commit. gdb/ChangeLog: * ada-lang.c (ada_read_var_value): Delete function, move implementation to... (ada_language::read_var_value): ...here. (ada_language_data): Delete la_read_var_value initializer. * c-lang.c (c_language_data): Likewise. (cplus_language_data): Likewise. (minimal_language_data): Likewise. * d-lang.c (d_language_data): Likewise. * f-lang.c (f_language_data): Likewise. * findvar.c (default_read_var_value): Rename to... (language_defn::read_var_value): ...this. * findvar.c (read_var_value): Update header comment, and change to call member function instead of function pointer. * go-lang.c (go_language_data): Likewise. * language.c (unknown_language_data): Delete la_read_var_value initializer. (auto_language_data): Likewise. * language.h (struct language_data): Delete la_read_var_value field. (language_defn::read_var_value): New member function. (default_read_var_value): Delete declaration. * m2-lang.c (m2_language_data): Delete la_read_var_value 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. * value.h (default_read_var_value): Delete declaration.
This commit is contained in:
parent
5bd40f2a3f
commit
15e5fd3556
15 changed files with 72 additions and 61 deletions
|
@ -14023,26 +14023,6 @@ ada_get_symbol_name_matcher (const lookup_name_info &lookup_name)
|
|||
}
|
||||
}
|
||||
|
||||
/* Implement the "la_read_var_value" language_defn method for Ada. */
|
||||
|
||||
static struct value *
|
||||
ada_read_var_value (struct symbol *var, const struct block *var_block,
|
||||
struct frame_info *frame)
|
||||
{
|
||||
/* The only case where default_read_var_value is not sufficient
|
||||
is when VAR is a renaming... */
|
||||
if (frame != nullptr)
|
||||
{
|
||||
const struct block *frame_block = get_frame_block (frame, NULL);
|
||||
if (frame_block != nullptr && ada_is_renaming_symbol (var))
|
||||
return ada_read_renaming_var_value (var, frame_block);
|
||||
}
|
||||
|
||||
/* This is a typical case where we expect the default_read_var_value
|
||||
function to work. */
|
||||
return default_read_var_value (var, var_block, frame);
|
||||
}
|
||||
|
||||
static const char *ada_extensions[] =
|
||||
{
|
||||
".adb", ".ads", ".a", ".ada", ".dg", NULL
|
||||
|
@ -14071,7 +14051,6 @@ extern const struct language_data ada_language_data =
|
|||
ada_print_typedef, /* Print a typedef using appropriate syntax */
|
||||
ada_value_print_inner, /* la_value_print_inner */
|
||||
ada_value_print, /* Print a top-level value */
|
||||
ada_read_var_value, /* la_read_var_value */
|
||||
NULL, /* Language specific skip_trampoline */
|
||||
NULL, /* name_of_this */
|
||||
true, /* la_store_sym_names_in_linkage_form_p */
|
||||
|
@ -14120,6 +14099,26 @@ public:
|
|||
LA_VALUE_PRINT (index_value, stream, options);
|
||||
fprintf_filtered (stream, " => ");
|
||||
}
|
||||
|
||||
/* Implement the "read_var_value" language_defn method for Ada. */
|
||||
|
||||
struct value *read_var_value (struct symbol *var,
|
||||
const struct block *var_block,
|
||||
struct frame_info *frame) const override
|
||||
{
|
||||
/* The only case where default_read_var_value is not sufficient
|
||||
is when VAR is a renaming... */
|
||||
if (frame != nullptr)
|
||||
{
|
||||
const struct block *frame_block = get_frame_block (frame, NULL);
|
||||
if (frame_block != nullptr && ada_is_renaming_symbol (var))
|
||||
return ada_read_renaming_var_value (var, frame_block);
|
||||
}
|
||||
|
||||
/* This is a typical case where we expect the default_read_var_value
|
||||
function to work. */
|
||||
return language_defn::read_var_value (var, var_block, frame);
|
||||
}
|
||||
};
|
||||
|
||||
/* Single instance of the Ada language class. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue