mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-29 16:38:05 +08:00
gdb: avoid accessing global C++ language implementation functions
The function c_printchar is called from two places; it provides the implementation of language_defn::printchar and it is called from dwarf2_compute_name. It would be nice to rename c_printchar as language_defn::printchar and so avoid the trampoline. To achieve this, instead of calling c_printchar directly from the DWARF code, I lookup the C++ language object and call the printchar member function. In a later commit I can then rename c_printchar. There should be no user visible changes after this commit. gdb/ChangeLog: * dwarf2/read.c (dwarf2_compute_name): Call methods on C++ language object instead of calling global functions directly.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2020-12-23 Andrew Burgess <andrew.burgess@embecosm.com>
|
||||||
|
|
||||||
|
* dwarf2/read.c (dwarf2_compute_name): Call methods on C++
|
||||||
|
language object instead of calling global functions directly.
|
||||||
|
|
||||||
2020-12-23 Andrew Burgess <andrew.burgess@embecosm.com>
|
2020-12-23 Andrew Burgess <andrew.burgess@embecosm.com>
|
||||||
|
|
||||||
* valprint.c (print_char_chars): Delete definition.
|
* valprint.c (print_char_chars): Delete definition.
|
||||||
|
@ -10549,6 +10549,7 @@ dwarf2_compute_name (const char *name,
|
|||||||
struct attribute *attr;
|
struct attribute *attr;
|
||||||
struct die_info *child;
|
struct die_info *child;
|
||||||
int first = 1;
|
int first = 1;
|
||||||
|
const language_defn *cplus_lang = language_def (cu->language);
|
||||||
|
|
||||||
die->building_fullname = 1;
|
die->building_fullname = 1;
|
||||||
|
|
||||||
@ -10583,7 +10584,7 @@ dwarf2_compute_name (const char *name,
|
|||||||
|
|
||||||
if (child->tag == DW_TAG_template_type_param)
|
if (child->tag == DW_TAG_template_type_param)
|
||||||
{
|
{
|
||||||
c_print_type (type, "", &buf, -1, 0, cu->language,
|
cplus_lang->print_type (type, "", &buf, -1, 0,
|
||||||
&type_print_raw_options);
|
&type_print_raw_options);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -10604,7 +10605,7 @@ dwarf2_compute_name (const char *name,
|
|||||||
if (type->has_no_signedness ())
|
if (type->has_no_signedness ())
|
||||||
/* GDB prints characters as NUMBER 'CHAR'. If that's
|
/* GDB prints characters as NUMBER 'CHAR'. If that's
|
||||||
changed, this can use value_print instead. */
|
changed, this can use value_print instead. */
|
||||||
c_printchar (value, type, &buf);
|
cplus_lang->printchar (value, type, &buf);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct value_print_options opts;
|
struct value_print_options opts;
|
||||||
|
Reference in New Issue
Block a user