stream, show, passed_a_ptr, 0,
language, flags, podata);
break;
-
- case TYPE_CODE_UNDEF:
- case TYPE_CODE_STRUCT:
- case TYPE_CODE_UNION:
- case TYPE_CODE_ENUM:
- case TYPE_CODE_FLAGS:
- case TYPE_CODE_INT:
- case TYPE_CODE_FLT:
- case TYPE_CODE_VOID:
- case TYPE_CODE_ERROR:
- case TYPE_CODE_CHAR:
- case TYPE_CODE_BOOL:
- case TYPE_CODE_SET:
- case TYPE_CODE_RANGE:
- case TYPE_CODE_STRING:
- case TYPE_CODE_COMPLEX:
- case TYPE_CODE_NAMESPACE:
- case TYPE_CODE_DECFLOAT:
- case TYPE_CODE_FIXED_POINT:
- /* These types need no prefix. They are listed here so that
- gcc -Wall will reveal any types that haven't been handled. */
- break;
- default:
- error (_("type not handled in c_type_print_varspec_prefix()"));
- break;
}
}
c_type_print_varspec_suffix (type->target_type (), stream,
show, passed_a_ptr, 0, language, flags);
break;
-
- case TYPE_CODE_UNDEF:
- case TYPE_CODE_STRUCT:
- case TYPE_CODE_UNION:
- case TYPE_CODE_FLAGS:
- case TYPE_CODE_ENUM:
- case TYPE_CODE_INT:
- case TYPE_CODE_FLT:
- case TYPE_CODE_VOID:
- case TYPE_CODE_ERROR:
- case TYPE_CODE_CHAR:
- case TYPE_CODE_BOOL:
- case TYPE_CODE_SET:
- case TYPE_CODE_RANGE:
- case TYPE_CODE_STRING:
- case TYPE_CODE_COMPLEX:
- case TYPE_CODE_NAMESPACE:
- case TYPE_CODE_DECFLOAT:
- case TYPE_CODE_FIXED_POINT:
- /* These types do not need a suffix. They are listed so that
- gcc -Wall will report types that may not have been
- considered. */
- break;
- default:
- error (_("type not handled in c_type_print_varspec_suffix()"));
- break;
}
}
plongest (type->bounds ()->high.const_val ()));
gdb_printf (stream, "of ");
break;
-
- case TYPE_CODE_UNDEF:
- case TYPE_CODE_STRUCT:
- case TYPE_CODE_UNION:
- case TYPE_CODE_ENUM:
- case TYPE_CODE_INT:
- case TYPE_CODE_FLT:
- case TYPE_CODE_VOID:
- case TYPE_CODE_ERROR:
- case TYPE_CODE_CHAR:
- case TYPE_CODE_BOOL:
- case TYPE_CODE_SET:
- case TYPE_CODE_RANGE:
- case TYPE_CODE_STRING:
- case TYPE_CODE_COMPLEX:
- case TYPE_CODE_TYPEDEF:
- case TYPE_CODE_FIXED_POINT:
- /* These types need no prefix. They are listed here so that
- gcc -Wall will reveal any types that haven't been handled. */
- break;
- default:
- gdb_assert_not_reached ("unexpected type");
- break;
}
}
type_print_func_varspec_suffix (type, stream, show,
passed_a_ptr, 0, flags);
break;
-
- case TYPE_CODE_UNDEF:
- case TYPE_CODE_STRUCT:
- case TYPE_CODE_UNION:
- case TYPE_CODE_ENUM:
- case TYPE_CODE_INT:
- case TYPE_CODE_FLT:
- case TYPE_CODE_VOID:
- case TYPE_CODE_ERROR:
- case TYPE_CODE_CHAR:
- case TYPE_CODE_BOOL:
- case TYPE_CODE_SET:
- case TYPE_CODE_RANGE:
- case TYPE_CODE_STRING:
- case TYPE_CODE_COMPLEX:
- case TYPE_CODE_TYPEDEF:
- case TYPE_CODE_FIXED_POINT:
- /* These types do not need a suffix. They are listed so that
- gcc -Wall will report types that may not have been considered. */
- break;
- default:
- gdb_assert_not_reached ("unexpected type");
- break;
}
}
--- /dev/null
+# Copyright 2023 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Test "ptype INTERNAL_FUNCTION" in all languages.
+
+proc test_ptype_internal_function {} {
+ set all_languages [get_set_option_choices "set language"]
+
+ foreach_with_prefix lang $all_languages {
+ if { $lang == "auto" || $lang == "local" } {
+ # Avoid duplicate testing.
+ continue
+ }
+
+ gdb_test_no_output "set language $lang"
+
+ if {$lang == "unknown"} {
+ gdb_test "ptype \$_isvoid" \
+ "expression parsing not implemented for language \"Unknown\""
+ } elseif {$lang == "ada"} {
+ gdb_test "ptype \$_isvoid" "<<internal function>>"
+ } else {
+ gdb_test "ptype \$_isvoid" "<internal function>"
+ }
+ }
+}
+
+clean_restart
+
+test_ptype_internal_function
gdb_test "p ++a1" "No symbol.*" "before: ++a1"
gdb_test "p a1.getarrayind(5)" "Couldn't find method.*" \
"before: a1.getarrayind(5)"
+gdb_test "ptype a1.getarrayind" \
+ "There is no member or method named getarrayind\\." \
+ "before: ptype a1.getarrayind"
gdb_test "p a_ptr->geta()" ".* = 60" "before: a_ptr->geta()"
gdb_test "p b_geta" ".* = 1" "before: b_geta 1"
gdb_test "p ++a1" "From Python <plus_plus_A>.*6" "after: ++a1"
gdb_test "p a1.getarrayind(5)" "From Python <A_getarrayind>.*5" \
"after: a1.getarrayind(5)"
+gdb_test "ptype a1.getarrayind" \
+ "There is no member or method named getarrayind\\." \
+ "after: ptype a1.getarrayind"
+
gdb_test "p a1\[6\]" ".*int &.*6" "after a1\[\]"
gdb_test "p b1\[7\]" ".*const int &.*7" "after b1\[\]"
# Note the following test. Xmethods on dynamc types are not looked up