summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp
AgeCommit message (Collapse)Author
2018-01-02Update copyright year range in all GDB filesJoel Brobecker
gdb/ChangeLog: Update copyright year range in all GDB files
2017-12-13Fix regression: expression completer and scope operator (PR gdb/22584)Pedro Alves
I noticed this regression in the expression completer: "(gdb) p std::[TAB]" => "(gdb) p std::std::" obviously we should have not completed to "std::std::". The problem is that in the earlier big completer rework, I missed taking into account the fact that with expressions, the completion word point is not always at the start of the symbol name (it is with linespecs). The fix is to run the common prefix / LCD string (what readline uses to expand the input line) through make_completion_match_str too. New testcase included, exercising both TAB completion and the complete command. gdb/ChangeLog: 2017-12-13 Pedro Alves <palves@redhat.com> * completer.c (completion_tracker::maybe_add_completion): New 'text' and 'word' parameters. Use make_completion_match_str. (completion_tracker::add_completion): New 'text' and 'word' parameters. Pass down. (completion_tracker::recompute_lowest_common_denominator): Change parameter type to gdb::unique_xmalloc_ptr rval ref. Adjust. * completer.h (completion_tracker::add_completion): New 'text' and 'word' parameters. (completion_tracker::recompute_lowest_common_denominator): Change parameter type to gdb::unique_xmalloc_ptr rval ref. (completion_tracker::recompute_lowest_common_denominator): Change parameter type to gdb::unique_xmalloc_ptr rval ref. * symtab.c (completion_list_add_name): Pass down 'text' and 'word' as well. gdb/testsuite/ChangeLog: 2017-12-13 Pedro Alves <palves@redhat.com> * gdb.cp/cpcompletion.exp: Load completion-support.exp. ("expression with namespace"): New set of tests. * gdb.cp/pr9594.cc (Test_NS::foo, Test_NS::bar) (Nested::Test_NS::qux): New. * lib/completion-support.exp (test_gdb_complete_cmd_multiple): Add defaults to 'start_quote_char' and 'end_quote_char' parameters.
2017-12-07Record nested typesKeith Seitz
GDB currently does not track types defined in classes. Consider: class A { public: class B { public: class C { }; }; }; (gdb) ptype A type = class A { <no data fields> } This patch changes this behavior so that GDB records these nested types and displays them to the user when he has set the (new) "print type" option "nested-type-limit." Example: (gdb) set print type nested-type-limit 1 (gdb) ptype A type = class A { <no data fields> class A::B { <no data fields> }; } (gdb) set print type nested-type-limit 2 type = class A { <no data fields> class A::B { <no data fields> class A::B::C { <no data fields> }; }; } By default, the code maintains the status quo, that is, it will not print any nested type definitions at all. Testing is carried out via cp_ptype_class which required quite a bit of modification to permit recursive calling (for the nested types). This was most easily facilitated by turning the ptype command output into a queue. Upshot: the test suite now has stack and queue data structures that may be used by test writers. gdb/ChangeLog * NEWS (New commands): Mention set/show print type nested-type-limit. * c-typeprint.c (c_type_print_base): Print out nested types. * dwarf2read.c (struct typedef_field_list): Rename to ... (struct decl_field_list): ... this. Change all uses. (struct field_info) <nested_types_list, nested_types_list_count>: New fields. (add_partial_symbol): Look for nested type definitions in C++, too. (dwarf2_add_typedef): Rename to ... (dwarf2_add_type_defn): ... this. (type_can_define_types): New function. Update assertion to use type_can_define_types. Permit NULL for a field's name. (process_structure_scope): Handle child DIEs of types that can define types. Copy the list of nested types into the type struct. * gdbtypes.h (struct typedef_field): Rename to ... (struct decl_field): ... this. Change all uses. [is_protected, is_private]: New fields. (struct cplus_struct_type) <nested_types, nested_types_count>: New fields. (TYPE_NESTED_TYPES_ARRAY, TYPE_NESTED_TYPES_FIELD) (TYPE_NESTED_TYPES_FIELD_NAME, TYPE_NESTED_TYPES_FIELD_TYPE) (TYPE_NESTED_TYPES_COUNT, TYPE_NESTED_TYPES_FIELD_PROTECTED) (TYPE_NESTED_TYPES_FIELD_PRIVATE): New macros. * typeprint.c (type_print_raw_options, default_ptype_flags): Add default value for print_nested_type_limit. (print_nested_type_limit): New static variable. (set_print_type_nested_types, show_print_type_nested_types): New functions. (_initialize_typeprint): Register new commands for set/show `print-nested-type-limit'. * typeprint.h (struct type_print_options) [print_nested_type_limit]: New field. gdb/testsuite/ChangeLog * gdb.cp/nested-types.cc: New file. * gdb.cp/nested-types.exp: New file. * lib/cp-support.exp: Load data-structures.exp library. (debug_cp_test_ptype_class): New global. (cp_ptype_class_verbose, next_line): New procedures. (cp_test_ptype_class): Add and document new parameter `recursive_qid'. Add and document new return value. Switch the list of lines to a queue. Add support for new `type' key for nested type definitions. Add debugging/troubleshooting messages. * lib/data-structures.exp: New file. gdb/doc/ChangeLog * gdb.texinfo (Symbols): Document "set print type nested-type-limit" and "show print type nested-type-limit".
2017-12-01Replace mail address with the URL in copyright headerYao Qi
The copyright header in most of GDB files were changed from mail address to the URL in the conversion to GPLv3 in Aug 2007. However, some files still use mail address instead of the URL. This patch fixes them. gdb/testsuite: 2017-12-01 Yao Qi <yao.qi@linaro.org> * gdb.arch/aarch64-atomic-inst.exp: Replace mail address with the URL in copyright header. * gdb.arch/aarch64-fp.exp: Likewise. * gdb.arch/ppc64-atomic-inst.exp: Likewise. * gdb.arch/ppc64-isa207-atomic-inst.exp: Likewise. * gdb.base/expand-psymtabs.exp: Likewise. * gdb.cp/expand-psymtabs-cxx.exp: Likewise. * gdb.fortran/common-block.exp: Likewise. * gdb.fortran/common-block.f90: Likewise. * gdb.fortran/logical.exp: Likewise. * gdb.fortran/vla-datatypes.f90: Likewise. * gdb.fortran/vla-sub.f90: Likewise.
2017-11-29Make "break foo" find "A::foo", A::B::foo", etc. [C++ and wild matching]Pedro Alves
This patch teaches GDB about setting breakpoints in all scopes (namespaces and classes) by default. Here's a contrived example: (gdb) b func<tab> (anonymous namespace)::A::function() Bn::(anonymous namespace)::B::function() function(int, int) (anonymous namespace)::B::function() Bn::(anonymous namespace)::function() gdb::(anonymous namespace)::A::function() (anonymous namespace)::B::function() const Bn::(anonymous namespace)::function(int, int) gdb::(anonymous namespace)::function() (anonymous namespace)::function() Bn::B::func() gdb::(anonymous namespace)::function(int, int) (anonymous namespace)::function(int, int) Bn::B::function() gdb::A::func() A::func() Bn::func() gdb::A::function() A::function() Bn::function() gdb::func() B::func() Bn::function(int, int) gdb::function() B::function() Bn::function(long) gdb::function(int, int) B::function() const func() gdb::function(long) B::function_const() const function() (gdb) b function Breakpoint 1 at 0x4005ce: function. (26 locations) (gdb) b B::function<tab> (anonymous namespace)::B::function() B::function() const Bn::B::function() (anonymous namespace)::B::function() const B::function_const() const B::function() Bn::(anonymous namespace)::B::function() (gdb) b B::function Breakpoint 1 at 0x40072c: B::function. (6 locations) To get back the original behavior of interpreting the function name as a fully-qualified name, you can use the new "-qualified" (or "-q") option/flag (added by this commit). For example: (gdb) b B::function (anonymous namespace)::B::function() B::function() const Bn::B::function() (anonymous namespace)::B::function() const B::function_const() const B::function() Bn::(anonymous namespace)::B::function() vs: (gdb) b -qualified B::function B::function() B::function() const B::function_const() const I've chosen "-qualified" / "-q" because "-f" (for "full" or "fully-qualified") is already taken for "-function". Note: the "-qualified" option works with both linespecs and explicit locations. I.e., these are equivalent: (gdb) b -q func (gdb) b -q -f func and so are these: (gdb) b -q filename.cc:func (gdb) b -q -s filename.cc -f func (gdb) b -s filename.cc -q -f func (gdb) b -s filename.cc -f func -q To better understand why I consider wild matching the better default, consider what happens when we get to the point when _all_ of GDB is wrapped under "namespace gdb {}". I have a patch series that does that, and when I started debugging that GDB, I immediately became frustrated. You'd have to write "b gdb::internal_error", "b gdb::foo", "b gdb::bar", etc. etc., which gets annoying pretty quickly. OTOH, consider how this makes it very easy to set breakpoints in classes wrapped in anonymous namespaces. You just don't think of them, GDB finds the symbols for you automatically. (At the Cauldron a couple months ago, several people told me that they run into a similar issue when debugging other C++ projects. One example was when debugging LLVM, which puts all its code under the "llvm" namespace.) Implementation-wise, what the patch does is: - makes C++ symbol name hashing only consider the last component of a symbol name. (so that we can look up symbol names by last-component name only). - adds a C++ symbol name matcher for symbol_name_match_type::WILD, which ignores missing leading specifiers / components. - adjusts a few preexisting testsuite tests to use "-qualified" when they mean it. - adds new testsuite tests. - adds unit tests. Grows the gdb.linespec/ tests like this: -# of expected passes 7823 +# of expected passes 8977 gdb/ChangeLog: 2017-11-29 Pedro Alves <palves@redhat.com> * NEWS: Mention that breakpoints on C++ functions are now set on on all namespaces/classes by default, and mention "break -qualified". * ax-gdb.c (agent_command_1): Adjust to pass a symbol_name_match_type to new_linespec_location. * breakpoint.c (parse_breakpoint_sals): Adjust to get_linespec_location's return type change. (strace_marker_create_sals_from_location): Adjust to pass a symbol_name_match_type to new_linespec_location. (strace_marker_decode_location): Adjust to get_linespec_location's return type change. (strace_command): Adjust to pass a symbol_name_match_type to new_linespec_location. (LOCATION_HELP_STRING): Add paragraph about wildmatching, and mention "-qualified". * c-lang.c (cplus_language_defn): Install cp_search_name_hash. * completer.c (explicit_location_match_type::MATCH_QUALIFIED): New enumerator. (complete_address_and_linespec_locations): New parameter 'match_type'. Pass it down. (explicit_options): Add "-qualified". (collect_explicit_location_matches): Pass the requested match type to the linespec completers. Handle MATCH_QUALIFIED. (location_completer): Handle "-qualified" combined with linespecs. * cp-support.c (cp_search_name_hash): New. (cp_symbol_name_matches_1): Implement wild matching for C++. (cp_fq_symbol_name_matches): Reimplement. (cp_get_symbol_name_matcher): Return different matchers depending on the lookup name's match type. (selftests::test_cp_symbol_name_matches): Add wild matching tests. * cp-support.h (cp_search_name_hash): New declaration. * dwarf2read.c (selftests::dw2_expand_symtabs_matching::test_symbols): Add symbols. (test_dw2_expand_symtabs_matching_symbol): Add wild matching tests. * guile/scm-breakpoint.c (gdbscm_register_breakpoint_x): Adjust to pass a symbol_name_match_type to new_linespec_location. * linespec.c (linespec_parse_basic): Lookup function symbols using the parser's symbol name match type. (convert_explicit_location_to_linespec): New symbol_name_match_type parameter. Pass it down to find_linespec_symbols. (convert_explicit_location_to_sals): Pass the location's name match type to convert_explicit_location_to_linespec. (parse_linespec): New match_type parameter. Save it in the parser. (linespec_parser_new): Default to symbol_name_match_type::WILD. (linespec_complete_function): New symbol_name_match_type parameter. Use it. (complete_linespec_component): Pass down the parser's recorded name match type. (linespec_complete_label): New symbol_name_match_type parameter. Use it. (linespec_complete): New symbol_name_match_type parameter. Save it in the parser and pass it down. Adjust to get_linespec_location's prototype change. (find_function_symbols, find_linespec_symbols): New symbol_name_match_type parameter. Pass it down instead of assuming symbol_name_match_type::WILD. * linespec.h (linespec_complete, linespec_complete_function) (linespec_complete_label): New symbol_name_match_type parameter. * location.c (event_location::linespec_location): Now a struct linespec_location. (EL_LINESPEC): Adjust. (initialize_explicit_location): Default to symbol_name_match_type::WILD. (new_linespec_location): New symbol_name_match_type parameter. Record it in the location. (get_linespec_location): Now returns a struct linespec_location. (new_explicit_location): Also copy func_name_match_type. (explicit_to_string_internal) (string_to_explicit_location): Handle "-qualified". (copy_event_location): Adjust to LINESPEC_LOCATION type change. Copy symbol_name_match_type fields. (event_location_deleter::operator()): Adjust to LINESPEC_LOCATION type change. (event_location_to_string): Adjust to LINESPEC_LOCATION type change. Handle "-qualfied". (string_to_explicit_location): Handle "-qualified". (string_to_event_location_basic): New symbol_name_match_type parameter. Pass it down. (string_to_event_location): Handle "-qualified". * location.h (struct linespec_location): New. (explicit_location::func_name_match_type): New field. (new_linespec_location): Now returns a const linespec_location *. (string_to_event_location_basic): New symbol_name_match_type parameter. (explicit_completion_info::saw_explicit_location_option): New field. * mi/mi-cmd-break.c (mi_cmd_break_insert_1): Adjust to pass a symbol_name_match_type to new_linespec_location. * python/py-breakpoint.c (bppy_init): Likewise. * python/python.c (gdbpy_decode_line): Likewise. gdb/testsuite/ChangeLog: 2017-11-29 Pedro Alves <palves@redhat.com> * gdb.base/langs.exp: Use -qualified. * gdb.cp/meth-typedefs.exp: Use -qualified, and add tests without it. * gdb.cp/namespace.exp: Use -qualified. * gdb.linespec/cpcompletion.exp (overload-2, fqn, fqn-2) (overload-3, template-overload, template-ret-type, const-overload) (const-overload-quoted, anon-ns, ambiguous-prefix): New procedures. (test_driver): Call them. * gdb.cp/save-bp-qualified.cc: New. * gdb.cp/save-bp-qualified.exp: New. * gdb.linespec/explicit.exp: Test -qualified. * lib/completion-support.exp (completion::explicit_opts_list): Add "-qualified". * lib/gdb.exp (gdb_breakpoint): Handle "qualified". gdb/doc/ChangeLog: 2017-11-29 Pedro Alves <palves@redhat.com> * gdb.texinfo (Linespec Locations): Document how "function" is interpreted in C++ and Ada. Document "-qualified". (Explicit Locations): Document how "-function" is interpreted in C++ and Ada. Document "-qualified".
2017-11-29[gdb/testsuite] Fix return type of psymtab-parameterThomas Preud'homme
As pointed out by Pedro Alves, psymtab-parameter testcase rely on the return type being long. This patch revert the changes made in f106e10e5e80265e1c43532bba4cb997a7dfa022 and change psymtab-parameter.cc to return 0 long instead. 2017-11-29 Thomas Preud'homme <thomas.preudhomme@arm.com> gdb/testsuite/ * gdb.cp/psymtab-parameter.cc (func): Change return type back to long. Return 0 as a long. * gdb.cp/psymtab-parameter.exp: Change func's return type back to long.
2017-11-29[gdb/testsuite] Fix wrong return type in testsThomas Preud'homme
The following tests are marked untested with latest GCC due to a warning being emitted for a mismatch between their return type and what the lack of return statement: * gdb.cp/breakpoint.exp * gdb.cp/psymtab-parameter.exp * gdb.cp/shadow.exp This patch fix the return type to match the function definitions. 2017-11-29 Thomas Preud'homme <thomas.preudhomme@arm.com> gdb/testsuite/ * gdb.cp/breakpoint.cc (bar): Set return type to void. * gdb.cp/psymtab-parameter.cc (func): Likewise. * gdb.cp/psymtab-parameter.exp: Update comment regarding prototype of func (). * gdb.cp/shadow.cc (B.func): Return 0.
2017-11-09Fix racy output matching in gdb.base/cpcompletion.expPedro Alves
With: $ make check-read1 TESTS="gdb.cp/cpcompletion.exp" we get (from gdb.log): (gdb) complete break Foo:: break Foo::Foo() break Foo::Foofoo() break Foo::get_foo() break Foo::set_foo(int) break Foo::~Foo() (gdb) FAIL: gdb.cp/cpcompletion.exp: complete class methods (Foo not found) The problem is that the "break ${class}::\[A-Za-z0-9_~\]+" regexp patches partial input, like: break Foo::F break Foo::Fo break Foo::Foo etc. Fix that by expecting each whole line. gdb/testsuite/ChangeLog: 2017-11-09 Pedro Alves <palves@redhat.com> * gdb.cp/cpcompletion.exp (test_class_complete): Tighten regex to match till end of line.
2017-11-07Add some more breakpoint/location range testsPedro Alves
Some extra thoroughness tests that I had over here. gdb/testsuite/ChangeLog: 2017-11-07 Pedro Alves <palves@redhat.com> * gdb.cp/ena-dis-br-range.exp: Add more tests.
2017-11-07Make breakpoint/location number parsing error output consistentPedro Alves
... and also make GDB catch a few more cases of invalid input. This fixes the inconsistency in GDB's output (e.g., "bad" vs "Bad") exposed by the new tests added in the previous commit. Also, makes the "0-0" and "inverted range" cases be loud errors. Also makes GDB reject negative breakpoint number in ranges. We already rejected negative number literals, but you could still subvert that via convenience variables, like: (gdb) set $bp -1 (gdb) disable $bp.1-2 The change to get_number_trailer fixes a bug exposed by the new tests. The function did not handle parsing "-$num". [This wasn't visible in the gdb.multi/tids.exp (which has similar tests) because the TID range parsing is implemented differently.] gdb/ChangeLog: 2017-11-07 Pedro Alves <palves@redhat.com> * breakpoint.c (extract_bp_kind): New enum. (extract_bp_num, extract_bp_or_bp_range): New functions, partially factored out from ... (extract_bp_number_and_location): ... here. * cli/cli-utils.c (get_number_trailer): Handle '-$variable'. gdb/testsuite/ChangeLog: 2017-11-07 Pedro Alves <palves@redhat.com> * gdb.base/ena-dis-br.exp (test_ena_dis_br): Adjust test. * gdb.cp/ena-dis-br-range.exp: Adjust tests. (disable_invalid, disable_inverted, disable_negative): New procedures. ("bad numbers"): New set of tests.
2017-11-07Add base 'enable/disable invalid location range' testsPedro Alves
This adds tests that exercise the "bad breakpoint number" paths. Specifically: - malformed ranges - use of explicit 0 as bp/loc number. - inverted ranges I'm adding this as a baseline to improve. This shows that there's a lot of inconsistency in GDB's output (e.g., "bad" vs "Bad"). Also, IMO, the "0-0" and inverted range cases should be loud errors. That and more will all be addressed in the next patch. gdb/testsuite/ChangeLog: 2017-11-07 Pedro Alves <palves@redhat.com> * gdb.cp/ena-dis-br-range.exp: Add tests.
2017-11-07Allow enabling/disabling breakpoint location rangesXavier Roirand
When a breakpoint has multiple locations, like e.g.: Num Type Disp Enb Address What 1 breakpoint keep y <MULTIPLE> 1.1 y 0x080486a2 in void foo<int>()... 1.2 y 0x080486ca in void foo<double>()... [....] 1.5 y 0x080487fa in void foo<long>()... it's possible to enable/disable the individual locations using the '<breakpoint_number>.<location_number>' syntax, like e.g.: (gdb) disable 1.2 1.3 1.4 1.5 That's inconvenient when you have a long list of locations to disable, however. This patch adds shorthand for the above, by making it possible to specify a range of locations with the following syntax (similar to thread id ranges): <breakpoint_number>.<first_location_number>-<last_location_number> For example, the command above can now be simplified to: (gdb) disable 1.2-5 gdb/ChangeLog: 2017-11-07 Xavier Roirand <roirand@adacore.com> Pedro Alves <palves@redhat.com> * breakpoint.c (map_breakpoint_number_range): New, factored out from ... (map_breakpoint_numbers): ... here. (find_location_by_number): Change parameters from string to breakpoint number and location. (extract_bp_number_and_location): New function. (enable_disable_bp_num_loc) (enable_disable_breakpoint_location_range) (enable_disable_command): New functions, factored out ... (enable_command, disable_command): ... these functions, and adjusted to support ranges. * NEWS: Document enable/disable breakpoint location range feature. gdb/doc/ChangeLog: 2017-11-07 Xavier Roirand <roirand@adacore.com> Pedro Alves <palves@redhat.com> * gdb.texinfo (Set Breaks): Document support for breakpoint location ranges in the enable/disable commands. gdb/testsuite/ChangeLog: 2017-11-07 Xavier Roirand <roirand@adacore.com> Pedro Alves <palves@redhat.com> * gdb.base/ena-dis-br.exp: Add reference to gdb.cp/ena-dis-br-range.exp. * gdb.cp/ena-dis-br-range.exp: New file. * gdb.cp/ena-dis-br-range.cc: New file.
2017-10-26Fix broken recursion detection when printing static membersPatrick Frants
Recursion detection for static members was broken. The implementation uses a growing (and shrinking) obstack object to simulate a stack of addresses (CORE_ADDR). Pushing addresses is implemented by calling obstack_grow(), while popping is implemented by calling obstack_free(). The latter is problematic because obstack_free() expects a pointer to the base of an object. When popping elements of the stack however, obstack_free() was called with the new top, which potentially is not the same as the base of the stack. This is unintended use and the effect is that obstack->next_free and obstack->object_base members are assigned the value of the new top, which equals an empty stack. Summary: popping elements would always result in an empty stack, which breaks the recursion detection. The fix shrinks the stack using obstack_blank_fast() with a negative value as described at the bottom of this page: https://gcc.gnu.org/onlinedocs/libiberty/Extra-Fast-Growing.html "You can use obstack_blank_fast with a “negative” size argument to make the current object smaller. Just don’t try to shrink it beyond zero length—there’s no telling what will happen if you do that. Earlier versions of obstacks allowed you to use obstack_blank to shrink objects. This will no longer work." The reproducer is added to gdb.cp/classes.exp, which fails without this patch. gdb/ChangeLog: * cp-valprint.c (cp_print_value_fields): Use obstack_blank_fast to rewind obstack. gdb/testsuite/ChangeLog: * gdb.cp/classes.exp (test_static_members): Test printing Outer::instance. * gdb.cp/classes.c (struct Inner, struct Outer): New. (Inner::instance, Outer::instance): New.
2017-10-18Canonicalize conversion operatorsKeith Seitz
Consider a conversion operator such as: operator foo const* const* (); There are two small parser problems, highlighted by this test: (gdb) p operator foo const* const* There is no field named operatorfoo const* const * GDB is looking up the symbol "operatorfoo const* const*" -- it is missing a space between the keyword "operator" and the type name "foo const* const*". Additionally, this input of the user-defined type needs to be canonicalized so that different "spellings" of the type are recognized: (gdb) p operator const foo* const * There is no field named operator const foo* const * gdb/ChangeLog: * c-exp.y (oper): Canonicalize conversion operators of user-defined types. Add whitespace to front of type name. gdb/testsuite/ChangeLog: * gdb.cp/cpexprs.cc (base) <operator fluff const* const*>: New method. (main): Call it. * gdb.cp/cpexprs.exp: Add new conversion operator to test matrix. Add additional user-defined conversion operator tests.
2017-10-16Record and output access specifiers for nested typedefsKeith Seitz
We currently do not record access information for typedefs defined inside classes. Consider: struct foo { typedef int PUBLIC; private: typedef int PRIVATE; PRIVATE b; }; (gdb) ptype foo type = struct foo { private: PRIVATE b; typedef int PRIVATE; typedef int PUBLIC; } This patch fixes this: (gdb) ptype foo type = struct foo { private: PRIVATE b; typedef int PRIVATE; public: typedef int PUBLIC; } gdb/ChangeLog: * c-typeprint.c (enum access_specifier): Moved here from c_type_print_base. (output_access_specifier): New function. (c_type_print_base): Consider typedefs when assessing whether access labels are needed. Use output_access_specifier as needed. Output access specifier for typedefs, if needed. * dwarf2read.c (dwarf2_add_typedef): Record DW_AT_accessibility. * gdbtypes.h (struct typedef_field) <is_protected, is_private>: New fields. (TYPE_TYPEDEF_FIELD_PROTECTED, TYPE_TYPEDEF_FIELD_PRIVATE): New accessor macros. gdb/testsuite/ChangeLog: * gdb.cp/classes.cc (class_with_typedefs, class_with_public_typedef) (class_with_protected_typedef, class_with_private_typedef) (struct_with_public_typedef, struct_with_protected_typedef) (struct_with_private_typedef): New classes/structs. * gdb.cp/classes.exp (test_ptype_class_objects): Add tests for typedefs and access specifiers.
2017-10-13Skip a few tests on targets that can't use the "run" commmand.Pedro Alves
These tests want to use raw "run", so skip them on targets that can't do that. Also adds a small utility procedure that clearly conveys intent instead of explicitly checking use_gdb_stub in the testcases. This makes sure these testcases continue to be skipped with --target_board=native-gdbserver once that board stops setting is_remote. gdb/testsuite/ChangeLog: 2017-10-13 Pedro Alves <palves@redhat.com> * lib/gdb.exp (target_can_use_run_cmd): New procedure. * gdb.base/annota1.exp: Use it instead of is_remote. * gdb.base/annota3.exp: Use it instead of is_remote. * gdb.cp/annota2.exp: Use it instead of is_remote. * gdb.cp/annota3.exp: Use it instead of is_remote. * gdb.multi/bkpt-multi-exec.exp: Use it instead of is_remote.
2017-09-20Make "list ambiguous" show symbol names tooPedro Alves
Currently, with an ambiguous "list first,last", we get: (gdb) list bar,main Specified first line 'bar' is ambiguous: file: "src/gdb/testsuite/gdb.cp/overload.cc", line number: 97 file: "src/gdb/testsuite/gdb.cp/overload.cc", line number: 98 This commit makes gdb's output above a bit clearer by printing the symbol name as well: (gdb) list bar,main Specified first line 'bar' is ambiguous: file: "src/gdb/testsuite/gdb.cp/overload.cc", line number: 97, symbol: "bar(A)" file: "src/gdb/testsuite/gdb.cp/overload.cc", line number: 98, symbol: "bar(B)" And while at it, makes gdb print the symbol name when actually listing multiple locations too. I.e., before (with "set listsize 2"): (gdb) list bar file: "src/gdb/testsuite/gdb.cp/overload.cc", line number: 97 96 97 int bar (A) { return 11; } file: "src/gdb/testsuite/gdb.cp/overload.cc", line number: 98 97 int bar (A) { return 11; } 98 int bar (B) { return 22; } After: (gdb) list bar file: "src/gdb/testsuite/gdb.cp/overload.cc", line number: 97, symbol: "bar(A)" 96 97 int bar (A) { return 11; } file: "src/gdb/testsuite/gdb.cp/overload.cc", line number: 98, symbol: "bar(B)" 97 int bar (A) { return 11; } 98 int bar (B) { return 22; } Currently, the result of decoding a linespec loses information about the original symbol that was found. All we end up with is an address. This makes it difficult to find the original symbol again to get at its print name. Fix that by storing a pointer to the symbol in the sal. We already store the symtab and obj_section, so it feels like a natural progression to me. This avoids having to do any extra symbol lookup too. gdb/ChangeLog: 2017-09-20 Pedro Alves <palves@redhat.com> * cli/cli-cmds.c (list_command): Use print_sal_location. (print_sal_location): New function. (ambiguous_line_spec): Use print_sal_location. * linespec.c (symbol_to_sal): Record the symbol in the sal. * symtab.c (find_function_start_sal): Likewise. * symtab.h (symtab_and_line::symbol): New field. gdb/testsuite/ChangeLog: 2017-09-20 Pedro Alves <palves@redhat.com> * gdb.base/list-ambiguous.exp (test_list_ambiguous_symbol): Expect symbol names in gdb's output. * gdb.cp/overload.exp ("list all overloads"): Likewise.
2017-09-04Make "p S::method() const::static_var" work tooPedro Alves
Trying to print a function local static variable of a const-qualified method still doesn't work after the previous fixes: (gdb) p 'S::method() const'::static_var $1 = {i1 = 1, i2 = 2, i3 = 3} (gdb) p S::method() const::static_var No symbol "static_var" in specified context. The reason is that the expression parser/evaluator loses the "const", and the above unquoted case is just like trying to print a variable of the non-const overload, if it exists, even. As if the above unquoted case had been written as: (gdb) p S::method()::static_var No symbol "static_var" in specified context. We can see the problem without static vars in the picture. With: struct S { void method (); void method () const; }; Compare: (gdb) print 'S::method(void) const' $1 = {void (const S * const)} 0x400606 <S::method() const> (gdb) print S::method(void) const $2 = {void (S * const)} 0x4005d8 <S::method()> # wrong method! That's what we need to fix. If we fix that, the function local static case starts working. The grammar production for function/method types is this one: exp: exp '(' parameter_typelist ')' const_or_volatile This results in a TYPE_INSTANCE expression evaluator operator. For the example above, we get something like this ("set debug expression 1"): ... 0 TYPE_INSTANCE 1 TypeInstance: Type @0x560fda958be0 (void) 5 OP_SCOPE Type @0x560fdaa544d8 (S) Field name: `method' ... While evaluating TYPE_INSTANCE, we end up in value_struct_elt_for_reference, trying to find the method named "method" that has the prototype recorded in TYPE_INSTANCE. In this case, TYPE_INSTANCE says that we're looking for a method that has "(void)" as parameters (that's what "1 TypeInstance: Type @0x560fda958be0 (void)" above means. The trouble is that nowhere in this mechanism do we communicate to value_struct_elt_for_reference that we're looking for the _const_ overload. value_struct_elt_for_reference only compared parameters, and the non-const "method()" overload has matching parameters, so it's considered the right match... Conveniently, the "const_or_volatile" production in the grammar already records "const" and "volatile" info in the type stack. The type stack is not used in this code path, but we can borrow the information. The patch converts the info in the type stack to an "instance flags" enum, and adds that as another element in TYPE_INSTANCE operators. This type instance flags is then applied to the temporary type that is passed to value_struct_elt_for_reference for matching. The other side of the problem is that methods in the debug info aren't marked const/volatile, so with that in place, the matching never finds const/volatile-qualified methods. The problem is that in the DWARF, there's no indication at all whether a method is const/volatile qualified... For example (c++filt applied to the linkage name for convenience): <2><d3>: Abbrev Number: 6 (DW_TAG_subprogram) <d4> DW_AT_external : 1 <d4> DW_AT_name : (indirect string, offset: 0x3df): method <d8> DW_AT_decl_file : 1 <d9> DW_AT_decl_line : 58 <da> DW_AT_linkage_name: (indirect string, offset: 0x5b2): S::method() const <de> DW_AT_declaration : 1 <de> DW_AT_object_pointer: <0xe6> <e2> DW_AT_sibling : <0xec> I see the same with both GCC and Clang. The patch works around this by extracting the cv qualification from the "const" and "volatile" in the demangled name. This will need further tweaking for "&" and "const &" overloads, but we don't support them in the parser yet, anyway. The TYPE_CONST changes were necessary otherwise the comparisons in valops.c: if (TYPE_CONST (intype) != TYPE_FN_FIELD_CONST (f, j)) continue; would fail, because when both TYPE_CONST() TYPE_FN_FIELD_CONST() were true, their values were different. BTW, I'm recording the const/volatile-ness of methods in the TYPE_FN_FIELD info because #1 - I'm not sure it's kosher to change the method's type directly (vs having to call make_cv_type to create a new type), and #2 it's what stabsread.c does: ... case 'A': /* Normal functions. */ new_sublist->fn_field.is_const = 0; new_sublist->fn_field.is_volatile = 0; (*pp)++; break; case 'B': /* `const' member functions. */ new_sublist->fn_field.is_const = 1; new_sublist->fn_field.is_volatile = 0; ... After all this, this finally all works: print S::method(void) const $1 = {void (const S * const)} 0x400606 <S::method() const> (gdb) p S::method() const::static_var $2 = {i1 = 1, i2 = 2, i3 = 3} gdb/ChangeLog: 2017-09-04 Pedro Alves <palves@redhat.com> * c-exp.y (function_method, function_method_void): Add current instance flags to TYPE_INSTANCE. * dwarf2read.c (check_modifier): New. (compute_delayed_physnames): Assert that only C++ adds delayed physnames. Mark fn_fields as const/volatile depending on physname. * eval.c (make_params): New type_instance_flags parameter. Use it as the new type's instance flags. (evaluate_subexp_standard) <TYPE_INSTANCE>: Extract the instance flags element and pass it to make_params. * expprint.c (print_subexp_standard) <TYPE_INSTANCE>: Handle instance flags element. (dump_subexp_body_standard) <TYPE_INSTANCE>: Likewise. * gdbtypes.h: Include "enum-flags.h". (type_instance_flags): New enum-flags type. (TYPE_CONST, TYPE_VOLATILE, TYPE_RESTRICT, TYPE_ATOMIC) (TYPE_CODE_SPACE, TYPE_DATA_SPACE): Return boolean. * parse.c (operator_length_standard) <TYPE_INSTANCE>: Adjust. (follow_type_instance_flags): New function. (operator_check_standard) <TYPE_INSTANCE>: Adjust. * parser-defs.h (follow_type_instance_flags): Declare. * valops.c (value_struct_elt_for_reference): const/volatile must match too. gdb/testsuite/ChangeLog: 2017-09-04 Pedro Alves <palves@redhat.com> * gdb.base/func-static.c (S::method const, S::method volatile) (S::method volatile const): New methods. (c_s, v_s, cv_s): New instances. (main): Call method() on them. * gdb.base/func-static.exp (syntax_re, cannot_resolve_re): New variables. (cannot_resolve): New procedure. (cxx_scopes_list): Test cv methods. Add print-scope-quote and print-quote-unquoted columns. (do_test): Test printing each scope too.
2017-09-04Handle "p 'S::method()::static_var'" (quoted) in symbol lookupPedro Alves
While the previous commit made "p method()::static_var" (no single-quotes) Just Work, if users (or frontends) try wrapping the expression with quotes, they'll get: (gdb) p 'S::method()::static_var' 'S::method()::static_var' has unknown type; cast it to its declared type even if we _do_ have debug info for that variable. That's better than the bogus/confusing value what GDB would print before the stop-assuming-int patch: (gdb) p 'S::method()::static_var' $1 = 1 but I think it'd still be nice to make this case Just Work too. In this case, due to the quoting, the C/C++ parser (c-exp.y) interprets the whole expression/string as a single symbol name, and we end up calling lookup_symbol on that name. There's no debug symbol with that fully-qualified name, but since the compiler gives the static variable a mangled linkage name exactly like the above, it appears in the mininal symbols: $ nm -A local-static | c++filt | grep static_var local-static:0000000000601040 d S::method()::static_var ... and that's what GDB happens to find/print. This only happens in C++, note, since for C the compiler uses different linkage names: local-static-c:0000000000601040 d static_var.1848 So while (in C++, not C) function local static variables are given a mangled name that demangles to the same syntax that GDB documents/expects as the way to access function local statics, there's no global symbol in the debug info with that name at all. The debug info for a static local variable for a non-inline function looks like this: <1><2a1>: Abbrev Number: 19 (DW_TAG_subprogram) ... <2><2f7>: Abbrev Number: 20 (DW_TAG_variable) <2f8> DW_AT_name : (indirect string, offset: 0x4e9): static_var <2fc> DW_AT_decl_file : 1 <2fd> DW_AT_decl_line : 64 <2fe> DW_AT_type : <0x25> <302> DW_AT_location : 9 byte block: 3 40 10 60 0 0 0 0 0 (DW_OP_addr: 601040) and for an inline function, it looks like this (linkage name run through c++filt for convenience): <2><21b>: Abbrev Number: 16 (DW_TAG_variable) <21c> DW_AT_name : (indirect string, offset: 0x21a): static_var <220> DW_AT_decl_file : 1 <221> DW_AT_decl_line : 48 <222> DW_AT_linkage_name: (indirect string, offset: 0x200): S::inline_method()::static_var <226> DW_AT_type : <0x25> <22a> DW_AT_external : 1 <22a> DW_AT_location : 9 byte block: 3 a0 10 60 0 0 0 0 0 (DW_OP_addr: 6010a0) (The inline case makes the variable external so that the linker can merge the different inlined copies. It seems like GCC never outputs the linkage name for non-extern globals.) When we read the DWARF, we record the static_var variable as a regular variable of the containing function's block. This makes stopping in the function and printing the variable as usual. The variable just so happens to have a memory address as location. So one way to make "p 'S::method()::static_var'" work would be to record _two_ copies of the symbols for these variables. One in the function's scope/block, with "static_var" as name, as we currently do, and another in the static or global blocks (depending on whether the symbol is external), with a fully-qualified name. I wrote a prototype patch for that, and it works. For the non-inline case above, since the debug info doesn't point to the linkage same, that patch built the physname of the static local variable as the concat of the physname of the containing function, plus "::", plus the variable's name. We could make that approach work for C too, though it kind of feels awkward to record fake symbol names like that in C. The other approach I tried is to change the C++ symbol lookup routines instead. This is the approach this commit takes. We can already lookup up symbol in namespaces and classes, so this feels like a good fit, and was easy enough. The advantage is that this doesn't require recording extra symbols. The test in gdb.cp/m-static.exp that exposed the need for this is removed, since the same functionality is now covered by gdb.cp/local-static.exp. gdb/ChangeLog: 2017-09-04 Pedro Alves <palves@redhat.com> * cp-namespace.c (cp_search_static_and_baseclasses): Handle function/method scopes; lookup the nested name as a function local static variable. gdb/testsuite/ChangeLog: 2017-09-04 Pedro Alves <palves@redhat.com> * gdb.base/local-static.exp: Also test with class::method::variable wholly quoted. * gdb.cp/m-static.exp (class::method::variable): Remove test.
2017-09-04Handle "p S::method()::static_var" in the C++ parserPedro Alves
This commit makes "print S::method()::static_var" actually find the debug symbol for static_var. Currently, you get: (gdb) print S::method()::static_var A syntax error in expression, near `'. Quoting the whole string would seemingly work before the previous patch that made GDB stop assuming int for no-debug-info variables: (gdb) p 'S::method()::static_var' $1 = 1 ... except that's incorrect output, because: (gdb) ptype 'S::method()::static_var' type = <data variable, no debug info> The way to make it work correctly currently is by quoting the function/method part, like this: (gdb) print 'S::method()'::static_var $1 = {i1 = 1, i2 = 2, i3 = 3} (gdb) ptype 'S::method()'::static_var type = struct aggregate { int i1; int i2; int i3; } At least after the "stop assuming int" patch, this is what we now get: (gdb) p 'S::method()::static_var' 'S::method()::static_var' has unknown type; cast it to its declared type (gdb) p (struct aggregate) 'S::method()::static_var' $1 = {i1 = 1, i2 = 2, i3 = 3} However, IMO, users shouldn't really have to care about any of this. GDB should Just Work, without quoting, IMO. So here's a patch that implements support for that in the C++ parser. With this patch, you now get: (gdb) p S::method()::S_M_s_var_aggregate $1 = {i1 = 1, i2 = 2, i3 = 3} (gdb) ptype S::method()::S_M_s_var_aggregate type = struct aggregate { int i1; int i2; int i3; } gdb/ChangeLog: 2017-09-04 Pedro Alves <palves@redhat.com> (%type <voidval>): Add function_method. * c-exp.y (exp): New production for calls with no arguments. (function_method, function_method_void_or_typelist): New productions. (exp): New production for "method()::static_var". * eval.c (evaluate_subexp_standard): Handle OP_FUNC_STATIC_VAR. * expprint.c (print_subexp_standard, dump_subexp_body_standard): Handle OP_FUNC_STATIC_VAR. * parse.c (operator_length_standard): Handle OP_FUNC_STATIC_VAR. * std-operator.def (OP_FUNC_STATIC_VAR): New. gdb/testsuite/ChangeLog: 2017-09-04 Pedro Alves <palves@redhat.com> * gdb.base/local-static.c: New. * gdb.base/local-static.cc: New. * gdb.base/local-static.exp: New.
2017-09-04Stop assuming no-debug-info variables have type intPedro Alves
An earlier commit made GDB no longer assume no-debug-info functions return int. This commit gives the same treatment to variables. Currently, you can end misled by GDB over output like this: (gdb) p var $1 = -1 (gdb) p /x var $2 = 0xffffffff until you realize that GDB is assuming that the variable is an "int", because: (gdb) ptype var type = <data variable, no debug info> You may try to fix it by casting, but that doesn't really help: (gdb) p /x (unsigned long long) var $3 = 0xffffffffffffffff # incorrect ^^ That's incorrect output, because the variable was defined like this: uint64_t var = 0x7fffffffffffffff; ^^ What happened is that with the cast, GDB did an int -> 'unsigned long long' conversion instead of reinterpreting the variable as the cast-to type. To get at the variable properly you have to reinterpret the variable's address manually instead, with either: (gdb) p /x *(unsigned long long *) &var $4 = 0x7fffffffffffffff (gdb) p /x {unsigned long long} &var $5 = 0x7fffffffffffffff After this commit GDB does it for you. This is what you'll get instead: (gdb) p var 'var' has unknown type; cast it to its declared type (gdb) p /x (unsigned long long) var $1 = 0x7fffffffffffffff As in the functions patch, the "compile" machinery doesn't currently have the cast-to type handy, so it continues assuming no-debug variables have int type, though now at least it warns. The change to gdb.cp/m-static.exp deserves an explanation: - gdb_test "print 'gnu_obj_1::method()::sintvar'" "\\$\[0-9\]+ = 4" \ + gdb_test "print (int) 'gnu_obj_1::method()::sintvar'" "\\$\[0-9\]+ = 4" \ That's printing the "sintvar" function local static of the "gnu_obj_1::method()" method. The problem with that test is that that "'S::method()::static_var'" syntax doesn't really work in C++ as you'd expect. The way to make it work correctly currently is to quote the method part, not the whole expression, like: (gdb) print 'gnu_obj_1::method()'::sintvar If you wrap the whole expression in quotes, like in m-static.exp, what really happens is that the parser considers the whole string as a symbol name, but there's no debug symbol with that name. However, local statics have linkage and are given a mangled name that demangles to the same string as the full expression, so that's what GDB prints. After this commit, and without the cast, the print in m-static.exp would error out saying that the variable has unknown type: (gdb) p 'gnu_obj_1::method()::sintvar' 'gnu_obj_1::method()::sintvar' has unknown type; cast it to its declared type TBC, if currently (even before this series) you try to print any function local static variable of type other than int, you'll get bogus results. You can see that with m-static.cc as is, even. Printing the "svar" local, which is a boolean (1 byte) still prints as "int" (4 bytes): (gdb) p 'gnu_obj_1::method()::svar' $1 = 1 (gdb) ptype 'gnu_obj_1::method()::svar' type = <data variable, no debug info> This probably prints some random bogus value on big endian machines. If 'svar' was of some aggregate type (etc.) we'd still print it as int, so the problem would have been more obvious... After this commit, you'll get instead: (gdb) p 'gnu_obj_1::method()::svar' 'gnu_obj_1::method()::svar' has unknown type; cast it to its declared type ... so at least GDB is no longer misleading. Making GDB find the real local static debug symbol is the subject of the following patches. In the end, it'll all "Just Work". gdb/ChangeLog: 2017-09-04 Pedro Alves <palves@redhat.com> * ax-gdb.c: Include "typeprint.h". (gen_expr_for_cast): New function. (gen_expr) <OP_CAST, OP_CAST_TYPE>: Use it. <OP_VAR_VALUE, OP_MSYM_VAR_VALUE>: Error out if the variable's type is unknown. * dwarf2read.c (new_symbol_full): Fallback to int instead of nodebug_data_symbol. * eval.c: Include "typeprint.h". (evaluate_subexp_standard) <OP_VAR_VALUE, OP_VAR_MSYM_VALUE>: Error out if symbol has unknown type. <UNOP_CAST, UNOP_CAST_TYPE>: Common bits factored out to evaluate_subexp_for_cast. (evaluate_subexp_for_address, evaluate_subexp_for_sizeof): Handle OP_VAR_MSYM_VALUE. (evaluate_subexp_for_cast): New function. * gdbtypes.c (init_nodebug_var_type): New function. (objfile_type): Use it to initialize types of variables with no debug info. * typeprint.c (error_unknown_type): New. * typeprint.h (error_unknown_type): New declaration. * compile/compile-c-types.c (convert_type_basic): Handle TYPE_CODE_ERROR; warn and fallback to int for variables with unknown type. gdb/testsuite/ChangeLog: 2017-09-04 Pedro Alves <palves@redhat.com> * gdb.asm/asm-source.exp: Add casts to int. * gdb.base/nodebug.c (dataglobal8, dataglobal32_1, dataglobal32_2) (dataglobal64_1, dataglobal64_2): New globals. * gdb.base/nodebug.exp: Test different expressions involving the new globals, with print, whatis and ptype. Add casts to int. * gdb.base/solib-display.exp: Add casts to int. * gdb.compile/compile-ifunc.exp: Expect warning. Add cast to int. * gdb.cp/m-static.exp: Add cast to int. * gdb.dwarf2/dw2-skip-prologue.exp: Add cast to int. * gdb.threads/tls-nodebug.exp: Check that gdb errors out printing tls variable with no debug info without a cast. Test with a cast to int too. * gdb.trace/entry-values.exp: Add casts.
2017-08-22Add test for "List actual code around more than one location" changePedro Alves
This adds a test for the "list" command change done in 0d999a6ef0f9 ("List actual code around more than one location"). gdb/ChangeLog: 2017-08-22 Pedro Alves <palves@redhat.com> * gdb.cp/overload.exp (line_range_pattern): New procedure. (top level): Add "list all overloads" tests.
2017-05-03Make sure malloc is linked into gdb.cp/oranking.cc.Keith Seitz
On some platforms, e.g., arm-eabi-none, we need to make certain that malloc is linked into the program because the test suite uses function calls requiring malloc: (gdb) p foo101("abc") evaluation of this expression requires the program to have a function "malloc". gdb/testsuite/ChangeLog * gdb.cp/oranking.cc (dummy): New function to grab malloc. (main): Call it.
2017-04-27Fix overload resolution involving rvalue references and cv qualifiers.Keith Seitz
The following patch fixes several outstanding overload resolution problems with rvalue references and cv qualifiers in the test suite. The tests for these problems typically passed with one compiler version and failed with another. This behavior occurs because of the ordering of the overloaded functions in the debug info. So the first best match "won out" over the a subsequent better match. One of the bugs addressed by this patch is the failure of rank_one_type to account for type equality of two overloads based on CV qualifiers. This was leading directly to problems evaluating rvalue reference overload quality, but it is also highlighted in gdb.cp/oranking.exp, where two test KFAIL as a result of this shortcoming. I found the overload resolution code committed with the rvalue reference patch (f9aeb8d49) needlessly over-complicated, and I have greatly simplified it. This fixes some KFAILing tests in gdb.exp/rvalue-ref-overload.exp. gdb/ChangeLog * gdbtypes.c (LVALUE_REFERENCE_TO_RVALUE_BINDING_BADNESS) DIFFERENT_REFERENCE_TYPE_BADNESS): Remove. (CV_CONVERSION_BADNESS): Define. (rank_one_type): Remove overly restrictive rvalue reference rank checks. Add cv-qualifier checks and subranks for type equality. * gdbtypes.h (REFERENCE_CONVERSION_RVALUE, REFERENCE_CONVERSION_CONST_LVALUE, CV_CONVERSION_BADNESS, CV_CONVERSION_CONST, CV_CONVERSION_VOLATILE): Declare. gdb/testsuite/ChangeLog * gdb.cp/oranking.cc (test15): New function. (main): Call test15 and declare additional variables for testing. * gdb.cp/oranking.exp: Remove kfail status for "p foo4(&a)" and "p foo101('abc')" tests. * gdb.cp/rvalue-ref-overloads.exp: Remove kfail status for "lvalue reference overload" test. * gdb.cp/rvalue-ref-params.exp: Remove kfail status for "print value of f1 on Child&& in f2" test.
2017-04-12Teach GDB that wchar_t is a built-in type in C++ modePedro Alves
GDB is currently not aware that wchar_t is a built-in type in C++ mode. This is usually not a problem because the debug info describes the type, so when you have a program loaded, you don't notice this. However, if you try expressions involving wchar_t before a program is loaded, gdb errors out: (gdb) p (wchar_t)-1 No symbol table is loaded. Use the "file" command. (gdb) p L"hello" No type named wchar_t. (gdb) ptype L"hello" No type named wchar_t. This commit teaches gdb about the type. After: (gdb) p (wchar_t)-1 $1 = -1 L'\xffffffff' (gdb) p L"hello" $2 = L"hello" (gdb) ptype L"hello" type = wchar_t [6] Unlike char16_t/char32_t, unfortunately, the underlying type of wchar_t is implementation dependent, both size and signness. So this requires adding a couple new gdbarch hooks. I grepped the GCC code base for WCHAR_TYPE and WCHAR_TYPE_SIZE, and it seems to me that the majority of the ABIs have a 4-byte signed wchar_t, so that's what I made the default for GDB too. And then I looked for which ports have a 16-bit and/or unsigned wchar_t, and made GDB follow suit. gdb/ChangeLog: 2017-04-12 Pedro Alves <palves@redhat.com> PR gdb/21323 * c-lang.c (cplus_primitive_types) <cplus_primitive_type_wchar_t>: New enum value. (cplus_language_arch_info): Register cplus_primitive_type_wchar_t. * gdbtypes.h (struct builtin_type) <builtin_wchar>: New field. * gdbtypes.c (gdbtypes_post_init): Create the "wchar_t" type. * gdbarch.sh (wchar_bit, wchar_signed): New per-arch values. * gdbarch.h, gdbarch.c: Regenerate. * aarch64-tdep.c (aarch64_gdbarch_init): Override gdbarch_wchar_bit and gdbarch_wchar_signed. * alpha-tdep.c (alpha_gdbarch_init): Likewise. * arm-tdep.c (arm_gdbarch_init): Likewise. * avr-tdep.c (avr_gdbarch_init): Likewise. * h8300-tdep.c (h8300_gdbarch_init): Likewise. * i386-nto-tdep.c (i386nto_init_abi): Likewise. * i386-tdep.c (i386_go32_init_abi): Likewise. * m32r-tdep.c (m32r_gdbarch_init): Likewise. * moxie-tdep.c (moxie_gdbarch_init): Likewise. * nds32-tdep.c (nds32_gdbarch_init): Likewise. * rs6000-aix-tdep.c (rs6000_aix_init_osabi): Likewise. * sh-tdep.c (sh_gdbarch_init): Likewise. * sparc-tdep.c (sparc32_gdbarch_init): Likewise. * sparc64-tdep.c (sparc64_init_abi): Likewise. * windows-tdep.c (windows_init_abi): Likewise. * xstormy16-tdep.c (xstormy16_gdbarch_init): Likewise. gdb/testsuite/ChangeLog: 2017-04-12 Pedro Alves <palves@redhat.com> PR gdb/21323 * gdb.cp/wide_char_types.c: Include <wchar.h>. (wchar): New global. * gdb.cp/wide_char_types.exp (wide_char_types_program) (do_test_wide_char, wide_char_types_no_program, top level): Add wchar_t testing.
2017-04-12Fix PR c++/21323: GDB thinks char16_t and char32_t are signed in C++Pedro Alves
While the C++ standard says that char16_t and char32_t are unsigned types: Types char16_t and char32_t denote distinct types with the same size, signedness, and alignment as uint_least16_t and uint_least32_t, respectively, in <cstdint>, called the underlying types. ... gdb treats them as signed currently: (gdb) p (char16_t)-1 $1 = -1 u'\xffff' There are actually two places in gdb that hardcode these types: - gdbtypes.c:gdbtypes_post_init, when creating the built-in types, seemingly used by the "x /s" command (judging from commit 9a22f0d0). - dwarf2read.c, when reading base types with DW_ATE_UTF encoding (which is what is used for these types, when compiling for C++11 and up). Despite the comment, the type created does end up used. Both places need fixing. But since I couldn't tell why dwarf2read.c needs to create a new type, I've made it use the per-arch built-in types instead, so that the types are only created once per arch instead of once per objfile. That seems to work fine. While writting the test, I noticed that the C++ language parser isn't actually aware of these built-in types, so if you try to use them without a program that uses them, you get: (gdb) set language c++ (gdb) ptype char16_t No symbol table is loaded. Use the "file" command. (gdb) ptype u"hello" No type named char16_t. (gdb) p u"hello" No type named char16_t. That's fixed by simply adding a couple entries to C++'s built-in types array in c-lang.c. With that, we get the expected: (gdb) ptype char16_t type = char16_t (gdb) ptype u"hello" type = char16_t [6] (gdb) p u"hello" $1 = u"hello" gdb/ChangeLog: 2017-04-12 Pedro Alves <palves@redhat.com> PR c++/21323 * c-lang.c (cplus_primitive_types) <cplus_primitive_type_char16_t, cplus_primitive_type_char32_t>: New enum values. (cplus_language_arch_info): Register cplus_primitive_type_char16_t and cplus_primitive_type_char32_t. * dwarf2read.c (read_base_type) <DW_ATE_UTF>: If bit size is 16 or 32, use the archtecture's built-in type for char16_t and char32_t, respectively. Otherwise, fallback to init_integer_type as before, but make the type unsigned, and issue a complaint. * gdbtypes.c (gdbtypes_post_init): Make char16_t and char32_t unsigned. gdb/testsuite/ChangeLog: 2017-04-12 Pedro Alves <palves@redhat.com> PR c++/21323 * gdb.cp/wide_char_types.c: New file. * gdb.cp/wide_char_types.exp: New file.
2017-03-20Add rvalue reference tests and docsArtemiy Volkov
This patch adds tests for the initial rvalue reference support patchset. All of the new tests are practically mirrored regular references tests and, except for the demangler ones, are introduced in new files, which are set to be compiled with -std=gnu++11. Tested are printing of rvalue reference types and values, rvalue reference parameters in function overloading, demangling of function names containing rvalue reference parameters, casts to rvalue reference types, application of the sizeof operator to rvalue reference types and values, and support for rvalue references within the gdb python module. gdb/ChnageLog PR gdb/14441 * NEWS: Mention support for rvalue references in GDB and python. * doc/gdb.texinfo (C Plus Plus Expressions): Mention that GDB supports both lvalue and rvalue references. gdb/testsuite/ChangeLog PR gdb/14441 * gdb.cp/demangle.exp: Add rvalue reference tests. * gdb.cp/rvalue-ref-casts.cc: New file. * gdb.cp/rvalue-ref-casts.exp: New file. * gdb.cp/rvalue-ref-overload.cc: New file. * gdb.cp/rvalue-ref-overload.exp: New file. * gdb.cp/rvalue-ref-params.cc: New file. * gdb.cp/rvalue-ref-params.exp: New file. * gdb.cp/rvalue-ref-sizeof.cc: New file. * gdb.cp/rvalue-ref-sizeof.exp: New file. * gdb.cp/rvalue-ref-types.cc: New file. * gdb.cp/rvalue-ref-types.exp: New file. * gdb.python/py-rvalue-ref-value-cc.cc: New file. * gdb.python/py-rvalue-ref-value-cc.exp: New file.
2017-03-16Fix expect for gdb.cp/m-static.expThomas Preud'homme
The expectation in gdb.cp/m-static.exp for the ptype of single_constructor is to get in the result of destructor with the following prototype: ~single_constructor(int). Yet, m-static.cc declares the destructor as ~single_constructor(). This commit fixes the expectation. 2017-03-16 Thomas Preud'homme <thomas.preudhomme@arm.com> gdb/testsuite/ * gdb.cp/m-static.exp: Fix expectation for prototype of test5.single_constructor and single_constructor::single_constructor.
2017-03-10c++/8218: Destructors w/arguments.Keith Seitz
For a long time now, c++/8218 has noted that GDB is printing argument types for destructors: (gdb) ptype A type = class A { public: ~A(int); } This happens because cp_type_print_method_args doesn't ignore artificial arguments. [It ignores the first `this' pointer because it simply skips the first argument for any non-static function.] This patch fixes this: (gdb) ptype A type = class A { public: ~A(); } I've adjusted gdb.cp/templates.exp to account for this and added a new passing regexp. gdb/ChangeLog PR c++/8218 * c-typeprint.c (cp_type_print_method_args): Skip artificial arguments. gdb/testsuite/ChangeLog PR c++/8128 * gdb.cp/templates.exp (test_ptype_of_templates): Remove argument type from destructor regexps. Add a branch which actually passes the test. Adjust "ptype t5i" test names.
2017-02-15Fix illegal upper case gdb cmd in chained-calls.expThomas Preud'homme
3d7b173c29900879c9a5958dd6029fd36666e57c made upper case commands now illegal. However gdb.cp/chained-calls.exp still contains one test using P to print an expression. This patch fixes the testcase to use p instead. 2017-02-13 Thomas Preud'homme <thomas.preudhomme@arm.com> gdb/ * gdb.cp/chained-calls.exp: Use p instead of P.
2017-01-01update copyright year range in GDB filesJoel Brobecker
This applies the second part of GDB's End of Year Procedure, which updates the copyright year range in all of GDB's files. gdb/ChangeLog: Update copyright year range in all GDB files.
2016-12-23Fix more cases of improper test namesLuis Machado
I noticed more occurrences of improper test names. The rather mechanical, tedious and large patch below addresses, hopefully, most of the leftover cases. As usual, another pair of eyes is welcome to check if missed something or did an invalid substitution. This patch also fixes the prepare_for_testing calls to pass proper test names. gdb/testsuite/ChangeLog: 2016-12-23 Luis Machado <lgustavo@codesourcery.com> Fix test names for the following files: * gdb.ada/exec_changed.exp * gdb.ada/info_types.exp * gdb.arch/aarch64-atomic-inst.exp * gdb.arch/aarch64-fp.exp * gdb.arch/altivec-abi.exp * gdb.arch/altivec-regs.exp * gdb.arch/amd64-byte.exp * gdb.arch/amd64-disp-step.exp * gdb.arch/amd64-dword.exp * gdb.arch/amd64-entry-value-inline.exp * gdb.arch/amd64-entry-value-param.exp * gdb.arch/amd64-entry-value-paramref.exp * gdb.arch/amd64-entry-value.exp * gdb.arch/amd64-i386-address.exp * gdb.arch/amd64-invalid-stack-middle.exp * gdb.arch/amd64-invalid-stack-top.exp * gdb.arch/amd64-optimout-repeat.exp * gdb.arch/amd64-prologue-skip.exp * gdb.arch/amd64-prologue-xmm.exp * gdb.arch/amd64-stap-special-operands.exp * gdb.arch/amd64-stap-wrong-subexp.exp * gdb.arch/amd64-tailcall-cxx.exp * gdb.arch/amd64-tailcall-noret.exp * gdb.arch/amd64-tailcall-ret.exp * gdb.arch/amd64-tailcall-self.exp * gdb.arch/amd64-word.exp * gdb.arch/arm-bl-branch-dest.exp * gdb.arch/arm-disp-step.exp * gdb.arch/arm-neon.exp * gdb.arch/arm-single-step-kernel-helper.exp * gdb.arch/avr-flash-qualifier.exp * gdb.arch/disp-step-insn-reloc.exp * gdb.arch/e500-abi.exp * gdb.arch/e500-regs.exp * gdb.arch/ftrace-insn-reloc.exp * gdb.arch/i386-avx512.exp * gdb.arch/i386-bp_permanent.exp * gdb.arch/i386-byte.exp * gdb.arch/i386-cfi-notcurrent.exp * gdb.arch/i386-disp-step.exp * gdb.arch/i386-dr3-watch.exp * gdb.arch/i386-float.exp * gdb.arch/i386-gnu-cfi.exp * gdb.arch/i386-mpx-map.exp * gdb.arch/i386-mpx-sigsegv.exp * gdb.arch/i386-mpx-simple_segv.exp * gdb.arch/i386-mpx.exp * gdb.arch/i386-permbkpt.exp * gdb.arch/i386-prologue.exp * gdb.arch/i386-signal.exp * gdb.arch/i386-size-overlap.exp * gdb.arch/i386-unwind.exp * gdb.arch/i386-word.exp * gdb.arch/mips-fcr.exp * gdb.arch/powerpc-d128-regs.exp * gdb.arch/powerpc-stackless.exp * gdb.arch/ppc64-atomic-inst.exp * gdb.arch/s390-stackless.exp * gdb.arch/s390-tdbregs.exp * gdb.arch/s390-vregs.exp * gdb.arch/sparc-sysstep.exp * gdb.arch/thumb-bx-pc.exp * gdb.arch/thumb-singlestep.exp * gdb.arch/thumb2-it.exp * gdb.arch/vsx-regs.exp * gdb.asm/asm-source.exp * gdb.base/a2-run.exp * gdb.base/advance.exp * gdb.base/all-bin.exp * gdb.base/anon.exp * gdb.base/args.exp * gdb.base/arithmet.exp * gdb.base/async-shell.exp * gdb.base/async.exp * gdb.base/attach-pie-noexec.exp * gdb.base/attach-twice.exp * gdb.base/auto-load.exp * gdb.base/bang.exp * gdb.base/bitfields.exp * gdb.base/break-always.exp * gdb.base/break-caller-line.exp * gdb.base/break-entry.exp * gdb.base/break-inline.exp * gdb.base/break-on-linker-gcd-function.exp * gdb.base/break-probes.exp * gdb.base/break.exp * gdb.base/breakpoint-shadow.exp * gdb.base/call-ar-st.exp * gdb.base/call-sc.exp * gdb.base/call-signal-resume.exp * gdb.base/call-strs.exp * gdb.base/callfuncs.exp * gdb.base/catch-fork-static.exp * gdb.base/catch-gdb-caused-signals.exp * gdb.base/catch-load.exp * gdb.base/catch-signal-fork.exp * gdb.base/catch-signal.exp * gdb.base/catch-syscall.exp * gdb.base/charset.exp * gdb.base/checkpoint.exp * gdb.base/chng-syms.exp * gdb.base/code-expr.exp * gdb.base/code_elim.exp * gdb.base/commands.exp * gdb.base/completion.exp * gdb.base/complex.exp * gdb.base/cond-expr.exp * gdb.base/condbreak.exp * gdb.base/consecutive.exp * gdb.base/continue-all-already-running.exp * gdb.base/coredump-filter.exp * gdb.base/corefile.exp * gdb.base/dbx.exp * gdb.base/debug-expr.exp * gdb.base/define.exp * gdb.base/del.exp * gdb.base/disabled-location.exp * gdb.base/disasm-end-cu.exp * gdb.base/disasm-optim.exp * gdb.base/display.exp * gdb.base/duplicate-bp.exp * gdb.base/ena-dis-br.exp * gdb.base/ending-run.exp * gdb.base/enumval.exp * gdb.base/environ.exp * gdb.base/eu-strip-infcall.exp * gdb.base/eval-avoid-side-effects.exp * gdb.base/eval-skip.exp * gdb.base/exitsignal.exp * gdb.base/expand-psymtabs.exp * gdb.base/filesym.exp * gdb.base/find-unmapped.exp * gdb.base/finish.exp * gdb.base/float.exp * gdb.base/foll-exec-mode.exp * gdb.base/foll-exec.exp * gdb.base/foll-fork.exp * gdb.base/fortran-sym-case.exp * gdb.base/freebpcmd.exp * gdb.base/func-ptr.exp * gdb.base/func-ptrs.exp * gdb.base/funcargs.exp * gdb.base/gcore-buffer-overflow.exp * gdb.base/gcore-relro-pie.exp * gdb.base/gcore-relro.exp * gdb.base/gcore.exp * gdb.base/gdb1090.exp * gdb.base/gdb11530.exp * gdb.base/gdb11531.exp * gdb.base/gdb1821.exp * gdb.base/gdbindex-stabs.exp * gdb.base/gdbvars.exp * gdb.base/hbreak.exp * gdb.base/hbreak2.exp * gdb.base/included.exp * gdb.base/infcall-input.exp * gdb.base/inferior-died.exp * gdb.base/infnan.exp * gdb.base/info-macros.exp * gdb.base/info-os.exp * gdb.base/info-proc.exp * gdb.base/info-shared.exp * gdb.base/info-target.exp * gdb.base/infoline.exp * gdb.base/interp.exp * gdb.base/interrupt.exp * gdb.base/jit-reader.exp * gdb.base/jit-simple.exp * gdb.base/kill-after-signal.exp * gdb.base/kill-detach-inferiors-cmd.exp * gdb.base/label.exp * gdb.base/langs.exp * gdb.base/ldbl_e308.exp * gdb.base/line-symtabs.exp * gdb.base/linespecs.exp * gdb.base/list.exp * gdb.base/long_long.exp * gdb.base/longest-types.exp * gdb.base/maint.exp * gdb.base/max-value-size.exp * gdb.base/memattr.exp * gdb.base/mips_pro.exp * gdb.base/morestack.exp * gdb.base/moribund-step.exp * gdb.base/multi-forks.exp * gdb.base/nested-addr.exp * gdb.base/nextoverexit.exp * gdb.base/noreturn-finish.exp * gdb.base/noreturn-return.exp * gdb.base/nostdlib.exp * gdb.base/offsets.exp * gdb.base/opaque.exp * gdb.base/pc-fp.exp * gdb.base/permissions.exp * gdb.base/print-symbol-loading.exp * gdb.base/prologue-include.exp * gdb.base/psymtab.exp * gdb.base/ptype.exp * gdb.base/random-signal.exp * gdb.base/randomize.exp * gdb.base/range-stepping.exp * gdb.base/readline-ask.exp * gdb.base/recpar.exp * gdb.base/recurse.exp * gdb.base/relational.exp * gdb.base/restore.exp * gdb.base/return-nodebug.exp * gdb.base/return.exp * gdb.base/run-after-attach.exp * gdb.base/save-bp.exp * gdb.base/scope.exp * gdb.base/sect-cmd.exp * gdb.base/set-lang-auto.exp * gdb.base/set-noassign.exp * gdb.base/setvar.exp * gdb.base/sigall.exp * gdb.base/sigbpt.exp * gdb.base/siginfo-addr.exp * gdb.base/siginfo-infcall.exp * gdb.base/siginfo-obj.exp * gdb.base/siginfo.exp * gdb.base/signals-state-child.exp * gdb.base/signest.exp * gdb.base/sigstep.exp * gdb.base/sizeof.exp * gdb.base/skip.exp * gdb.base/solib-corrupted.exp * gdb.base/solib-nodir.exp * gdb.base/solib-search.exp * gdb.base/stack-checking.exp * gdb.base/stale-infcall.exp * gdb.base/stap-probe.exp * gdb.base/start.exp * gdb.base/step-break.exp * gdb.base/step-bt.exp * gdb.base/step-line.exp * gdb.base/step-over-exit.exp * gdb.base/step-over-syscall.exp * gdb.base/step-resume-infcall.exp * gdb.base/step-test.exp * gdb.base/store.exp * gdb.base/structs3.exp * gdb.base/sym-file.exp * gdb.base/symbol-without-target_section.exp * gdb.base/term.exp * gdb.base/testenv.exp * gdb.base/ui-redirect.exp * gdb.base/until.exp * gdb.base/unwindonsignal.exp * gdb.base/value-double-free.exp * gdb.base/vla-datatypes.exp * gdb.base/vla-ptr.exp * gdb.base/vla-sideeffect.exp * gdb.base/volatile.exp * gdb.base/watch-cond-infcall.exp * gdb.base/watch-cond.exp * gdb.base/watch-non-mem.exp * gdb.base/watch-read.exp * gdb.base/watch-vfork.exp * gdb.base/watchpoint-cond-gone.exp * gdb.base/watchpoint-delete.exp * gdb.base/watchpoint-hw-hit-once.exp * gdb.base/watchpoint-hw.exp * gdb.base/watchpoint-stops-at-right-insn.exp * gdb.base/watchpoints.exp * gdb.base/wchar.exp * gdb.base/whatis-exp.exp * gdb.btrace/buffer-size.exp * gdb.btrace/data.exp * gdb.btrace/delta.exp * gdb.btrace/dlopen.exp * gdb.btrace/enable.exp * gdb.btrace/exception.exp * gdb.btrace/function_call_history.exp * gdb.btrace/gcore.exp * gdb.btrace/instruction_history.exp * gdb.btrace/nohist.exp * gdb.btrace/reconnect.exp * gdb.btrace/record_goto-step.exp * gdb.btrace/record_goto.exp * gdb.btrace/rn-dl-bind.exp * gdb.btrace/segv.exp * gdb.btrace/step.exp * gdb.btrace/stepi.exp * gdb.btrace/tailcall-only.exp * gdb.btrace/tailcall.exp * gdb.btrace/tsx.exp * gdb.btrace/unknown_functions.exp * gdb.btrace/vdso.exp * gdb.compile/compile-ifunc.exp * gdb.compile/compile-ops.exp * gdb.compile/compile-print.exp * gdb.compile/compile-setjmp.exp * gdb.cp/abstract-origin.exp * gdb.cp/ambiguous.exp * gdb.cp/annota2.exp * gdb.cp/annota3.exp * gdb.cp/anon-ns.exp * gdb.cp/anon-struct.exp * gdb.cp/anon-union.exp * gdb.cp/arg-reference.exp * gdb.cp/baseenum.exp * gdb.cp/bool.exp * gdb.cp/breakpoint.exp * gdb.cp/bs15503.exp * gdb.cp/call-c.exp * gdb.cp/casts.exp * gdb.cp/chained-calls.exp * gdb.cp/class2.exp * gdb.cp/classes.exp * gdb.cp/cmpd-minsyms.exp * gdb.cp/converts.exp * gdb.cp/cp-relocate.exp * gdb.cp/cpcompletion.exp * gdb.cp/cpexprs.exp * gdb.cp/cplabel.exp * gdb.cp/cplusfuncs.exp * gdb.cp/cpsizeof.exp * gdb.cp/ctti.exp * gdb.cp/derivation.exp * gdb.cp/destrprint.exp * gdb.cp/dispcxx.exp * gdb.cp/enum-class.exp * gdb.cp/exception.exp * gdb.cp/exceptprint.exp * gdb.cp/expand-psymtabs-cxx.exp * gdb.cp/expand-sals.exp * gdb.cp/extern-c.exp * gdb.cp/filename.exp * gdb.cp/formatted-ref.exp * gdb.cp/fpointer.exp * gdb.cp/gdb1355.exp * gdb.cp/gdb2495.exp * gdb.cp/hang.exp * gdb.cp/impl-this.exp * gdb.cp/infcall-dlopen.exp * gdb.cp/inherit.exp * gdb.cp/iostream.exp * gdb.cp/koenig.exp * gdb.cp/local.exp * gdb.cp/m-data.exp * gdb.cp/m-static.exp * gdb.cp/mb-ctor.exp * gdb.cp/mb-inline.exp * gdb.cp/mb-templates.exp * gdb.cp/member-name.exp * gdb.cp/member-ptr.exp * gdb.cp/meth-typedefs.exp * gdb.cp/method.exp * gdb.cp/method2.exp * gdb.cp/minsym-fallback.exp * gdb.cp/misc.exp * gdb.cp/namelessclass.exp * gdb.cp/namespace-enum.exp * gdb.cp/namespace-nested-import.exp * gdb.cp/namespace.exp * gdb.cp/nextoverthrow.exp * gdb.cp/no-dmgl-verbose.exp * gdb.cp/non-trivial-retval.exp * gdb.cp/noparam.exp * gdb.cp/nsdecl.exp * gdb.cp/nsimport.exp * gdb.cp/nsnested.exp * gdb.cp/nsnoimports.exp * gdb.cp/nsrecurs.exp * gdb.cp/nsstress.exp * gdb.cp/nsusing.exp * gdb.cp/operator.exp * gdb.cp/oranking.exp * gdb.cp/overload-const.exp * gdb.cp/overload.exp * gdb.cp/ovldbreak.exp * gdb.cp/ovsrch.exp * gdb.cp/paren-type.exp * gdb.cp/parse-lang.exp * gdb.cp/pass-by-ref.exp * gdb.cp/pr-1023.exp * gdb.cp/pr-1210.exp * gdb.cp/pr-574.exp * gdb.cp/pr10687.exp * gdb.cp/pr12028.exp * gdb.cp/pr17132.exp * gdb.cp/pr17494.exp * gdb.cp/pr9067.exp * gdb.cp/pr9167.exp * gdb.cp/pr9631.exp * gdb.cp/printmethod.exp * gdb.cp/psmang.exp * gdb.cp/psymtab-parameter.exp * gdb.cp/ptype-cv-cp.exp * gdb.cp/ptype-flags.exp * gdb.cp/re-set-overloaded.exp * gdb.cp/ref-types.exp * gdb.cp/rtti.exp * gdb.cp/scope-err.exp * gdb.cp/shadow.exp * gdb.cp/smartp.exp * gdb.cp/static-method.exp * gdb.cp/static-print-quit.exp * gdb.cp/temargs.exp * gdb.cp/templates.exp * gdb.cp/try_catch.exp * gdb.cp/typedef-operator.exp * gdb.cp/typeid.exp * gdb.cp/userdef.exp * gdb.cp/using-crash.exp * gdb.cp/var-tag.exp * gdb.cp/virtbase.exp * gdb.cp/virtfunc.exp * gdb.cp/virtfunc2.exp * gdb.cp/vla-cxx.exp * gdb.disasm/t01_mov.exp * gdb.disasm/t02_mova.exp * gdb.disasm/t03_add.exp * gdb.disasm/t04_sub.exp * gdb.disasm/t05_cmp.exp * gdb.disasm/t06_ari2.exp * gdb.disasm/t07_ari3.exp * gdb.disasm/t08_or.exp * gdb.disasm/t09_xor.exp * gdb.disasm/t10_and.exp * gdb.disasm/t11_logs.exp * gdb.disasm/t12_bit.exp * gdb.disasm/t13_otr.exp * gdb.dlang/circular.exp * gdb.dwarf2/arr-stride.exp * gdb.dwarf2/arr-subrange.exp * gdb.dwarf2/atomic-type.exp * gdb.dwarf2/bad-regnum.exp * gdb.dwarf2/bitfield-parent-optimized-out.exp * gdb.dwarf2/callframecfa.exp * gdb.dwarf2/clztest.exp * gdb.dwarf2/corrupt.exp * gdb.dwarf2/data-loc.exp * gdb.dwarf2/dup-psym.exp * gdb.dwarf2/dw2-anon-mptr.exp * gdb.dwarf2/dw2-anonymous-func.exp * gdb.dwarf2/dw2-bad-mips-linkage-name.exp * gdb.dwarf2/dw2-bad-unresolved.exp * gdb.dwarf2/dw2-basic.exp * gdb.dwarf2/dw2-canonicalize-type.exp * gdb.dwarf2/dw2-case-insensitive.exp * gdb.dwarf2/dw2-common-block.exp * gdb.dwarf2/dw2-compdir-oldgcc.exp * gdb.dwarf2/dw2-compressed.exp * gdb.dwarf2/dw2-const.exp * gdb.dwarf2/dw2-cp-infcall-ref-static.exp * gdb.dwarf2/dw2-cu-size.exp * gdb.dwarf2/dw2-dup-frame.exp * gdb.dwarf2/dw2-entry-value.exp * gdb.dwarf2/dw2-icycle.exp * gdb.dwarf2/dw2-ifort-parameter.exp * gdb.dwarf2/dw2-inline-break.exp * gdb.dwarf2/dw2-inline-param.exp * gdb.dwarf2/dw2-intercu.exp * gdb.dwarf2/dw2-intermix.exp * gdb.dwarf2/dw2-lexical-block-bare.exp * gdb.dwarf2/dw2-linkage-name-trust.exp * gdb.dwarf2/dw2-minsym-in-cu.exp * gdb.dwarf2/dw2-noloc.exp * gdb.dwarf2/dw2-op-call.exp * gdb.dwarf2/dw2-op-out-param.exp * gdb.dwarf2/dw2-opt-structptr.exp * gdb.dwarf2/dw2-param-error.exp * gdb.dwarf2/dw2-producer.exp * gdb.dwarf2/dw2-ranges-base.exp * gdb.dwarf2/dw2-ref-missing-frame.exp * gdb.dwarf2/dw2-reg-undefined.exp * gdb.dwarf2/dw2-regno-invalid.exp * gdb.dwarf2/dw2-restore.exp * gdb.dwarf2/dw2-restrict.exp * gdb.dwarf2/dw2-single-line-discriminators.exp * gdb.dwarf2/dw2-strp.exp * gdb.dwarf2/dw2-undefined-ret-addr.exp * gdb.dwarf2/dw2-unresolved.exp * gdb.dwarf2/dw2-var-zero-addr.exp * gdb.dwarf2/dw4-sig-types.exp * gdb.dwarf2/dwz.exp * gdb.dwarf2/dynarr-ptr.exp * gdb.dwarf2/enum-type.exp * gdb.dwarf2/gdb-index.exp * gdb.dwarf2/implptr-64bit.exp * gdb.dwarf2/implptr-optimized-out.exp * gdb.dwarf2/implptr.exp * gdb.dwarf2/implref-array.exp * gdb.dwarf2/implref-const.exp * gdb.dwarf2/implref-global.exp * gdb.dwarf2/implref-struct.exp * gdb.dwarf2/mac-fileno.exp * gdb.dwarf2/main-subprogram.exp * gdb.dwarf2/member-ptr-forwardref.exp * gdb.dwarf2/method-ptr.exp * gdb.dwarf2/missing-sig-type.exp * gdb.dwarf2/nonvar-access.exp * gdb.dwarf2/opaque-type-lookup.exp * gdb.dwarf2/pieces-optimized-out.exp * gdb.dwarf2/pieces.exp * gdb.dwarf2/pr10770.exp * gdb.dwarf2/pr13961.exp * gdb.dwarf2/staticvirtual.exp * gdb.dwarf2/subrange.exp * gdb.dwarf2/symtab-producer.exp * gdb.dwarf2/trace-crash.exp * gdb.dwarf2/typeddwarf.exp * gdb.dwarf2/valop.exp * gdb.dwarf2/watch-notconst.exp * gdb.fortran/array-element.exp * gdb.fortran/charset.exp * gdb.fortran/common-block.exp * gdb.fortran/complex.exp * gdb.fortran/derived-type-function.exp * gdb.fortran/derived-type.exp * gdb.fortran/logical.exp * gdb.fortran/module.exp * gdb.fortran/multi-dim.exp * gdb.fortran/nested-funcs.exp * gdb.fortran/print-formatted.exp * gdb.fortran/subarray.exp * gdb.fortran/vla-alloc-assoc.exp * gdb.fortran/vla-datatypes.exp * gdb.fortran/vla-history.exp * gdb.fortran/vla-ptr-info.exp * gdb.fortran/vla-ptype-sub.exp * gdb.fortran/vla-ptype.exp * gdb.fortran/vla-sizeof.exp * gdb.fortran/vla-type.exp * gdb.fortran/vla-value-sub-arbitrary.exp * gdb.fortran/vla-value-sub-finish.exp * gdb.fortran/vla-value-sub.exp * gdb.fortran/vla-value.exp * gdb.fortran/whatis_type.exp * gdb.go/chan.exp * gdb.go/handcall.exp * gdb.go/hello.exp * gdb.go/integers.exp * gdb.go/methods.exp * gdb.go/package.exp * gdb.go/strings.exp * gdb.go/types.exp * gdb.go/unsafe.exp * gdb.guile/scm-arch.exp * gdb.guile/scm-block.exp * gdb.guile/scm-breakpoint.exp * gdb.guile/scm-cmd.exp * gdb.guile/scm-disasm.exp * gdb.guile/scm-equal.exp * gdb.guile/scm-frame-args.exp * gdb.guile/scm-frame-inline.exp * gdb.guile/scm-frame.exp * gdb.guile/scm-iterator.exp * gdb.guile/scm-math.exp * gdb.guile/scm-objfile.exp * gdb.guile/scm-ports.exp * gdb.guile/scm-symbol.exp * gdb.guile/scm-symtab.exp * gdb.guile/scm-value-cc.exp * gdb.guile/types-module.exp * gdb.linespec/break-ask.exp * gdb.linespec/cpexplicit.exp * gdb.linespec/explicit.exp * gdb.linespec/keywords.exp * gdb.linespec/linespec.exp * gdb.linespec/ls-dollar.exp * gdb.linespec/ls-errs.exp * gdb.linespec/skip-two.exp * gdb.linespec/thread.exp * gdb.mi/mi-async.exp * gdb.mi/mi-basics.exp * gdb.mi/mi-break.exp * gdb.mi/mi-catch-load.exp * gdb.mi/mi-cli.exp * gdb.mi/mi-cmd-param-changed.exp * gdb.mi/mi-console.exp * gdb.mi/mi-detach.exp * gdb.mi/mi-disassemble.exp * gdb.mi/mi-eval.exp * gdb.mi/mi-file-transfer.exp * gdb.mi/mi-file.exp * gdb.mi/mi-fill-memory.exp * gdb.mi/mi-inheritance-syntax-error.exp * gdb.mi/mi-linespec-err-cp.exp * gdb.mi/mi-logging.exp * gdb.mi/mi-memory-changed.exp * gdb.mi/mi-read-memory.exp * gdb.mi/mi-record-changed.exp * gdb.mi/mi-reg-undefined.exp * gdb.mi/mi-regs.exp * gdb.mi/mi-return.exp * gdb.mi/mi-reverse.exp * gdb.mi/mi-simplerun.exp * gdb.mi/mi-solib.exp * gdb.mi/mi-stack.exp * gdb.mi/mi-stepi.exp * gdb.mi/mi-syn-frame.exp * gdb.mi/mi-until.exp * gdb.mi/mi-var-block.exp * gdb.mi/mi-var-child.exp * gdb.mi/mi-var-cmd.exp * gdb.mi/mi-var-cp.exp * gdb.mi/mi-var-display.exp * gdb.mi/mi-var-invalidate.exp * gdb.mi/mi-var-list-children-invalid-grandchild.exp * gdb.mi/mi-vla-fortran.exp * gdb.mi/mi-watch.exp * gdb.mi/mi2-var-child.exp * gdb.mi/user-selected-context-sync.exp * gdb.modula2/unbounded-array.exp * gdb.multi/dummy-frame-restore.exp * gdb.multi/multi-arch-exec.exp * gdb.multi/multi-arch.exp * gdb.multi/tids.exp * gdb.multi/watchpoint-multi.exp * gdb.opencl/callfuncs.exp * gdb.opencl/convs_casts.exp * gdb.opencl/datatypes.exp * gdb.opencl/operators.exp * gdb.opencl/vec_comps.exp * gdb.opt/clobbered-registers-O2.exp * gdb.opt/inline-break.exp * gdb.opt/inline-bt.exp * gdb.opt/inline-cmds.exp * gdb.opt/inline-locals.exp * gdb.pascal/case-insensitive-symbols.exp * gdb.pascal/floats.exp * gdb.pascal/gdb11492.exp * gdb.python/lib-types.exp * gdb.python/py-arch.exp * gdb.python/py-as-string.exp * gdb.python/py-bad-printers.exp * gdb.python/py-block.exp * gdb.python/py-breakpoint-create-fail.exp * gdb.python/py-breakpoint.exp * gdb.python/py-caller-is.exp * gdb.python/py-cmd.exp * gdb.python/py-explore-cc.exp * gdb.python/py-explore.exp * gdb.python/py-finish-breakpoint.exp * gdb.python/py-finish-breakpoint2.exp * gdb.python/py-frame-args.exp * gdb.python/py-frame-inline.exp * gdb.python/py-frame.exp * gdb.python/py-framefilter-mi.exp * gdb.python/py-infthread.exp * gdb.python/py-lazy-string.exp * gdb.python/py-linetable.exp * gdb.python/py-mi-events.exp * gdb.python/py-mi-objfile.exp * gdb.python/py-mi.exp * gdb.python/py-objfile.exp * gdb.python/py-pp-integral.exp * gdb.python/py-pp-maint.exp * gdb.python/py-pp-re-notag.exp * gdb.python/py-pp-registration.exp * gdb.python/py-recurse-unwind.exp * gdb.python/py-strfns.exp * gdb.python/py-symbol.exp * gdb.python/py-symtab.exp * gdb.python/py-sync-interp.exp * gdb.python/py-typeprint.exp * gdb.python/py-unwind-maint.exp * gdb.python/py-unwind.exp * gdb.python/py-value-cc.exp * gdb.python/py-xmethods.exp * gdb.reverse/amd64-tailcall-reverse.exp * gdb.reverse/break-precsave.exp * gdb.reverse/break-reverse.exp * gdb.reverse/consecutive-precsave.exp * gdb.reverse/consecutive-reverse.exp * gdb.reverse/finish-precsave.exp * gdb.reverse/finish-reverse-bkpt.exp * gdb.reverse/finish-reverse.exp * gdb.reverse/fstatat-reverse.exp * gdb.reverse/getresuid-reverse.exp * gdb.reverse/i386-precsave.exp * gdb.reverse/i386-reverse.exp * gdb.reverse/i386-sse-reverse.exp * gdb.reverse/i387-env-reverse.exp * gdb.reverse/i387-stack-reverse.exp * gdb.reverse/insn-reverse.exp * gdb.reverse/machinestate-precsave.exp * gdb.reverse/machinestate.exp * gdb.reverse/next-reverse-bkpt-over-sr.exp * gdb.reverse/pipe-reverse.exp * gdb.reverse/readv-reverse.exp * gdb.reverse/recvmsg-reverse.exp * gdb.reverse/rerun-prec.exp * gdb.reverse/s390-mvcle.exp * gdb.reverse/step-precsave.exp * gdb.reverse/step-reverse.exp * gdb.reverse/time-reverse.exp * gdb.reverse/until-precsave.exp * gdb.reverse/until-reverse.exp * gdb.reverse/waitpid-reverse.exp * gdb.reverse/watch-precsave.exp * gdb.reverse/watch-reverse.exp * gdb.rust/generics.exp * gdb.rust/methods.exp * gdb.rust/modules.exp * gdb.rust/simple.exp * gdb.server/connect-with-no-symbol-file.exp * gdb.server/ext-attach.exp * gdb.server/ext-restart.exp * gdb.server/ext-wrapper.exp * gdb.server/file-transfer.exp * gdb.server/server-exec-info.exp * gdb.server/server-kill.exp * gdb.server/server-mon.exp * gdb.server/wrapper.exp * gdb.stabs/exclfwd.exp * gdb.stabs/gdb11479.exp * gdb.threads/clone-new-thread-event.exp * gdb.threads/corethreads.exp * gdb.threads/current-lwp-dead.exp * gdb.threads/dlopen-libpthread.exp * gdb.threads/gcore-thread.exp * gdb.threads/sigstep-threads.exp * gdb.threads/watchpoint-fork.exp * gdb.trace/actions-changed.exp * gdb.trace/backtrace.exp * gdb.trace/change-loc.exp * gdb.trace/circ.exp * gdb.trace/collection.exp * gdb.trace/disconnected-tracing.exp * gdb.trace/ftrace.exp * gdb.trace/mi-trace-frame-collected.exp * gdb.trace/mi-trace-unavailable.exp * gdb.trace/mi-traceframe-changed.exp * gdb.trace/mi-tsv-changed.exp * gdb.trace/no-attach-trace.exp * gdb.trace/passc-dyn.exp * gdb.trace/qtro.exp * gdb.trace/range-stepping.exp * gdb.trace/read-memory.exp * gdb.trace/save-trace.exp * gdb.trace/signal.exp * gdb.trace/status-stop.exp * gdb.trace/tfile.exp * gdb.trace/trace-break.exp * gdb.trace/trace-buffer-size.exp * gdb.trace/trace-condition.exp * gdb.trace/tracefile-pseudo-reg.exp * gdb.trace/tstatus.exp * gdb.trace/unavailable.exp * gdb.trace/while-dyn.exp * gdb.trace/while-stepping.exp
2016-12-02Revert change to gdb.cp/ovldbreak.expLuis Machado
This reverts the timeout handling (removed by 018572b88885ae67d22612937fa1e4fd98d5f5ad) for gdb.cp/ovldbreak.exp until we decide what to do about this particular function. gdb/testsuite/ChangeLog: 2016-12-02 Luis Machado <lgustavo@codesourcery.com> * gdb.base/ovldbreak.exp (take_gdb_out_of_choice_menu): Restore timeout handling.
2016-12-01Don't handle timeout inside gdb_test_multipleLuis Machado
This fixes a few cases where the testcase is explicitly handling timeouts inside gdb_test_multiple when it is not necessary. It also converts two gdb_test_multiple calls to gdb_test_no_output calls (also removing the timeout handling). gdb/testsuite/ChangeLog: 2016-12-01 Luis Machado <lgustavo@codesourcery.com> * gdb.base/maint.exp: Remove timeout handling for gdb_test_multiple. * gdb.cp/gdb2495.exp: Likewise and convert gdb_test_multiple into gdb_test_no_output for a couple of cases. * gdb.cp/ovldbreak.exp: Remove timeout handling for gdb_test_multiple.
2016-12-01Fixup testcases outputting own name as a test name and standardize failed ↵Luis Machado
compilation messages Changes in v3: - Adjusted some testcases where the message "failed to compile" was not unique. Changes in v2: - Addressed comments from reviewers. - Fixed spurious whitespaces. - Changed compilation failure messages that included source/binary paths to ones that are short and deterministic. --- Another bit of cleanup to the testsuite. We have a number of tests that are not honoring the rule of not outputting their own name as a test name. I fixed up all the offenders i could find with the following regular expression: "(xfail|kfail|kpass|fail|pass|unsupported|untested) ([A-Za-z0-9]+|\\\$(.)*testfile(.)*)\.exp$" gdb/testsuite/ChangeLog: 2016-12-01 Luis Machado <lgustavo@codesourcery.com> Fix test names and standardize compilation error messages throughout the following files: * gdb.ada/start.exp * gdb.arch/alpha-step.exp * gdb.arch/e500-prologue.exp * gdb.arch/ftrace-insn-reloc.exp * gdb.arch/gdb1291.exp * gdb.arch/gdb1431.exp * gdb.arch/gdb1558.exp * gdb.arch/i386-dr3-watch.exp * gdb.arch/i386-sse-stack-align.exp * gdb.arch/ia64-breakpoint-shadow.exp * gdb.arch/pa-nullify.exp * gdb.arch/powerpc-aix-prologue.exp * gdb.arch/thumb-bx-pc.exp * gdb.base/annota1.exp * gdb.base/annota3.exp * gdb.base/arrayidx.exp * gdb.base/assign.exp * gdb.base/attach.exp * gdb.base/auxv.exp * gdb.base/bang.exp * gdb.base/bfp-test.exp * gdb.base/bigcore.exp * gdb.base/bitfields2.exp * gdb.base/break-fun-addr.exp * gdb.base/break-probes.exp * gdb.base/call-rt-st.exp * gdb.base/callexit.exp * gdb.base/catch-fork-kill.exp * gdb.base/charset.exp * gdb.base/checkpoint.exp * gdb.base/comprdebug.exp * gdb.base/constvars.exp * gdb.base/coredump-filter.exp * gdb.base/cursal.exp * gdb.base/cvexpr.exp * gdb.base/detach.exp * gdb.base/display.exp * gdb.base/dmsym.exp * gdb.base/dprintf-pending.exp * gdb.base/dso2dso.exp * gdb.base/dtrace-probe.exp * gdb.base/dump.exp * gdb.base/enum_cond.exp * gdb.base/exe-lock.exp * gdb.base/exec-invalid-sysroot.exp * gdb.base/execl-update-breakpoints.exp * gdb.base/exprs.exp * gdb.base/fileio.exp * gdb.base/find.exp * gdb.base/finish.exp * gdb.base/fixsection.exp * gdb.base/foll-vfork.exp * gdb.base/frame-args.exp * gdb.base/gcore.exp * gdb.base/gdb1250.exp * gdb.base/global-var-nested-by-dso.exp * gdb.base/gnu-ifunc.exp * gdb.base/hashline1.exp * gdb.base/hashline2.exp * gdb.base/hashline3.exp * gdb.base/hbreak-in-shr-unsupported.exp * gdb.base/huge.exp * gdb.base/infcall-input.exp * gdb.base/info-fun.exp * gdb.base/info-shared.exp * gdb.base/jit-simple.exp * gdb.base/jit-so.exp * gdb.base/jit.exp * gdb.base/jump.exp * gdb.base/label.exp * gdb.base/lineinc.exp * gdb.base/logical.exp * gdb.base/longjmp.exp * gdb.base/macscp.exp * gdb.base/miscexprs.exp * gdb.base/new-ui-echo.exp * gdb.base/new-ui-pending-input.exp * gdb.base/new-ui.exp * gdb.base/nodebug.exp * gdb.base/nofield.exp * gdb.base/offsets.exp * gdb.base/overlays.exp * gdb.base/pending.exp * gdb.base/pointers.exp * gdb.base/pr11022.exp * gdb.base/printcmds.exp * gdb.base/prologue.exp * gdb.base/ptr-typedef.exp * gdb.base/realname-expand.exp * gdb.base/relativedebug.exp * gdb.base/relocate.exp * gdb.base/remote.exp * gdb.base/reread.exp * gdb.base/return2.exp * gdb.base/savedregs.exp * gdb.base/sep.exp * gdb.base/sepdebug.exp * gdb.base/sepsymtab.exp * gdb.base/set-inferior-tty.exp * gdb.base/setshow.exp * gdb.base/shlib-call.exp * gdb.base/sigaltstack.exp * gdb.base/siginfo-addr.exp * gdb.base/signals.exp * gdb.base/signull.exp * gdb.base/sigrepeat.exp * gdb.base/so-impl-ld.exp * gdb.base/solib-display.exp * gdb.base/solib-overlap.exp * gdb.base/solib-search.exp * gdb.base/solib-symbol.exp * gdb.base/structs.exp * gdb.base/structs2.exp * gdb.base/symtab-search-order.exp * gdb.base/twice.exp * gdb.base/unload.exp * gdb.base/varargs.exp * gdb.base/watchpoint-solib.exp * gdb.base/watchpoint.exp * gdb.base/whatis.exp * gdb.base/wrong_frame_bt_full.exp * gdb.btrace/dlopen.exp * gdb.cell/ea-standalone.exp * gdb.cell/ea-test.exp * gdb.cp/dispcxx.exp * gdb.cp/gdb2384.exp * gdb.cp/method2.exp * gdb.cp/nextoverthrow.exp * gdb.cp/pr10728.exp * gdb.disasm/am33.exp * gdb.disasm/h8300s.exp * gdb.disasm/mn10300.exp * gdb.disasm/sh3.exp * gdb.dwarf2/dw2-dir-file-name.exp * gdb.fortran/complex.exp * gdb.fortran/library-module.exp * gdb.guile/scm-pretty-print.exp * gdb.guile/scm-symbol.exp * gdb.guile/scm-type.exp * gdb.guile/scm-value.exp * gdb.linespec/linespec.exp * gdb.mi/gdb701.exp * gdb.mi/gdb792.exp * gdb.mi/mi-breakpoint-changed.exp * gdb.mi/mi-dprintf-pending.exp * gdb.mi/mi-dprintf.exp * gdb.mi/mi-exit-code.exp * gdb.mi/mi-pending.exp * gdb.mi/mi-solib.exp * gdb.mi/new-ui-mi-sync.exp * gdb.mi/pr11022.exp * gdb.mi/user-selected-context-sync.exp * gdb.opt/solib-intra-step.exp * gdb.python/py-events.exp * gdb.python/py-finish-breakpoint.exp * gdb.python/py-mi.exp * gdb.python/py-prettyprint.exp * gdb.python/py-shared.exp * gdb.python/py-symbol.exp * gdb.python/py-template.exp * gdb.python/py-type.exp * gdb.python/py-value.exp * gdb.reverse/solib-precsave.exp * gdb.reverse/solib-reverse.exp * gdb.server/solib-list.exp * gdb.stabs/weird.exp * gdb.threads/reconnect-signal.exp * gdb.threads/stepi-random-signal.exp * gdb.trace/actions.exp * gdb.trace/ax.exp * gdb.trace/backtrace.exp * gdb.trace/change-loc.exp * gdb.trace/deltrace.exp * gdb.trace/ftrace-lock.exp * gdb.trace/ftrace.exp * gdb.trace/infotrace.exp * gdb.trace/mi-tracepoint-changed.exp * gdb.trace/packetlen.exp * gdb.trace/passcount.exp * gdb.trace/pending.exp * gdb.trace/range-stepping.exp * gdb.trace/report.exp * gdb.trace/stap-trace.exp * gdb.trace/tfind.exp * gdb.trace/trace-break.exp * gdb.trace/trace-condition.exp * gdb.trace/trace-enable-disable.exp * gdb.trace/trace-mt.exp * gdb.trace/tracecmd.exp * gdb.trace/tspeed.exp * gdb.trace/tsv.exp * lib/perftest.exp
2016-12-01Fix test names starting with uppercase using multi-line gdb_test_multipleLuis Machado
This fixes offender testcases that have test names starting with uppercase when using gdb_test_multiple in a multi-line construct. gdb/testsuite/ChangeLog 2016-12-01 Luis Machado <lgustavo@codesourcery.com> * gdb.cp/gdb2495.exp: Replace gdb_test_multiple with gdb_test_no_output. Use command as test name.
2016-12-01Fix test names starting with uppercase using multi-line gdb_test/mi_gdb_testLuis Machado
This fixes offender testcases that have test names starting with uppercase when using gdb_test/mi_gdb_test in a multi-line construct. gdb/testsuite/ChangeLog 2016-12-01 Luis Machado <lgustavo@codesourcery.com> Fix test names starting with uppercase throughout the files. * gdb.ada/array_return.exp * gdb.ada/expr_delims.exp * gdb.ada/mi_dyn_arr.exp * gdb.ada/mi_interface.exp * gdb.ada/mi_var_array.exp * gdb.ada/watch_arg.exp * gdb.arch/alpha-step.exp * gdb.arch/altivec-regs.exp * gdb.arch/e500-regs.exp * gdb.arch/powerpc-d128-regs.exp * gdb.base/arrayidx.exp * gdb.base/break.exp * gdb.base/checkpoint.exp * gdb.base/debug-expr.exp * gdb.base/dmsym.exp * gdb.base/radix.exp * gdb.base/sepdebug.exp * gdb.base/testenv.exp * gdb.base/watch_thread_num.exp * gdb.base/watchpoint-cond-gone.exp * gdb.cell/break.exp * gdb.cell/ea-cache.exp * gdb.compile/compile.exp * gdb.cp/gdb2495.exp * gdb.gdb/selftest.exp * gdb.gdb/xfullpath.exp * gdb.go/hello.exp * gdb.go/integers.exp * gdb.objc/basicclass.exp * gdb.pascal/hello.exp * gdb.pascal/integers.exp * gdb.python/py-breakpoint.exp * gdb.python/py-cmd.exp * gdb.python/py-linetable.exp * gdb.python/py-xmethods.exp * gdb.python/python.exp * gdb.reverse/consecutive-precsave.exp * gdb.reverse/finish-precsave.exp * gdb.reverse/i386-precsave.exp * gdb.reverse/machinestate-precsave.exp * gdb.reverse/sigall-precsave.exp * gdb.reverse/solib-precsave.exp * gdb.reverse/step-precsave.exp * gdb.reverse/until-precsave.exp * gdb.reverse/watch-precsave.exp * gdb.threads/leader-exit.exp * gdb.threads/pthreads.exp * gdb.threads/wp-replication.exp * gdb.trace/actions.exp * gdb.trace/mi-tsv-changed.exp * gdb.trace/tsv.exp
2016-12-01Fix test names starting with uppercase using gdb_test_multipleLuis Machado
This fixes offender testcases that have test names starting with uppercase when using gdb_test_multiple in a single-line construct. gdb/testsuite/ChangeLog 2016-12-01 Luis Machado <lgustavo@codesourcery.com> Fix test names starting with uppercase throughout the files. * gdb.arch/i386-bp_permanent.exp * gdb.arch/i386-gnu-cfi.exp * gdb.base/disasm-end-cu.exp * gdb.base/macscp.exp * gdb.base/pending.exp * gdb.base/watch_thread_num.exp * gdb.cp/exception.exp * gdb.cp/gdb2495.exp * gdb.cp/local.exp * gdb.python/py-evsignal.exp * gdb.python/python.exp * gdb.trace/tracecmd.exp
2016-12-01Fix test names starting with uppercase using gdb_test on a single line.Luis Machado
Changes in v3: Fixed incorrect substitutions. This fixes offender testcases that have test names starting with uppercase when using gdb_test in a single line construct. gdb/testsuite/ChangeLog 2016-12-01 Luis Machado <lgustavo@codesourcery.com> Fix test names starting with uppercase throughout the files. * gdb.arch/i386-mpx-simple_segv.exp * gdb.arch/i386-mpx.exp * gdb.arch/i386-permbkpt.exp * gdb.arch/pa-nullify.exp * gdb.arch/powerpc-d128-regs.exp * gdb.arch/vsx-regs.exp * gdb.base/bfp-test.exp * gdb.base/break.exp * gdb.base/breakpoint-shadow.exp * gdb.base/callfuncs.exp * gdb.base/charset.exp * gdb.base/commands.exp * gdb.base/completion.exp * gdb.base/dfp-test.exp * gdb.base/echo.exp * gdb.base/ending-run.exp * gdb.base/eval.exp * gdb.base/expand-psymtabs.exp * gdb.base/float128.exp * gdb.base/floatn.exp * gdb.base/foll-exec-mode.exp * gdb.base/gdb1056.exp * gdb.base/gdb11531.exp * gdb.base/kill-after-signal.exp * gdb.base/multi-forks.exp * gdb.base/overlays.exp * gdb.base/pending.exp * gdb.base/sepdebug.exp * gdb.base/testenv.exp * gdb.base/valgrind-db-attach.exp * gdb.base/watch_thread_num.exp * gdb.base/watchpoint-cond-gone.exp * gdb.base/watchpoint.exp * gdb.base/watchpoints.exp * gdb.cp/arg-reference.exp * gdb.cp/baseenum.exp * gdb.cp/operator.exp * gdb.cp/shadow.exp * gdb.dwarf2/dw2-op-out-param.exp * gdb.dwarf2/dw2-reg-undefined.exp * gdb.go/chan.exp * gdb.go/hello.exp * gdb.go/integers.exp * gdb.go/methods.exp * gdb.go/package.exp * gdb.guile/scm-parameter.exp * gdb.guile/scm-progspace.exp * gdb.guile/scm-value.exp * gdb.mi/mi-pending.exp * gdb.mi/user-selected-context-sync.exp * gdb.multi/multi-attach.exp * gdb.multi/tids.exp * gdb.opt/clobbered-registers-O2.exp * gdb.pascal/floats.exp * gdb.pascal/integers.exp * gdb.python/py-block.exp * gdb.python/py-events.exp * gdb.python/py-parameter.exp * gdb.python/py-symbol.exp * gdb.python/py-symtab.exp * gdb.python/py-type.exp * gdb.python/py-value.exp * gdb.python/py-xmethods.exp * gdb.python/python.exp * gdb.reverse/break-precsave.exp * gdb.reverse/consecutive-precsave.exp * gdb.reverse/finish-precsave.exp * gdb.reverse/i386-precsave.exp * gdb.reverse/machinestate-precsave.exp * gdb.reverse/sigall-precsave.exp * gdb.reverse/solib-precsave.exp * gdb.reverse/step-precsave.exp * gdb.reverse/until-precsave.exp * gdb.reverse/watch-precsave.exp * gdb.server/ext-attach.exp * gdb.server/ext-restart.exp * gdb.server/ext-run.exp * gdb.server/ext-wrapper.exp * gdb.stabs/gdb11479.exp * gdb.stabs/weird.exp * gdb.threads/attach-many-short-lived-threads.exp * gdb.threads/kill.exp * gdb.threads/watchpoint-fork.exp
2016-12-01Fix test names starting with uppercase output by basic functionsLuis Machado
The following patch is based on the previous patch i sent and handles cases of test names that start with an uppercase letter. Test names should start with lowercase unless it starts with the name of a technology, architecture, ISA etc. This first patch addresses cases of test names output explicitly via xfail, kfail, kpass, fail, pass, unsupported, untested and also names set with the pattern "set test" and "set testname". gdb/testsuite/ChangeLog: 2016-12-01 Luis Machado <lgustavo@codesourcery.com> Fix test names starting with uppercase throughout all the files below. * gdb.ada/array_return.exp * gdb.ada/catch_ex.exp * gdb.ada/info_exc.exp * gdb.ada/mi_catch_ex.exp * gdb.ada/mi_dyn_arr.exp * gdb.ada/mi_ex_cond.exp * gdb.ada/mi_exc_info.exp * gdb.ada/mi_interface.exp * gdb.ada/mi_task_arg.exp * gdb.ada/mi_task_info.exp * gdb.ada/mi_var_array.exp * gdb.arch/alpha-step.exp * gdb.arch/amd64-disp-step.exp * gdb.arch/arm-disp-step.exp * gdb.arch/disp-step-insn-reloc.exp * gdb.arch/e500-prologue.exp * gdb.arch/ftrace-insn-reloc.exp * gdb.arch/gdb1558.exp * gdb.arch/i386-bp_permanent.exp * gdb.arch/i386-disp-step.exp * gdb.arch/i386-float.exp * gdb.arch/i386-gnu-cfi.exp * gdb.arch/ia64-breakpoint-shadow.exp * gdb.arch/mips16-thunks.exp * gdb.arch/pa-nullify.exp * gdb.arch/powerpc-aix-prologue.exp * gdb.arch/powerpc-power.exp * gdb.arch/ppc-dfp.exp * gdb.arch/s390-tdbregs.exp * gdb.arch/spu-info.exp * gdb.arch/spu-ls.exp * gdb.arch/thumb-bx-pc.exp * gdb.base/advance.exp * gdb.base/annota-input-while-running.exp * gdb.base/arrayidx.exp * gdb.base/asmlabel.exp * gdb.base/async.exp * gdb.base/attach-wait-input.exp * gdb.base/auto-connect-native-target.exp * gdb.base/batch-preserve-term-settings.exp * gdb.base/bfp-test.exp * gdb.base/bigcore.exp * gdb.base/bp-permanent.exp * gdb.base/break-always.exp * gdb.base/break-fun-addr.exp * gdb.base/break-idempotent.exp * gdb.base/break-main-file-remove-fail.exp * gdb.base/break-probes.exp * gdb.base/break-unload-file.exp * gdb.base/break.exp * gdb.base/call-ar-st.exp * gdb.base/call-rt-st.exp * gdb.base/call-sc.exp * gdb.base/call-signal-resume.exp * gdb.base/call-strs.exp * gdb.base/callexit.exp * gdb.base/callfuncs.exp * gdb.base/catch-gdb-caused-signals.exp * gdb.base/catch-signal-siginfo-cond.exp * gdb.base/catch-syscall.exp * gdb.base/compare-sections.exp * gdb.base/cond-eval-mode.exp * gdb.base/condbreak-call-false.exp * gdb.base/consecutive-step-over.exp * gdb.base/cursal.exp * gdb.base/disabled-location.exp * gdb.base/disasm-end-cu.exp * gdb.base/display.exp * gdb.base/double-prompt-target-event-error.exp * gdb.base/dprintf-bp-same-addr.exp * gdb.base/dprintf-detach.exp * gdb.base/dprintf-next.exp * gdb.base/dprintf-non-stop.exp * gdb.base/dprintf-pending.exp * gdb.base/dso2dso.exp * gdb.base/ending-run.exp * gdb.base/enum_cond.exp * gdb.base/examine-backward.exp * gdb.base/exe-lock.exp * gdb.base/exec-invalid-sysroot.exp * gdb.base/execl-update-breakpoints.exp * gdb.base/execution-termios.exp * gdb.base/fileio.exp * gdb.base/fixsection.exp * gdb.base/foll-exec-mode.exp * gdb.base/foll-exec.exp * gdb.base/fork-running-state.exp * gdb.base/frame-args.exp * gdb.base/fullpath-expand.exp * gdb.base/func-ptr.exp * gdb.base/gcore-relro-pie.exp * gdb.base/gdb1090.exp * gdb.base/gdb1555.exp * gdb.base/global-var-nested-by-dso.exp * gdb.base/gnu-ifunc.exp * gdb.base/hbreak-in-shr-unsupported.exp * gdb.base/hbreak-unmapped.exp * gdb.base/hook-stop.exp * gdb.base/infcall-input.exp * gdb.base/info-fun.exp * gdb.base/info-shared.exp * gdb.base/interrupt-noterm.exp * gdb.base/jit-so.exp * gdb.base/jit.exp * gdb.base/line-symtabs.exp * gdb.base/list.exp * gdb.base/longjmp.exp * gdb.base/macscp.exp * gdb.base/max-value-size.exp * gdb.base/nodebug.exp * gdb.base/nofield.exp * gdb.base/overlays.exp * gdb.base/paginate-after-ctrl-c-running.exp * gdb.base/paginate-bg-execution.exp * gdb.base/paginate-inferior-exit.exp * gdb.base/pending.exp * gdb.base/pr11022.exp * gdb.base/printcmds.exp * gdb.base/ptr-typedef.exp * gdb.base/ptype.exp * gdb.base/randomize.exp * gdb.base/range-stepping.exp * gdb.base/realname-expand.exp * gdb.base/relativedebug.exp * gdb.base/remote.exp * gdb.base/savedregs.exp * gdb.base/sepdebug.exp * gdb.base/set-noassign.exp * gdb.base/shlib-call.exp * gdb.base/shreloc.exp * gdb.base/sigaltstack.exp * gdb.base/sigbpt.exp * gdb.base/siginfo-addr.exp * gdb.base/siginfo-obj.exp * gdb.base/siginfo-thread.exp * gdb.base/signest.exp * gdb.base/signull.exp * gdb.base/sigrepeat.exp * gdb.base/skip.exp * gdb.base/so-impl-ld.exp * gdb.base/solib-corrupted.exp * gdb.base/solib-disc.exp * gdb.base/solib-display.exp * gdb.base/solib-overlap.exp * gdb.base/solib-search.exp * gdb.base/solib-symbol.exp * gdb.base/source-execution.exp * gdb.base/sss-bp-on-user-bp-2.exp * gdb.base/sss-bp-on-user-bp.exp * gdb.base/stack-checking.exp * gdb.base/stale-infcall.exp * gdb.base/step-break.exp * gdb.base/step-line.exp * gdb.base/step-over-exit.exp * gdb.base/step-test.exp * gdb.base/structs.exp * gdb.base/sym-file.exp * gdb.base/symtab-search-order.exp * gdb.base/term.exp * gdb.base/type-opaque.exp * gdb.base/unload.exp * gdb.base/until-nodebug.exp * gdb.base/until.exp * gdb.base/unwindonsignal.exp * gdb.base/watch-cond.exp * gdb.base/watch-non-mem.exp * gdb.base/watch_thread_num.exp * gdb.base/watchpoint-reuse-slot.exp * gdb.base/watchpoint-solib.exp * gdb.base/watchpoint.exp * gdb.btrace/dlopen.exp * gdb.cell/arch.exp * gdb.cell/break.exp * gdb.cell/bt.exp * gdb.cell/core.exp * gdb.cell/data.exp * gdb.cell/dwarfaddr.exp * gdb.cell/ea-cache.exp * gdb.cell/ea-standalone.exp * gdb.cell/ea-test.exp * gdb.cell/f-regs.exp * gdb.cell/fork.exp * gdb.cell/gcore.exp * gdb.cell/mem-access.exp * gdb.cell/ptype.exp * gdb.cell/registers.exp * gdb.cell/sizeof.exp * gdb.cell/solib-symbol.exp * gdb.cell/solib.exp * gdb.compile/compile-tls.exp * gdb.cp/exception.exp * gdb.cp/gdb2495.exp * gdb.cp/local.exp * gdb.cp/mb-inline.exp * gdb.cp/mb-templates.exp * gdb.cp/pr10687.exp * gdb.cp/pr9167.exp * gdb.cp/scope-err.exp * gdb.cp/templates.exp * gdb.cp/virtfunc.exp * gdb.dwarf2/dw2-dir-file-name.exp * gdb.dwarf2/dw2-single-line-discriminators.exp * gdb.fortran/complex.exp * gdb.fortran/library-module.exp * gdb.guile/guile.exp * gdb.guile/scm-cmd.exp * gdb.guile/scm-frame-inline.exp * gdb.guile/scm-objfile.exp * gdb.guile/scm-pretty-print.exp * gdb.guile/scm-symbol.exp * gdb.guile/scm-type.exp * gdb.guile/scm-value.exp * gdb.linespec/keywords.exp * gdb.linespec/ls-errs.exp * gdb.linespec/macro-relative.exp * gdb.linespec/thread.exp * gdb.mi/mi-breakpoint-changed.exp * gdb.mi/mi-dprintf-pending.exp * gdb.mi/mi-fullname-deleted.exp * gdb.mi/mi-logging.exp * gdb.mi/mi-pending.exp * gdb.mi/mi-solib.exp * gdb.mi/new-ui-mi-sync.exp * gdb.mi/user-selected-context-sync.exp * gdb.multi/dummy-frame-restore.exp * gdb.multi/multi-arch-exec.exp * gdb.multi/remove-inferiors.exp * gdb.multi/watchpoint-multi-exit.exp * gdb.opt/solib-intra-step.exp * gdb.perf/backtrace.exp * gdb.perf/single-step.exp * gdb.perf/skip-command.exp * gdb.perf/skip-prologue.exp * gdb.perf/solib.exp * gdb.python/lib-types.exp * gdb.python/py-as-string.exp * gdb.python/py-bad-printers.exp * gdb.python/py-block.exp * gdb.python/py-breakpoint.exp * gdb.python/py-cmd.exp * gdb.python/py-events.exp * gdb.python/py-evthreads.exp * gdb.python/py-finish-breakpoint.exp * gdb.python/py-finish-breakpoint2.exp * gdb.python/py-frame-inline.exp * gdb.python/py-frame.exp * gdb.python/py-inferior.exp * gdb.python/py-infthread.exp * gdb.python/py-mi.exp * gdb.python/py-objfile.exp * gdb.python/py-pp-maint.exp * gdb.python/py-pp-registration.exp * gdb.python/py-prettyprint.exp * gdb.python/py-recurse-unwind.exp * gdb.python/py-shared.exp * gdb.python/py-symbol.exp * gdb.python/py-symtab.exp * gdb.python/py-template.exp * gdb.python/py-type.exp * gdb.python/py-unwind-maint.exp * gdb.python/py-unwind.exp * gdb.python/py-value.exp * gdb.python/python.exp * gdb.reverse/finish-reverse-bkpt.exp * gdb.reverse/insn-reverse.exp * gdb.reverse/next-reverse-bkpt-over-sr.exp * gdb.reverse/solib-precsave.exp * gdb.reverse/solib-reverse.exp * gdb.stabs/gdb11479.exp * gdb.stabs/weird.exp * gdb.threads/fork-child-threads.exp * gdb.threads/fork-plus-threads.exp * gdb.threads/fork-thread-pending.exp * gdb.threads/forking-threads-plus-breakpoint.exp * gdb.threads/hand-call-in-threads.exp * gdb.threads/interrupted-hand-call.exp * gdb.threads/linux-dp.exp * gdb.threads/local-watch-wrong-thread.exp * gdb.threads/next-while-other-thread-longjmps.exp * gdb.threads/non-ldr-exit.exp * gdb.threads/pending-step.exp * gdb.threads/print-threads.exp * gdb.threads/process-dies-while-detaching.exp * gdb.threads/process-dies-while-handling-bp.exp * gdb.threads/pthreads.exp * gdb.threads/queue-signal.exp * gdb.threads/reconnect-signal.exp * gdb.threads/signal-command-handle-nopass.exp * gdb.threads/signal-command-multiple-signals-pending.exp * gdb.threads/signal-delivered-right-thread.exp * gdb.threads/signal-sigtrap.exp * gdb.threads/sigthread.exp * gdb.threads/staticthreads.exp * gdb.threads/stepi-random-signal.exp * gdb.threads/thread-unwindonsignal.exp * gdb.threads/thread_check.exp * gdb.threads/thread_events.exp * gdb.threads/tid-reuse.exp * gdb.threads/tls-nodebug.exp * gdb.threads/tls-shared.exp * gdb.threads/tls-so_extern.exp * gdb.threads/tls.exp * gdb.threads/wp-replication.exp * gdb.trace/actions-changed.exp * gdb.trace/actions.exp * gdb.trace/backtrace.exp * gdb.trace/change-loc.exp * gdb.trace/collection.exp * gdb.trace/deltrace.exp * gdb.trace/disconnected-tracing.exp * gdb.trace/entry-values.exp * gdb.trace/ftrace-lock.exp * gdb.trace/ftrace.exp * gdb.trace/infotrace.exp * gdb.trace/mi-trace-frame-collected.exp * gdb.trace/mi-trace-unavailable.exp * gdb.trace/mi-traceframe-changed.exp * gdb.trace/mi-tracepoint-changed.exp * gdb.trace/mi-tsv-changed.exp * gdb.trace/no-attach-trace.exp * gdb.trace/packetlen.exp * gdb.trace/passc-dyn.exp * gdb.trace/passcount.exp * gdb.trace/pending.exp * gdb.trace/pr16508.exp * gdb.trace/qtro.exp * gdb.trace/range-stepping.exp * gdb.trace/read-memory.exp * gdb.trace/report.exp * gdb.trace/save-trace.exp * gdb.trace/signal.exp * gdb.trace/stap-trace.exp * gdb.trace/status-stop.exp * gdb.trace/strace.exp * gdb.trace/tfile.exp * gdb.trace/tfind.exp * gdb.trace/trace-break.exp * gdb.trace/trace-condition.exp * gdb.trace/trace-enable-disable.exp * gdb.trace/trace-mt.exp * gdb.trace/tracecmd.exp * gdb.trace/tracefile-pseudo-reg.exp * gdb.trace/tspeed.exp * gdb.trace/tstatus.exp * gdb.trace/tsv.exp * gdb.trace/unavailable.exp * gdb.trace/while-dyn.exp * gdb.trace/while-stepping.exp * lib/gdb-guile.exp * lib/gdb.exp * lib/mi-support.exp * lib/pascal.exp * lib/perftest.exp * lib/prelink-support.exp * lib/selftest-support.exp
2016-09-16testsuite: Fix false FAIL in gdb.cp/casts.expJan Kratochvil
gcc-6.2.1-1.fc26.x86_64 gdb compile failed, /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/casts.cc:40:10: error: expected primary-expression before 'int' decltype(int x) ^~~ /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/casts.cc:40:10: error: expected ')' before 'int' /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/casts.cc:40:1: error: expected unqualified-id before 'decltype' decltype(int x) ^~~~~~~~ /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/casts.cc: In function 'int main(int, char**)': /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/casts.cc:59:14: error: expected primary-expression before 'decltype' double y = decltype(2); ^~~~~~~~ 'decltype' is a registered keyword since C++11 which is now a default for GCC. On Thu, 15 Sep 2016 14:06:56 +0200, Pedro Alves wrote: Seems to be exercising the FLAG_SHADOW bits: ... {"__typeof__", TYPEOF, OP_TYPEOF, 0 }, {"__typeof", TYPEOF, OP_TYPEOF, 0 }, {"typeof", TYPEOF, OP_TYPEOF, FLAG_SHADOW }, {"__decltype", DECLTYPE, OP_DECLTYPE, FLAG_CXX }, {"decltype", DECLTYPE, OP_DECLTYPE, FLAG_CXX | FLAG_SHADOW }, ... /* This is used to associate some attributes with a token. */ enum token_flag { ... /* If this bit is set, the token is conditional: if there is a symbol of the same name, then the token is a symbol; otherwise, the token is a keyword. */ FLAG_SHADOW = 2 }; So perhaps a better fix is to move that particular test to a separate testcase that force-compiles with -std=c++03. gdb/testsuite/ChangeLog 2016-09-16 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.cp/casts.cc (decltype): Move it ... (main): ... with its call to ... * gdb.cp/casts03.cc: ... a new file. * gdb.cp/casts.exp: Add new file casts03.cc, move decltype test to it.
2016-09-15testsuite: Fix C++11 compilation failure for gdb.cp/m-static.expJan Kratochvil
gcc-6.2.1-1.fc26.x86_64 g++ -std=c++03: no warnings g++: In file included from /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/m-static.cc:79:0: /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/m-static.h:9:34: error: ‘constexpr’ needed for in-class initialization of static data member ‘const float gnu_obj_4::somewhere’ of non-integral type [-fpermissive] static const float somewhere = 3.14159; ^~~~~~~ clang++: In file included from /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/m-static.cc:79: /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/m-static.h:9:22: warning: in-class initializer for static data member of type 'const float' is a GNU extension [-Wgnu-static-float-init] static const float somewhere = 3.14159; ^ ~~~~~~~ 1 warning generated. clang++ -std=c++11: In file included from /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/m-static.cc:79: /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/m-static.h:9:22: error: in-class initializer for static data member of type 'const float' requires 'constexpr' specifier [-Wstatic-float-init] static const float somewhere = 3.14159; ^ ~~~~~~~ /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/m-static.h:9:3: note: add 'constexpr' static const float somewhere = 3.14159; ^ constexpr 1 error generated. OK for check-in? After the fix out of the 4 combinations above only this one remains non-empty: clang++: In file included from /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/m-static.cc:79: /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/m-static.h:9:22: warning: in-class initializer for static data member of type 'const float' is a GNU extension [-Wgnu-static-float-init] static const float somewhere = 3.14159; ^ ~~~~~~~ 1 warning generated. On Thu, 15 Sep 2016 15:10:50 +0200, Pedro Alves wrote: Hmm, OK, now that I read the test, I think you were right in trying to keep it safe, actually. The .exp file has: if { $non_dwarf } { setup_xfail *-*-* } gdb_test "print test4.everywhere" "\\$\[0-9\].* = 317" "static const int initialized in class definition" if { $non_dwarf } { setup_xfail *-*-* } gdb_test "print test4.somewhere" "\\$\[0-9\].* = 3.14\[0-9\]*" "static const float initialized in class definition" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Added by this: https://sourceware.org/bugzilla/show_bug.cgi?id=11702 https://sourceware.org/ml/gdb-patches/2010-06/msg00677.html https://sourceware.org/ml/gdb-patches/2010-06/txt00011.txt So the new patch would make that highlighted tested above not test what its test message says it is testing. So I now think your original patch is better. Please push that one instead. gdb/testsuite/ChangeLog 2016-09-15 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.cp/m-static.h (gnu_obj_4::somewhere): Use constexpr for C++11.
2016-09-06Remove obsolete TYPE_FLAG_... valuesUlrich Weigand
Now that init_type no longer takes a FLAGS argument, there is no user of the TYPE_FLAGS_... enum values left. This commit removes them (and all references to them in comments as well). This is mostly a no-op, except for a change to the Python type printer, which attempted to use them before. (As best as I can tell, this wasn't really needed anyway, since it was only used to pretty-print type *instance* flags, which only use the instance flags.) gdb/ChangeLog: * gdbtypes.h (enum type_flag_value): Remove. Remove references to TYPE_FLAG_... in comments throughout. * gdbtypes.c (recursive_dump_type): Do not print TYPE_FLAG_... flags, print the corresponding TYPE_... access macro names. Remove references to TYPE_FLAG_... in comments throughout. * infcall.c: Remove references to TYPE_FLAG_... in comments. * valprint.c: Likewise. * gdb-gdb.py (class TypeFlag): No longer consider TYPE_FLAG_... values, only TYPE_INSTANCE_FLAG_... values. (class TypeFlagsPrinter): Likewise. gdb/testsuite/ChangeLog: * gdb.cp/hang.exp: Remove reference to TYPE_FLAG_STUB in comment. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-08-01Tweak gdb.cp tests for aarch32Yao Qi
There are some gdb.cp/ tests fails if the program is compiled for arm 32-bit but GDB/GDBserver is aarch64 64-bit program, because target triplet doesn't match "arm*-*-*". Instead, we can use is_aarch32_target. gdb/testsuite: 2016-08-01 Yao Qi <yao.qi@linaro.org> * gdb.cp/anon-struct.exp: Check is_aarch32_target. * gdb.cp/cpexprs.exp: Likewise. * gdb.cp/m-static.exp: Likewise.
2016-06-13gdb: Use UNSUPPORTED not XFAIL for unsupported target featuresAndrew Burgess
If a target does not support making function calls from GDB then in a number of test files, we currently report an XFAIL and skip some, or all of the tests. This commit changes the XFAIL to an UNSUPPORTED as this seems more appropriate in these cases. Some of the tests used bug ID 2416 to be reported in the XFAIL. In the current GDB bugzilla bug 2416 has nothing to do with calling target functions from GDB. gdb/testsuite/ChangeLog: * gdb.base/call-ar-st.exp: Report unsupported rather than xfail for unsupported target features. * gdb.base/call-rt-st.exp: Likewise. * gdb.base/call-sc.exp: Likewise. * gdb.base/call-signal-resume.exp: Likewise. * gdb.base/call-strs.exp: Likewise. * gdb.base/callexit.exp: Likewise. * gdb.base/callfuncs.exp: Likewise. * gdb.base/nodebug.exp: Likewise. * gdb.base/printcmds.exp: Likewise. * gdb.base/ptype.exp: Likewise. * gdb.base/structs.exp: Likewise. * gdb.base/unwindonsignal.exp: Likewise. * gdb.cp/gdb2495.exp: Likewise. * gdb.cp/templates.exp: Likewise. * gdb.cp/virtfunc.exp: Likewise. * gdb.threads/hand-call-in-threads.exp: Likewise. * gdb.threads/interrupted-hand-call.exp: Likewise. * gdb.threads/thread-unwindonsignal.exp: Likewise.
2016-04-27Rename gdb_load_shlibs to gdb_load_shlibSimon Marchi
Rename gdb_load_shlibs to gdb_load_shlib to reflect that it can only load a single shlib at the time. gdb/testsuite/ChangeLog: * lib/gdb.exp (gdb_load_shlibs): Rename to... (gdb_load_shlib): ... this. * gdb.arch/ftrace-insn-reloc.exp: Adjust gdb_load_shlibs -> gdb_load_shlib. * gdb.base/catch-load.exp (one_catch_load_test): Likewise. * gdb.base/ctxobj.exp: Likewise. * gdb.base/dprintf-pending.exp: Likewise. * gdb.base/dso2dso.exp: Likewise. * gdb.base/fixsection.exp: Likewise. * gdb.base/gcore-relro.exp: Likewise. * gdb.base/gdb1555.exp: Likewise. * gdb.base/global-var-nested-by-dso.exp: Likewise. * gdb.base/gnu-ifunc.exp: Likewise. * gdb.base/hbreak-in-shr-unsupported.exp: Likewise. * gdb.base/jit-so.exp (one_jit_test): Likewise. * gdb.base/pending.exp: Likewise. * gdb.base/print-file-var.exp: Likewise. * gdb.base/print-symbol-loading.exp: Likewise. * gdb.base/shlib-call.exp: Likewise. * gdb.base/shreloc.exp: Likewise. * gdb.base/so-impl-ld.exp: Likewise. * gdb.base/solib-disc.exp: Likewise. * gdb.base/solib-nodir.exp: Likewise. * gdb.base/solib-overlap.exp: Likewise. * gdb.base/solib-symbol.exp: Likewise. * gdb.base/solib-weak.exp (do_test): Likewise. * gdb.base/sym-file.exp: Likewise. * gdb.base/symtab-search-order.exp: Likewise. * gdb.base/type-opaque.exp: Likewise. * gdb.base/unload.exp: Likewise. * gdb.base/watchpoint-solib.exp: Likewise. * gdb.compile/compile.exp: Likewise. * gdb.cp/gdb2384.exp: Likewise. * gdb.cp/infcall-dlopen.exp: Likewise. * gdb.cp/re-set-overloaded.exp: Likewise. * gdb.fortran/library-module.exp: Likewise. * gdb.opt/solib-intra-step.exp: Likewise. * gdb.python/py-finish-breakpoint.exp: Likewise. * gdb.python/py-shared.exp: Likewise. * gdb.reverse/solib-precsave.exp: Likewise. * gdb.reverse/solib-reverse.exp: Likewise. * gdb.server/solib-list.exp: Likewise. * gdb.threads/dlopen-libpthread.exp: Likewise. * gdb.threads/tls-shared.exp: Likewise. * gdb.threads/tls-so_extern.exp: Likewise. * gdb.trace/change-loc.exp: Likewise. * gdb.trace/ftrace-lock.exp: Likewise. * gdb.trace/ftrace.exp: Likewise. * gdb.trace/mi-tracepoint-changed.exp (test_reconnect): Likewise. * gdb.trace/pending.exp: Likewise. * gdb.trace/range-stepping.exp: Likewise. * gdb.trace/strace.exp (strace_remove_socket): Likewise. (strace_info_marker): Likewise. (strace_probe_marker): Likewise. (strace_trace_on_same_addr): Likewise. (strace_trace_on_diff_addr): Likewise. * gdb.trace/trace-break.exp: Likewise. * gdb.trace/trace-condition.exp: Likewise. * gdb.trace/trace-mt.exp: Likewise.
2016-03-15PR 18303, Tolerate malformed input for lookup_symbol-called functionsDon Breazeal
lookup_symbol is often called with user input. Consequently, any function called from lookup_symbol{,_in_language} should attempt to deal with malformed input gracefully. After all, malformed user input is not a programming/API error. This patch does not attempt to find/correct all instances of this. It only fixes locations in the code that trigger test suite failures. This patch fixes PR breakpoints/18303, "Assertion: -breakpoint-insert with windows paths of file in non-current directory". The patch includes three new tests related to this. One is just gdb.linespec/ls-errs.exp copied and converted to use C++ instead of C, and to add a case using a file name containing a Windows-style logical drive specifier. The others include an MI test to provide a regression test for the specific case reported in PR 18303, and a C++ test for proper error handling of access to a program variable when using a file scope specifier that refers to a non-existent file. Tested on x86_64 native Linux. gdb/ChangeLog 2016-01-28 Keith Seitz <keiths@redhat.com> PR breakpoints/18303 * cp-namespace.c (cp_lookup_bare_symbol): Change assertion to look for "::" instead of simply ":". (cp_search_static_and_baseclasses): Return null_block_symbol for malformed input. Remove assertions. * cp-support.c (cp_find_first_component_aux): Do not return a prefix length for ':' unless the next character is also ':'. gdb/testsuite/ChangeLog 2016-01-28 Don Breazeal <donb@codesourcery.com> * gdb.cp/scope-err.cc: New test program. * gdb.cp/scope-err.exp: New test script. * gdb.linespec/ls-errs.c (myfunction): Expanded to have multiple lines and "set breakpoint here" comment. * gdb.linespec/ls-errs.exp: Added C++ testing and new test case. Fixed some whitespace and format issues. * gdb.mi/mi-linespec-err-cp.cc: New test program. * gdb.mi/mi-linespec-err-cp.exp: New test script.
2016-03-02testsuite: Fix run to main issue introduced by GCC 5.x.bernhard.heckel
Adding a dummy assignment as a new breakpoint anchor because breakpoint on return statement doesn't work for GCC 5.x. 2016-03-02 Bernhard Heckel <bernhard.heckel@intel.com> gdb/testsuite/Changelog: * gdb.cp/vla-cxx.cc: Insert dummy assignment as anchor for an breakpoint.
2016-02-08Always organize test artifacts in a directory hierarchySimon Marchi
When running tests in parallel, each test puts its generated files in a different directory, under "outputs". I think it would be nice if it was always the case, as it would isolate the test cases a bit more. An artifact created by a test wouldn't get overwritten by another test. Also, it makes it easier to clean up. A lot of executables are left all over the place because their names do not appear in gdb.*/Makefile. If everything is in "outputs", then we just have to delete that directory (which we already do). At the same time it makes the gdb.foo directories and their Makefiles useless in the build directory, since they are pretty much only used for cleaning. What do you think? gdb/testsuite/ChangeLog: * Makefile.in (ALL_SUBDIRS): Remove. (clean mostlyclean): Do not recurse in ALL_SUBDIRS. (distclean maintainer-clean realclean): Likewise. * configure.ac (AC_OUTPUT): Remove gdb.*/Makefile. * configure: Regenerate. * gdb.ada/Makefile.in: Delete. * gdb.arch/Makefile.in: Likewise. * gdb.asm/Makefile.in: Likewise. * gdb.base/Makefile.in: Likewise. * gdb.btrace/Makefile.in: Likewise. * gdb.cell/Makefile.in: Likewise. * gdb.compile/Makefile.in: Likewise. * gdb.cp/Makefile.in: Likewise. * gdb.disasm/Makefile.in: Likewise. * gdb.dlang/Makefile.in: Likewise. * gdb.dwarf2/Makefile.in: Likewise. * gdb.fortran/Makefile.in: Likewise. * gdb.gdb/Makefile.in: Likewise. * gdb.go/Makefile.in: Likewise. * gdb.guile/Makefile.in: Likewise. * gdb.java/Makefile.in: Likewise. * gdb.linespec/Makefile.in: Likewise. * gdb.mi/Makefile.in: Likewise. * gdb.modula2/Makefile.in: Likewise. * gdb.multi/Makefile.in: Likewise. * gdb.objc/Makefile.in: Likewise. * gdb.opencl/Makefile.in: Likewise. * gdb.opt/Makefile.in: Likewise. * gdb.pascal/Makefile.in: Likewise. * gdb.perf/Makefile.in: Likewise. * gdb.python/Makefile.in: Likewise. * gdb.reverse/Makefile.in: Likewise. * gdb.server/Makefile.in: Likewise. * gdb.stabs/Makefile.in: Likewise. * gdb.threads/Makefile.in: Likewise. * gdb.trace/Makefile.in: Likewise. * gdb.xml/Makefile.in: Likewise. * lib/gdb.exp (make_gdb_parallel_path): Add check for GDB_PARALLEL. (standard_output_file): Remove check for GDB_PARALLEL, always return path in outputs/$subdir/$testname.
2016-01-01GDB copyright headers update after running GDB's copyright.py script.Joel Brobecker
gdb/ChangeLog: Update year range in copyright notice of all files.