* NEWS: Add entry.
* dwarf2read.c (dwarf2_add_field): If DW_AT_const_value is present,
create a symbol for the field and record the value.
(new_symbol): Handle DW_TAG_member.
* gdbtypes.c (field_is_static): Remove FIXME.
* symtab.c (search_symbols): When searching for VARIABLES_DOMAIN,
only ignore LOC_CONST symbols that are enums.
testsuite/
Test PR c++/11702.
* gdb.cp/m-static.exp: Add testcase.
* gdb.cp/m-static.h (gnu_obj_4): Add initialized static const member.
* cp-namespace.c (cp_lookup_nested_type): New variable
concatenated_name. Turn the current return condition into a reverse
one. Call also lookup_static_symbol_aux on the constructed qualified
name.
* symtab.c (lookup_symbol_aux): Move variable objfile and searching in
other files into a called ...
(lookup_static_symbol_aux): ... new function here.
* symtab.h (lookup_static_symbol_aux): New prototype.
* valops.c (value_maybe_namespace_elt): Call also
lookup_static_symbol_aux if we failed otherwise.
gdb/testsuite/
* gdb.cp/namespace.exp (whatis C::cOtherFileType)
(whatis ::C::cOtherFileType, whatis C::cOtherFileVar)
(whatis ::C::cOtherFileVar, print C::cOtherFileVar)
(print ::C::cOtherFileVar)
(whatis C::OtherFileClass::cOtherFileClassType)
(whatis ::C::OtherFileClass::cOtherFileClassType)
(print C::OtherFileClass::cOtherFileClassVar)
(print ::cOtherFileClassVar)
(print ::C::OtherFileClass::cOtherFileClassVar): New tests.
(ptype OtherFileClass, ptype ::C::OtherFileClass): Permit arbitrary
trailing content.
* gdb.cp/namespace1.cc (C::OtherFileClass::cOtherFileClassType)
(C::OtherFileClass::cOtherFileClassVar)
(C::OtherFileClass::cOtherFileClassVar_use, C::cOtherFileType)
(C::cOtherFileVar, C::cOtherFileVar_use): New.
2010-06-07 Sami Wagiaalla <swagiaal@redhat.com>
* value.h: Created oload_search_type enum.
(find_overload_match): Use oload_search_type enum.
* valops.c (find_overload_match): Support combined member and
non-member search.
* eval.c (evaluate_subexp_standard): Calls to
find_overload_match now use oload_search_type enum.
(oload_method_static): Verify index is a proper value.
* valarith.c (value_user_defined_cpp_op): Search for and handle
both member and non-member operators.
(value_user_defined_cpp_op): New function.
(value_user_defined_op): New function.
(value_x_unop): Use value_user_defined_op.
(value_x_binop): Ditto.
* cp-support.c (make_symbol_overload_list_using): Added block
iteration.
Add check for namespace aliases and imported declarations.
2010-06-07 Sami Wagiaalla <swagiaal@redhat.com>
* gdb.cp/koenig.exp: Test for ADL operators.
* gdb.cp/koenig.cc: Added ADL operators.
* gdb.cp/operator.exp: New test.
* gdb.cp/operator.cc: New test.
2010-06-02 Sami Wagiaalla <swagiaal@redhat.com>
* cp-support.c (make_symbol_overload_list_adl_namespace): Handle
anonymous type case.
2010-06-02 Sami Wagiaalla <swagiaal@redhat.com>
* gdb.cp/koenig.exp: Added new test case.
* gdb.cp/koenig.cc: Ditto.
2010-05-17 Joel Brobecker <brobecker@adacore.com>
* gdb.base/gdb11530.exp: Delete setting of prms_id and bug_id.
* gdb.cp/koenig.exp: Likewise.
Tested on x86_64-linux.
2010-05-07 Sami Wagiaalla <swagiaal@redhat.com>
PR C++/7943:
* valops.c (find_overload_match): Handle fsym == NULL case.
Add int no_adl argument.
(find_oload_champ_namespace_loop): Call make_symbol_overload_list_adl
when appropriate.
Add int no_adl argument.
(find_oload_champ_namespace): Add int no_adl argument.
* parse.c (operator_length_standard): Return length for OP_ADL_FUNC
expression.
* expprint.c (op_name_standard): Added string for OP_ADL_FUNC case.
* eval.c (evaluate_subexp_standard): Added OP_ADL_FUNC case.
Evaluate arguments and use them to perform ADL lookup.
Pass no_adl argument to find_overload_match.
Disable adl lookup when evaluating a fully qualified OP_FUNCALL.
* cp-support.h: Added prototype for
make_symbol_overload_list_namespace.
* cp-support.c (make_symbol_overload_list_namespace): New function.
(make_symbol_overload_list_adl_namespace): New function.
(make_symbol_overload_list_adl): New function.
(make_symbol_overload_list_using): Moved code to add function to
overload set to make_symbol_overload_list_namespace.
* c-exp.y: create UNKNOWN_CPP_NAME token.
Add parse rule for ADL functions.
(classify_name): Recognize an UNKNOWN_CPP_NAME.
2010-05-07 Sami Wagiaalla <swagiaal@redhat.com>
* gdb.cp/koenig.exp: New test.
* gdb.cp/koenig.cc: New test program.
* printcmd.c (x_command): Only dereference once implicitly for
TYPE_CODE_REF.
testsuite dir:
PR exp/11349.
* testsuite/gdb.cp/ref-types.exp: Add test to examine
use a reference local variable.
* cp-valprint.c (cp_print_value_fields): Replaced obstack_base()
method of popping recursion-detection stack with a method based on
obstack_object_size().
* gdb.cp/Makefile.in (EXECUTABLES): Added pr9167.
* gdb.cp/pr9167.cc: New file.
* gdb.cp/pr9167.exp: New file.
* dwarf2read.c (dwarf2_name): Work around GCC bugzilla debug/41828 by
ignoring spurious DW_AT_name attributes for unnamed structs or unions.
* completer.c (add_struct_fields): Fix inverted logic.
testsuite/ChangeLog:
* gdb.cp/inherit.exp (test_ptype_si): XFAIL test for GCC versions
that do not provide the tagless_struct type name at all.
(test_print_anon_union): Do not check value of uninitialized
union member. Do not use cp_test_ptype_class, so we can accept
"long" as well as "long int".
PR breakpoints/9352:
* NEWS: Mention changes to `commands' and `rbreak'.
* symtab.c (do_end_rbreak_breakpoints): New function.
(rbreak_command): Call start_rbreak_breakpoints; arrange to call
end_rbreak_breakpoints.
* breakpoint.c (breakpoint_count, tracepoint_count): Now static.
(set_breakpoint_count): Likewise. Clear last_was_multi.
(multi_start, multi_end, last_was_multi): New globals.
(start_rbreak_breakpoints, end_rbreak_breakpoints): New
functions.
(struct commands_info): New
(do_map_commands_command): New function.
(commands_command_1): New function.
(commands_command): Use it.
(commands_from_control_command): Likewise.
(do_delete_breakpoint): New function.
(delete_command): Use it.
(map_breakpoint_numbers): Add 'data' argument. Pass to callback.
(do_map_disable_breakpoint): New function.
(disable_command): Use it.
(do_map_enable_breakpoint): New function.
(enable_command): Use it.
(enable_once_breakpoint): Add argument.
(enable_once_command): Update.
(enable_delete_breakpoint): Add argument.
(enable_delete_command): Update.
(break_command_really): Set last_was_multi when needed.
(check_tracepoint_command): Fix formatting.
(validate_commands_for_breakpoint): New function.
(breakpoint_set_commands): Use it.
(tracepoint_save_command): Update.
* breakpoint.h (start_rbreak_breakpoints, end_rbreak_breakpoints):
Declare.
gdb/doc
PR breakpoints/9352:
* gdb.texinfo (Break Commands): Update.
gdb/testsuite
PR breakpoints/9352:
* gdb.base/default.exp: Update.
* gdb.base/commands.exp: Update.
* gdb.cp/extern-c.exp: Test setting commands on multiple
breakpoints at once.
PR c++/7936:
* cp-support.h: Added char *declaration element to using_direct
data struct.
(cp_add_using): Added char *declaration argument.
(cp_add_using_directive): Ditto.
(cp_lookup_symbol_imports): made extern.
* cp-namespace.c: Updated with the above changes.
* dwarf2read.c (read_import_statement): Ditto.
(read_namespace): Ditto.
(read_import_statement): Support import declarations.
* cp-namespace.c (cp_lookup_symbol_imports): Check for imported
declarations.
Added support for 'declaration_only' search.
(cp_lookup_symbol_namespace): Attempt to search for the name as
is before consideration of imports.
* symtab.c (lookup_symbol_aux_local): Added a 'declaration_only'
search at every block level search.
Now takes language argument.
(lookup_symbol_aux): Updated.
2010-03-15 Sami Wagiaalla <swagiaal@redhat.com>
* gdb.cp/shadow.exp: Removed kfail; test has been fix.
* gdb.cp/nsusing.exp: Ditto.
PR c++/9708:
* dwarf2read.c (die_needs_namespace) <DW_TAG_variable>: A variable
in a lexical block does not need a namespace.
(new_symbol) <DW_TAG_variable>: Put extern variables on
list_in_scope in all cases.
gdb/testsuite
PR c++/9708:
* gdb.cp/m-static.exp: Add regression test.
* gdb.cp/m-static.cc (method): New method.
(main): Call it.
* lib/gdb.exp (skip_stl_tests): New.
(gdb_compile): Symbian needs -ldl.
(shlib_target_file): New.
(shlib_symbol_file): New.
(gdb_load_shlibs): Use shlib_target_file.
* lib/mi-support.exp (mi_load_shlibs): Use shlib_target_file.
* gdb.cp/exception.exp: Use skip_stl_tests.
* gdb.cp/bs15503.exp: Use skip_stl_tests. Use untested.
* gdb.cp/try_catch.exp: Use skip_stl_tests.
* gdb.cp/mb-templates.exp: Ditto.
* gdb.base/commands.exp: Relax regexes.
* gdb.base/watchpoint-solib.exp: Don't skip on symbian. Use
shlib_target_file and shlib_symbol_file.
* gdb.base/maint.exp: Allow lowercase t. Allow .rodata in
sections.
* gdb.base/ending-run.exp: Accept E32Main for symbian.
* gdb.base/solib-disc.exp: Use
shlib_target_file and shlib_symbol_file.
* gdb.base/unload.exp: Don't skip on symbian. Use
shlib_target_file and shlib_symbol_file.
* gdb.base/list.exp: Check use_gdb_stub instead of is_remote.
* gdb.cp/cplusfuncs.cc (dm_type_short): New function.
(dm_type_long): New function.
(dm_type_unsigned_short): New function.
(dm_type_unsigned_long): New function.
(myint): New typedef.
* gdb.cp/cplusfuncs.exp (probe_demangler): Add tests for short,
long, unsigned shor and long, operator char*, and typedef.
(test_lookup_operator_functions): Add operator char* test.
(test_paddr_operator_functions): Likewise.
(test_paddr_overloaded_functions): Use probe values for
short, long, and unsigned short and long.
(test_paddr_hairy_functions): If the demangler probe detected
gdb type printers, "expect" them. Otherwise "expect" the v2 or v3
demangler.
* gdb.cp/expand-sals.exp: Backtrace may contain class names.
* gdb.cp/member-ptr.exp: Refine expected result for "print pmf"
and "print null_pmf".
Add test "ptype a.*pmf".
* gdb.cp/overload.exp: Allow optional "int" to appear with
"short" and "long".
* gdb.cp/ovldbreak.exp: Use append to construct super-duper
long expect value for men_overload1arg.
Allow "int" to appear with "short" and "long".
When testing "info break", add argument for main (void).
Also allow "int" to appear with "short" and "long".
Ditto with "unsigned" and "long long".
* gdb.java/jmain.exp: Do not enclose methods names in single
quotes.
* gdb.java/jmisc.exp: Likewise.
* gdb.java/jprint.exp: Likewise.
* gdb.python/py-symbol.exp: Update expected "linkage_name" value.
From Jan Kratochvil <jan.kratochvil@redhat.com>:
* gdb.cp/exception.exp (backtrace after first throw)
(backtrace after second throw): Allow a namespace before __cxa_throw.
(backtrace after first catch, backtrace after second catch): Allow
a namespace before __cxa_begin_catch.
* gdb.cp/cpexprs.exp: New file.
* gdb.cp/cpexprs.cc: New file.
From Daniel Jacobowitz <dan@codesourcery.com>
* gdb.cp/cpexprs.exp (escape): Delete. Change all callers
to use string_to_regexp.
(ctor, dtor): New functions. Use them to match constructor
and destructor function types.
(Top level): Use runto_main.
* linespec.c (decode_line_1): Handle FILE:FUNCTION even if
FUNCTION contains parentheses. Improve removal of a trailing
single quote.
gdb/testsuite/
* gdb.base/list.exp (test_list_filename_and_function): Add test
with single quotes.
* gdb.cp/overload.cc (intToChar): Rewrite onto one line for easy
matching.
* gdb.cp/overload.exp: Add tests with filename, function, and quotes.
Add KFAIL'd tests for PR gdb/11289.
* valarith.c (value_ptrdiff): Added a test for a zero type length,
warn if found, and assume length = 1.
* gdb.cp/pr10728-x.h: New file.
* gdb.cp/pr10728-x.cc: New file.
* gdb.cp/pr10728-y.cc: New file.
* gdb.cp/pr10728.exp: New file.
* gdb.cp/Makefile.in (EXECUTABLES): Add pr10728
* cp-valprint.c (cp_print_value_fields) Fix use of obstacks.
cp_print_static_field) Fix use of obstacks.
* gdb.cp/pr9067.exp: New
* gdb.cp/pr9067.cc: New
* gdb.cp/Makefile.in (EXECUTABLES): Add pr9067
PR c++/7935:
* gdb.cp/namespace-using.exp: Removed kfail; bug has been fixed.
2010-02-05 Sami Wagiaalla <swagiaal@redhat.com>
PR c++/7935:
* cp-support.h: Added char* alias element to using_direct data
struct.
(cp_add_using): Added char* alias argument.
(cp_add_using_directive): Ditto.
* cp-namespace.c: Updated with the above changes.
(cp_lookup_symbol_imports): Check for aliases.
* dwarf2read.c (read_import_statement): Figure out local alias
for the import and pass it on to cp_add_using.
(read_namespace): Pass alias argument to cp_add_using.
* valops.c (search_struct_field): Account for
value_embedded_offset. Fix check for virtual base past the end of
the object. Use value_copy when making a slice of the value.
gdb/testsuite
* gdb.cp/virtbase.exp: Make test case names unique.