+2020-09-16 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * ada-lang.c (ada_language_data): Remove
+ la_store_sym_names_in_linkage_form_p initializer.
+ (ada_language::store_sym_names_in_linkage_form_p): New member
+ function.
+ * c-lang.c (c_language_data): Remove
+ la_store_sym_names_in_linkage_form_p initializer.
+ (c_language::store_sym_names_in_linkage_form_p): New member
+ function.
+ (cplus_language_data): Remove la_store_sym_names_in_linkage_form_p
+ initializer.
+ (asm_language_data): Likewise.
+ (asm_language::store_sym_names_in_linkage_form_p): New member
+ function.
+ (minimal_language_data): Remove
+ la_store_sym_names_in_linkage_form_p initializer.
+ (minimal_language::store_sym_names_in_linkage_form_p): New member
+ function.
+ * d-lang.c (d_language_data): Remove
+ la_store_sym_names_in_linkage_form_p initializer.
+ * dwarf2/read.c (dwarf2_physname): Update call to
+ store_sym_names_in_linkage_form_p.
+ * f-lang.c (f_language_data): Remove
+ la_store_sym_names_in_linkage_form_p initializer.
+ * go-lang.c (go_language_data): Remove
+ la_store_sym_names_in_linkage_form_p initializer.
+ * language.c (unknown_language_data): Remove
+ la_store_sym_names_in_linkage_form_p initializer.
+ (unknown_language::store_sym_names_in_linkage_form_p): New member
+ function.
+ (auto_language_data): Remove la_store_sym_names_in_linkage_form_p
+ initializer.
+ (auto_language::store_sym_names_in_linkage_form_p): New member
+ function.
+ * language.h (language_data): Remove
+ la_store_sym_names_in_linkage_form_p member variable.
+ (language_defn::store_sym_names_in_linkage_form_p): New member
+ function.
+ * m2-lang.c (m2_language_data): Remove
+ la_store_sym_names_in_linkage_form_p 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-09-16 Andrew Burgess <andrew.burgess@embecosm.com>
* ada-lang.c (ada_language_data): Remove string_lower_bound
array_row_major,
macro_expansion_no,
&ada_exp_descriptor,
- true, /* la_store_sym_names_in_linkage_form_p */
ada_op_print_tab, /* expression operators for printing */
&ada_varobj_ops,
};
bool c_style_arrays_p () const override
{ return false; }
+ /* See language.h. */
+
+ bool store_sym_names_in_linkage_form_p () const override
+ { return true; }
+
protected:
/* See language.h. */
array_row_major,
macro_expansion_c,
&exp_descriptor_c,
- true, /* la_store_sym_names_in_linkage_form_p */
c_op_print_tab, /* expression operators for printing */
&c_varobj_ops,
};
{
c_print_type (type, varstring, stream, show, level, flags);
}
+
+ /* See language.h. */
+
+ bool store_sym_names_in_linkage_form_p () const override
+ { return true; }
};
/* Single instance of the C language class. */
array_row_major,
macro_expansion_c,
&exp_descriptor_c,
- false, /* la_store_sym_names_in_linkage_form_p */
c_op_print_tab, /* expression operators for printing */
&cplus_varobj_ops,
};
array_row_major,
macro_expansion_c,
&exp_descriptor_c,
- true, /* la_store_sym_names_in_linkage_form_p */
c_op_print_tab, /* expression operators for printing */
&default_varobj_ops,
};
{
c_print_type (type, varstring, stream, show, level, flags);
}
+
+ /* See language.h. */
+
+ bool store_sym_names_in_linkage_form_p () const override
+ { return true; }
};
/* The single instance of the ASM language class. */
array_row_major,
macro_expansion_c,
&exp_descriptor_c,
- true, /* la_store_sym_names_in_linkage_form_p */
c_op_print_tab, /* expression operators for printing */
&default_varobj_ops,
};
{
c_print_type (type, varstring, stream, show, level, flags);
}
+
+ /* See language.h. */
+
+ bool store_sym_names_in_linkage_form_p () const override
+ { return true; }
};
/* The single instance of the minimal language class. */
array_row_major,
macro_expansion_no,
&exp_descriptor_c,
- false, /* la_store_sym_names_in_linkage_form_p */
d_op_print_tab, /* Expression operators for printing. */
&default_varobj_ops,
};
if (mangled != NULL)
{
- if (language_def (cu->language)->la_store_sym_names_in_linkage_form_p)
+ if (language_def (cu->language)->store_sym_names_in_linkage_form_p ())
{
/* Do nothing (do not demangle the symbol name). */
}
array_column_major,
macro_expansion_no,
&exp_descriptor_f,
- false, /* la_store_sym_names_in_linkage_form_p */
f_op_print_tab, /* expression operators for printing */
&default_varobj_ops,
};
array_row_major,
macro_expansion_no,
&exp_descriptor_c,
- false, /* la_store_sym_names_in_linkage_form_p */
go_op_print_tab, /* Expression operators for printing. */
&default_varobj_ops,
};
array_row_major,
macro_expansion_no,
&exp_descriptor_standard,
- true, /* store_sym_names_in_linkage_form_p */
unk_op_print_tab, /* expression operators for printing */
&default_varobj_ops,
};
const char *name_of_this () const override
{ return "this"; }
+
+ /* See language.h. */
+
+ bool store_sym_names_in_linkage_form_p () const override
+ { return true; }
};
/* Single instance of the unknown language class. */
array_row_major,
macro_expansion_no,
&exp_descriptor_standard,
- false, /* store_sym_names_in_linkage_form_p */
unk_op_print_tab, /* expression operators for printing */
&default_varobj_ops,
};
const struct exp_descriptor *la_exp_desc;
- /* Now come some hooks for lookup_symbol. */
-
- /* True if the symbols names should be stored in GDB's data structures
- for minimal/partial/full symbols using their linkage (aka mangled)
- form; false if the symbol names should be demangled first.
-
- Most languages implement symbol lookup by comparing the demangled
- names, in which case it is advantageous to store that information
- already demangled, and so would set this field to false.
-
- On the other hand, some languages have opted for doing symbol
- lookups by comparing mangled names instead, for reasons usually
- specific to the language. Those languages should set this field
- to true.
-
- And finally, other languages such as C or Asm do not have
- the concept of mangled vs demangled name, so those languages
- should set this field to true as well, to prevent any accidental
- demangling through an unrelated language's demangler. */
-
- const bool la_store_sym_names_in_linkage_form_p;
-
/* Table for printing expressions. */
const struct op_print *la_op_print_tab;
virtual char string_lower_bound () const
{ return c_style_arrays_p () ? 0 : 1; }
+ /* Returns true if the symbols names should be stored in GDB's data
+ structures for minimal/partial/full symbols using their linkage (aka
+ mangled) form; false if the symbol names should be demangled first.
+
+ Most languages implement symbol lookup by comparing the demangled
+ names, in which case it is advantageous to store that information
+ already demangled, and so would return false, which is the default.
+
+ On the other hand, some languages have opted for doing symbol lookups
+ by comparing mangled names instead, for reasons usually specific to
+ the language. Those languages should override this function and
+ return true.
+
+ And finally, other languages such as C or Asm do not have the concept
+ of mangled vs demangled name, so those languages should also override
+ this function and return true, to prevent any accidental demangling
+ through an unrelated language's demangler. */
+
+ virtual bool store_sym_names_in_linkage_form_p () const
+ { return false; }
+
protected:
/* This is the overridable part of the GET_SYMBOL_NAME_MATCHER method.
array_row_major,
macro_expansion_no,
&exp_descriptor_modula2,
- false, /* la_store_sym_names_in_linkage_form_p */
m2_op_print_tab, /* expression operators for printing */
&default_varobj_ops,
};
array_row_major,
macro_expansion_c,
&exp_descriptor_standard,
- false, /* la_store_sym_names_in_linkage_form_p */
objc_op_print_tab, /* Expression operators for printing */
&default_varobj_ops,
};
array_row_major,
macro_expansion_c,
&exp_descriptor_opencl,
- false, /* la_store_sym_names_in_linkage_form_p */
c_op_print_tab, /* expression operators for printing */
&default_varobj_ops,
};
array_row_major,
macro_expansion_no,
&exp_descriptor_standard,
- false, /* la_store_sym_names_in_linkage_form_p */
pascal_op_print_tab, /* expression operators for printing */
&default_varobj_ops,
};
array_row_major,
macro_expansion_no,
&exp_descriptor_rust,
- false, /* la_store_sym_names_in_linkage_form_p */
c_op_print_tab, /* expression operators for printing */
&default_varobj_ops,
};