diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-03-22 17:35:22 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-03-22 17:35:22 +0000 |
commit | 3167638f1e8e74e15650adda08449c2e32572552 (patch) | |
tree | eed14184dd60faa0d6e71e341343143c7c338465 /gdb | |
parent | ce406537179aa72cf126062f938ceed5eae0de4c (diff) | |
download | gdb-3167638f1e8e74e15650adda08449c2e32572552.zip gdb-3167638f1e8e74e15650adda08449c2e32572552.tar.gz gdb-3167638f1e8e74e15650adda08449c2e32572552.tar.bz2 |
gdb/
Code cleanup.
* c-typeprint.c (c_type_print_args): Change parameter show_artificial
to linkage_name. Invert its value. Update the function comment.
(c_type_print_varspec_suffix): Invert it at the caller.
* dwarf2read.c (dwarf2_compute_name): Invert it at the caller.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/c-typeprint.c | 22 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 2 |
3 files changed, 19 insertions, 13 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 98d6456..df28202 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2011-03-22 Jan Kratochvil <jan.kratochvil@redhat.com> + + Code cleanup. + * c-typeprint.c (c_type_print_args): Change parameter show_artificial + to linkage_name. Invert its value. Update the function comment. + (c_type_print_varspec_suffix): Invert it at the caller. + * dwarf2read.c (dwarf2_compute_name): Invert it at the caller. + 2011-03-22 Pedro Alves <pedro@codesourcery.com> * infcmd.c (post_create_inferior): Ignore NOT_AVAILABLE_ERROR diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index c70fa4b..2e23dd7 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -387,17 +387,16 @@ c_type_print_modifier (struct type *type, struct ui_file *stream, /* Print out the arguments of TYPE, which should have TYPE_CODE_METHOD or TYPE_CODE_FUNC, to STREAM. Artificial arguments, such as "this" - in non-static methods, are displayed if SHOW_ARTIFICIAL is - non-zero. If SHOW_ARTIFICIAL is zero and LANGUAGE is language_cplus - the topmost parameter types get removed their possible const and volatile - qualifiers to match demangled linkage name parameters part of such function - type. LANGUAGE is the language in which TYPE was defined. This is - a necessary evil since this code is used by the C, C++, and Java backends. - */ + in non-static methods, are displayed if LINKAGE_NAME is zero. If + LINKAGE_NAME is non-zero and LANGUAGE is language_cplus the topmost + parameter types get removed their possible const and volatile qualifiers to + match demangled linkage name parameters part of such function type. + LANGUAGE is the language in which TYPE was defined. This is a necessary + evil since this code is used by the C, C++, and Java backends. */ void c_type_print_args (struct type *type, struct ui_file *stream, - int show_artificial, enum language language) + int linkage_name, enum language language) { int i, len; struct field *args; @@ -411,7 +410,7 @@ c_type_print_args (struct type *type, struct ui_file *stream, { struct type *param_type; - if (TYPE_FIELD_ARTIFICIAL (type, i) && !show_artificial) + if (TYPE_FIELD_ARTIFICIAL (type, i) && linkage_name) continue; if (printed_any) @@ -422,7 +421,7 @@ c_type_print_args (struct type *type, struct ui_file *stream, param_type = TYPE_FIELD_TYPE (type, i); - if (language == language_cplus && !show_artificial) + if (language == language_cplus && linkage_name) { /* C++ standard, 13.1 Overloadable declarations, point 3, item: - Parameter declarations that differ only in the presence or @@ -658,8 +657,7 @@ c_type_print_varspec_suffix (struct type *type, if (passed_a_ptr) fprintf_filtered (stream, ")"); if (!demangled_args) - c_type_print_args (type, stream, 1, - current_language->la_language); + c_type_print_args (type, stream, 0, current_language->la_language); c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, show, passed_a_ptr, 0); break; diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 810f66a..190f0bc 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -4990,7 +4990,7 @@ dwarf2_compute_name (char *name, struct die_info *die, struct dwarf2_cu *cu, { struct type *type = read_type_die (die, cu); - c_type_print_args (type, buf, 0, cu->language); + c_type_print_args (type, buf, 1, cu->language); if (cu->language == language_java) { |