Commit Graph

4441 Commits

Author SHA1 Message Date
Jan Kratochvil 61638e15c5 gdb/testsuite/
PR testsuite/12649
	* gdb.trace/ftrace.exp (test_fast_tracepoints): Import gdb_prompt.
	Protect gdb_test_multiple by final $gdb_prompt match.
2011-12-10 23:05:08 +00:00
Jan Kratochvil 0a00efc364 gdb/testsuite/
* gdb.cp/static-method.exp (have_gcc_45682_fixed, info addr A::func()):
	New variable, new test.
	(list static-method.cc:xxx::(anonymous namespace)::A::func)
	(list 'static-method.cc:xxx::(anonymous namespace)::A::func')
	(list 'static-method.cc':'xxx::(anonymous namespace)::A::func')
	(list static-method.cc:'xxx::(anonymous namespace)::A::func'): KFAIL
	them if HAVE_GCC_45682_FIXED is not set.
2011-12-10 15:58:14 +00:00
Yao Qi 4511b1ba87 2011-12-10 Hui Zhu <teawater@gmail.com>
Yao Qi  <yao@codesourcery.com>

	* tracepoint.c (start_tracing): Clear `inserted' flag.

2011-12-10  Yao Qi  <yao@codesourcery.com>

	* gdb.trace/status-stop.exp: New.
	* gdb.trace/status-stop.c: New.
2011-12-10 15:16:35 +00:00
Jan Kratochvil 27949e7316 gdb/testsuite/
* gdb.reverse/until-precsave.exp (run to end of main) Extend the
	timeout.
2011-12-09 17:36:02 +00:00
Tom Tromey d8ea793193 * gdb.cp/ovsrch.exp (test_class): Correctly use "a_param" in
condition.
2011-12-08 15:31:20 +00:00
Maciej W. Rozycki c7195df2f5 Fix ChangeLog typo. 2011-12-07 21:45:12 +00:00
Stan Shebs 1cc310d2dd * gdb.trace/tfind.exp: Update for output changes. 2011-12-07 21:24:05 +00:00
Pedro Alves d482a87555 2011-12-07 Pedro Alves <pedro@codesourcery.com>
* gdb.ada/catch_ex.exp: Skip as unsupported if "catch exception"
	throws "Cannot insert catchpoints in this configuration".
	* gdb.ada/mi_catch_ex.exp: Likewise.
2011-12-07 15:00:34 +00:00
Pedro Alves f0ba3972e9 2011-12-06 Pedro Alves <pedro@codesourcery.com>
gdb/
	* breakpoint.c (breakpoint_restore_shadows): Rename to ...
	(breakpoint_xfer_memory): ... this.  Change prototype.  Handle
	memory writes too.
	* breakpoint.h (breakpoint_restore_shadows): Delete.
	(breakpoint_xfer_memory): Declare.
	* mem-break.c (default_memory_insert_breakpoint)
	(default_memory_remove_breakpoint): Use target_write_raw_memory.
	(memory_xfer_partial): Rename to ...
	(memory_xfer_partial_1): ... this.  Don't mask out breakpoints
	here.
	(memory_xfer_partial): New.
	(target_write_raw_memory): New.
	* target.h (target_write_raw_memory): New.

	gdb/testsuite/
	* gdb.base/break-always.exp: Test changing memory at addresses
	with breakpoints inserted.
2011-12-06 20:03:14 +00:00
Tom Tromey f8eba3c616 the "ambiguous linespec" series
gdb
2011-12-06  Joel Brobecker  <brobecker@acacore.com>

        * language.h (struct language_defn): Add new component
        la_symbol_name_compare.
        * symfile.h (struct quick_symbol_functions): Update the profile
        of parameter "name_matcher" for the expand_symtabs_matching
        method.  Update the documentation accordingly.
        * ada-lang.h (ada_name_for_lookup): Add declaration.
        * ada-lang.c (ada_name_for_lookup): New function, extracted out
        from ada_iterate_over_symbols.
        (ada_iterate_over_symbols): Do not encode symbol name anymore.
        (ada_expand_partial_symbol_name): Adjust profile.
        (ada_language_defn): Add value for la_symbol_name_compare field.
        * linespec.c: #include "ada-lang.h".
        (iterate_name_matcher): Add language parameter. Replace call
        to strcmp_iw by call to language->la_symbol_name_compare.
        (decode_variable): Encode COPY if current language is Ada.
        * dwarf2read.c (dw2_expand_symtabs_matching): Adjust profile
        of name_matcher parameter.  Adjust call to name_matcher.
        * psymtab.c (expand_symtabs_matching_via_partial): Likewise.
        (expand_partial_symbol_names): Update profile of parameter "fun".
        * psymtab.h (expand_partial_symbol_names): Update profile of
        parameter "fun".
        * symtab.c (demangle_for_lookup): Update function documentation.
        (search_symbols_name_matches): Add language parameter.
        (expand_partial_symbol_name): Likewise.
        * c-lang.c (c_language_defn, cplus_language_defn)
        (asm_language_defn, minimal_language_defn): Add value for
        la_symbol_name_compare field.
        * d-lang.c (d_language_defn): Likewise.
        * f-lang.c (f_language_defn): Ditto.
        * jv-lang.c (java_language_defn): Ditto.
        * m2-lang.c (m2_language_defn): Ditto.
        * objc-lang.c (objc_language_defn): Ditto.
        * opencl-lang.c (opencl_language_defn): Ditto.
        * p-lang.c (pascal_language_defn): Ditto.
        * language.c (unknown_language_defn, auto_language_defn)
        (local_language_defn): Ditto.

2011-12-06  Tom Tromey  <tromey@redhat.com>

	* linespec.c (iterate_over_all_matching_symtabs): Use
	LA_ITERATE_OVER_SYMBOLS.
	(lookup_prefix_sym, add_matching_symbols_to_info): Likewise.
	(find_function_symbols, decode_variable): Remove Ada special
	case.
	* language.h (struct language_defn) <la_iterate_over_symbols>: New
	field.
	(LA_ITERATE_OVER_SYMBOLS): New macro.
	* language.c (unknown_language_defn, auto_language_defn)
	(local_language_defn): Update.
	* c-lang.c (c_language_defn, cplus_language_defn)
	(asm_language_defn, minimal_language_defn): Update.
	* d-lang.c (d_language_defn): Update.
	* f-lang.c (f_language_defn): Update.
	* jv-lang.c (java_language_defn): Update.
	* m2-lang.c (m2_language_defn): Update.
	* objc-lang.c (objc_language_defn): Update.
	* opencl-lang.c (opencl_language_defn): Update.
	* p-lang.c (pascal_language_defn): Update.
	* ada-lang.c (ada_iterate_over_symbols): New function.
	(ada_language_defn): Update.

2011-12-06  Tom Tromey  <tromey@redhat.com>
	    Joel Brobecker  <brobecker@acacore.com>

	PR breakpoints/13105, PR objc/8341, PR objc/8343, PR objc/8366,
	PR objc/8535, PR breakpoints/11657, PR breakpoints/11970,
	PR breakpoints/12023, PR breakpoints/12334, PR breakpoints/12856,
	PR shlibs/8929, PR shlibs/7393:
	* python/py-type.c (compare_maybe_null_strings): Rename from
	compare_strings.
	(check_types_equal): Update.
	* utils.c (compare_strings): New function.
	* tui/tui-winsource.c (tui_update_breakpoint_info): Update for
	location changes.
	* tracepoint.c (scope_info): Update.
	(trace_find_line_command): Use DECODE_LINE_FUNFIRSTLINE.
	* symtab.h (iterate_over_minimal_symbols)
	(iterate_over_some_symtabs, iterate_over_symtabs)
	(find_pcs_for_symtab_line, iterate_over_symbols)
	(demangle_for_lookup): Declare.
	(expand_line_sal): Remove.
	* symtab.c (iterate_over_some_symtabs, iterate_over_symtabs)
	(lookup_symtab_callback): New functions.
	(lookup_symtab): Rewrite.
	(demangle_for_lookup): New function, extract from
	lookup_symbol_in_language.
	(lookup_symbol_in_language): Use it.
	(iterate_over_symbols): New function.
	(find_line_symtab): Update.
	(find_pcs_for_symtab_line): New functions.
	(find_line_common): Add 'start' argument.
	(decode_line_spec): Update.  Change argument to 'flags', change
	interpretation.
	(append_expanded_sal): Remove.
	(append_exact_match_to_sals): Remove.
	(expand_line_sal): Remove.
	* symfile.h (struct quick_symbol_functions) <lookup_symtab>:
	Remove.
	<map_symtabs_matching_filename>: New field.
	* stack.c (func_command): Only look in the current program space.
	Use DECODE_LINE_FUNFIRSTLINE.
	* source.c (line_info): Set pspace on sal.  Check program space in
	the loop.  Use DECODE_LINE_LIST_MODE.
	(select_source_symtab): Use DECODE_LINE_FUNFIRSTLINE.
	* solib-target.c: Remove DEF_VEC_I(CORE_ADDR).
	* python/python.c (gdbpy_decode_line): Update.
	* psymtab.c (partial_map_expand_apply): New function.
	(partial_map_symtabs_matching_filename): Rename from
	lookup_partial_symbol.  Update arguments.
	(lookup_symtab_via_partial_symtab): Remove.
	(psym_functions): Update.
	* objc-lang.h (parse_selector, parse_method): Don't declare.
	(find_imps): Update.
	* objc-lang.c (parse_selector, parse_method): Now static.
	(find_methods): Change arguments.  Fill in a vector of symbol
	names.
	(uniquify_strings): New function.
	(find_imps): Change arguments.
	* minsyms.c (iterate_over_minimal_symbols): New function.
	* linespec.h (enum decode_line_flags): New.
	(struct linespec_sals): New.
	(struct linespec_result) <canonical>: Remove.
	<pre_expanded, addr_string, sals>: New fields.
	(destroy_linespec_result, make_cleanup_destroy_linespec_result)
	(decode_line_full): Declare.
	(decode_line_1): Update.
	* linespec.c (struct address_entry, struct linespec_state, struct
	collect_info): New types.
	(add_sal_to_sals_basic, add_sal_to_sals, hash_address_entry)
	(eq_address_entry, maybe_add_address): New functions.
	(total_number_of_methods): Remove.
	(iterate_name_matcher, iterate_over_all_matching_symtabs): New
	functions.
	(find_methods): Change arguments.  Don't canonicalize input.
	Simplify logic.
	(add_matching_methods, add_constructors)
	(build_canonical_line_spec): Remove.
	(filter_results, convert_results_to_lsals): New functions.
	(decode_line_2): Change arguments.  Rewrite for new data
	structures.
	(decode_line_internal): Rename from decode_line_1.  Change
	arguments.  Add cleanups.  Update for new data structures.
	(linespec_state_constructor, linespec_state_destructor)
	(decode_line_full, decode_line_1): New functions.
	(decode_indirect): Change arguments.  Update.
	(locate_first_half): Use skip_spaces.
	(decode_objc): Change arguments.  Update for new data structures.
	Simplify logic.
	(decode_compound): Change arguments.  Add cleanups.  Remove
	fallback code, replace with error.
	(struct decode_compound_collector): New type.
	(collect_one_symbol): New function.
	(lookup_prefix_sym): Change arguments.  Update.
	(compare_symbol_name, add_all_symbol_names_from_pspace)
	(find_superclass_methods ): New functions.
	(find_method): Rewrite.
	(struct symtab_collector): New type.
	(add_symtabs_to_list, collect_symtabs_from_filename): New
	functions.
	(symtabs_from_filename): Change API.  Rename from
	symtab_from_filename.
	(collect_function_symbols): New function.
	(find_function_symbols): Change API.  Rename from
	find_function_symbol.  Rewrite.
	(decode_all_digits): Change arguments.  Rewrite.
	(decode_dollar): Change arguments.  Use decode_variable.
	(decode_label): Change arguments.  Rewrite.
	(collect_symbols): New function.
	(minsym_found): Change arguments.  Rewrite.
	(check_minsym, search_minsyms_for_name)
	(add_matching_symbols_to_info): New function.
	(decode_variable): Change arguments.  Iterate over all symbols.
	(symbol_found): Remove.
	(symbol_to_sal): New function.
	(init_linespec_result, destroy_linespec_result)
	(cleanup_linespec_result, make_cleanup_destroy_linespec_result):
	New functions.
	(decode_digits_list_mode, decode_digits_ordinary): New functions.
	* dwarf2read.c (dw2_map_expand_apply): New function.
	(dw2_map_symtabs_matching_filename): Rename from
	dw2_lookup_symtab.  Change arguments.
	(dwarf2_gdb_index_functions): Update.
	* dwarf2loc.c: Remove DEF_VEC_I(CORE_ADDR).
	* defs.h (compare_strings): Declare.
	* cli/cli-cmds.c (compare_strings): Move to utils.c.
	(edit_command, list_command): Use DECODE_LINE_LIST_MODE.  Call
	filter_sals.
	(compare_symtabs, filter_sals): New functions.
	* breakpoint.h (struct bp_location) <line_number, source_file>:
	New fields.
	(struct breakpoint) <line_number, source_file>: Remove.
	<filter>: New field.
	* breakpoint.c (print_breakpoint_location, init_raw_breakpoint)
	(momentary_breakpoint_from_master, add_location_to_breakpoint):
	Update for changes to locations.
	(init_breakpoint_sal): Add 'filter' argument.  Set 'filter' on
	breakpoint.
	(create_breakpoint_sal): Add 'filter' argument.
	(remove_sal, expand_line_sal_maybe): Remove.
	(create_breakpoints_sal): Remove 'sals' argument.  Handle
	pre-expanded sals and the filter.
	(parse_breakpoint_sals): Use decode_line_full.
	(check_fast_tracepoint_sals): Use get_sal_arch.
	(create_breakpoint): Create a linespec_sals.  Update.
	(break_range_command): Use decode_line_full.  Update.
	(until_break_command): Update.
	(clear_command): Update match conditions for linespec.c changes.
	Use DECODE_LINE_LIST_MODE.
	(say_where): Update for changes to locations.
	(bp_location_dtor): Free 'source_file'.
	(base_breakpoint_dtor): Free 'filter'.  Don't free 'source_file'.
	(update_static_tracepoint): Update for changes to locations.
	(update_breakpoint_locations): Disable ranged breakpoint if too
	many locations match.  Update.
	(addr_string_to_sals): Use decode_line_full.  Resolve all sal
	PCs.
	(breakpoint_re_set_default): Don't call expand_line_sal_maybe.
	(decode_line_spec_1): Update.  Change argument name to 'flags',
	change interpretation.
	* block.h (block_containing_function): Declare.
	* block.c (block_containing_function): New function.
	* skip.c (skip_function_command): Update.
	(skip_re_set): Update.
	* infcmd.c (jump_command): Use DECODE_LINE_FUNFIRSTLINE.
	* mi/mi-main.c (mi_cmd_trace_find): Use DECODE_LINE_FUNFIRSTLINE.
	* NEWS: Add entry.

2011-12-06  Tom Tromey  <tromey@redhat.com>

	* elfread.c (elf_gnu_ifunc_resolver_return_stop): Allow
	breakpoint's pspace to be NULL.
	* breakpoint.h (struct breakpoint) <pspace>: Update comment.
	* breakpoint.c (init_raw_breakpoint): Conditionally set
	breakpoint's pspace.
	(init_breakpoint_sal): Don't set breakpoint's pspace.
	(prepare_re_set_context): Conditionally switch program space.
	(addr_string_to_sals): Check executing_startup on location's
	program space.

2011-12-06  Tom Tromey  <tromey@redhat.com>

	* breakpoint.h (enum enable_state) <bp_startup_disabled>: Remove.
	* breakpoint.c (should_be_inserted): Explicitly check if program
	space is executing startup.
	(describe_other_breakpoints): Update.
	(disable_breakpoints_before_startup): Change executing_startup
	earlier.  Remove loop.
	(enable_breakpoints_after_startup): Likewise.
	(init_breakpoint_sal): Don't use bp_startup_disabled.
	(create_breakpoint): Don't use bp_startup_disabled.
	(update_global_location_list): Use should_be_inserted.
	(bkpt_re_set): Update.
gdb/testsuite
2011-12-06  Joel Brobecker  <brobecker@acacore.com>

        * gdb.ada/fullname_bp.exp: Add tests for other valid linespecs
        involving a fully qualified function name.

2011-12-06  Tom Tromey  <tromey@redhat.com>

	* gdb.ada/homonym.exp: Add three breakpoint tests.

2011-12-06  Tom Tromey  <tromey@redhat.com>

	* gdb.base/solib-weak.exp (do_test): Remove kfail.
	* gdb.trace/tracecmd.exp: Disable pending breakpoints earlier.
	* gdb.objc/objcdecode.exp: Update for output changes.
	* gdb.linespec/linespec.exp: New file.
	* gdb.linespec/lspec.cc: New file.
	* gdb.linespec/lspec.h: New file.
	* gdb.linespec/body.h: New file.
	* gdb.linespec/base/two/thefile.cc: New file.
	* gdb.linespec/base/one/thefile.cc: New file.
	* gdb.linespec/Makefile.in: New file.
	* gdb.cp/templates.exp (test_template_breakpoints): Update for
	output changes.
	* gdb.cp/re-set-overloaded.exp: Remove kfail.
	* gdb.cp/ovldbreak.exp: Update for output changes.  "all" test now
	makes one breakpoint.
	* gdb.cp/method2.exp (test_break): Update for output changes.
	* gdb.cp/mb-templates.exp: Update for output changes.
	* gdb.cp/mb-inline.exp: Update for output changes.
	* gdb.cp/mb-ctor.exp: Update for output changes.
	* gdb.cp/ovsrch.exp: Use fully-qualified names.
	* gdb.base/solib-symbol.exp: Run to main later.  Breakpoint now
	has multiple matches.
	* gdb.base/sepdebug.exp: Disable pending breakpoints.  Update for
	error message change.
	* gdb.base/list.exp (test_list_filename_and_number): Update for
	error message change.
	* gdb.base/break.exp: Disable pending breakpoints.  Update for
	output changes.
	* configure.ac: Add gdb.linespec.
	* configure: Rebuild.
	* Makefile.in (ALL_SUBDIRS): Add gdb.linespec.
gdb/doc
2011-12-06  Tom Tromey  <tromey@redhat.com>

	* gdb.texinfo (Set Breaks): Update for new behavior.
2011-12-06 18:54:43 +00:00
Ulrich Weigand c642a43456 ChangeLog:
* s390-tdep.h (S390_ORIG_R2_REGNUM): Define.
	(S390_LAST_BREAK_REGNUM): Likewise.
	(S390_SYSTEM_CALL_REGNUM): Likewise.
	(S390_NUM_REGS): Update.

	(s390_regmap_last_break): Add declaration.
	(s390x_regmap_last_break): Likewise.
	(s390_regmap_system_call): Likewise.

	(tdesc_s390_linux32v1): Add declaration.
	(tdesc_s390_linux32v2): Likewise.
	(tdesc_s390_linux64v1): Likewise.
	(tdesc_s390_linux64v2): Likewise.
	(tdesc_s390x_linux64v1): Likewise.
	(tdesc_s390x_linux64v2): Likewise.

	* s390-tdep.c: Include new target description files
	"features/s390-linux32v1.c", "features/s390-linux32v2.c",
	"features/s390-linux64v1.c", "features/s390-linux64v2.c",
	"features/s390x-linux64v1.c", and "features/s390x-linux64v2.c".
	(s390_cannot_store_register): New function.
	(s390_write_pc): Likewise.
	(s390_dwarf_regmap): Add fields for new registers.
	(s390_regmap_gregset): Likewise.
	(s390x_regmap_gregset): Likewise.
	(s390_regmap_fpregset): Likewise.
	(s390_regmap_upper): Likewise.
	(s390_regmap_last_break): New variable.
	(s390x_regmap_last_break): Likewise.
	(s390_regmap_system_call): Likewise.
	(s390_last_break_regset): Likewise.
	(s390x_last_break_regset): Likewise.
	(s390_system_call_regset): Likewise.
	(s390_upper_regset_sections): Rename to ...
	(s390_linux64_regset_sections): ... this.
	(s390_linux32_regset_sections): New variable.
	(s390x_linux64_regset_sections): Likewise.
	(s390_linux32v1_regset_sections): Likewise.
	(s390_linux32v2_regset_sections): Likewise.
	(s390_linux64v1_regset_sections): Likewise.
	(s390_linux64v2_regset_sections): Likewise.
	(s390x_linux64v1_regset_sections): Likewise.
	(s390x_linux64v2_regset_sections): Likewise.
	(s390_regset_from_core_section): Handle .reg-s390-last-break and
	.reg-s390-system-call core file sections.
	(s390_core_read_description): Check for presence of
	.reg-s390-last-break and .reg-s390-system-call core file
	sections and return appropriate target description.
	(s390_gdbarch_init): Detect Linux-specific registers "orig_r2",
	"last_break" and "system_call" in target description.  Install
	appropriate gdbarch_core_regset_sections array.
	Call set_gdbarch_cannot_store_register and set_gdbarch_write_pc.
	(_initialize_s390_tdep): Initialize additional target descriptions.

	* s390-nat.c: Include "elf/common.h".
	(PTRACE_GETREGSET, PTRACE_SETREGSET): Define if undefined.
	(have_regset_last_break): New static variable.
	(have_regset_system_call): Likewise.
	(s390_native_supply): Handle S390_ORIG_R2_REGNUM.
	(s390_native_collect): Likewise.
	(fetch_regset, store_regset, check_regset): New functions.
	(s390_linux_fetch_inferior_registers): Handle S390_LAST_BREAK_REGNUM
	and S390_SYSTEM_CALL_REGNUM.
	(s390_linux_store_inferior_registers): Likewise.
	(s390_read_description): Check for presence of NT_S390_LAST_BREAK
	and NT_S390_SYSTEM_CALL regsets and use appropriate description.

	* features/Makefile (WHICH): Add s390-linux32v1, s390-linux64v1,
	s390x-linux64v1, s390-linux32v2, s390-linux64v2, and s390x-linux64v2.
	(s390-linux32v1-expedite): Define.
	(s390-linux32v2-expedite): Likewise.
	(s390-linux64v1-expedite): Likewise.
	(s390-linux64v2-expedite): Likewise.
	(s390x-linux64v1-expedite): Likewise.
	(s390x-linux64v2-expedite): Likewise.

	* features/s390-linux32.xml: Add orig_r2 register.
	* features/s390-linux64.xml: Likewise.
	* features/s390x-linux64.xml: Likewise.
	* features/s390-linux32v1.xml: New file.
	* features/s390-linux32v2.xml: Likewise.
	* features/s390-linux64v1.xml: Likewise.
	* features/s390-linux64v2.xml: Likewise.
	* features/s390x-linux64v1.xml: Likewise.
	* features/s390x-linux64v2.xml: Likewise.

	* features/s390-linux32.c: Regenerate.
	* features/s390-linux64.c: Likewise.
	* features/s390x-linux64.c: Likewise.
	* features/s390-linux32v1.c: New generated file.
	* features/s390-linux32v2.c: Likewise.
	* features/s390-linux64v1.c: Likewise.
	* features/s390-linux64v2.c: Likewise.
	* features/s390x-linux64v1.c: Likewise.
	* features/s390x-linux64v2.c: Likewise.

	* regformats/s390-linux32.dat: Regenerate.
	* regformats/s390-linux64.dat: Regenerate.
	* regformats/s390x-linux64.dat: Regenerate.
	* regformats/s390-linux32v1.dat: New generated file.
	* regformats/s390-linux32v2.dat: Likewise.
	* regformats/s390-linux64v1.dat: Likewise.
	* regformats/s390-linux64v2.dat: Likewise.
	* regformats/s390x-linux64v1.dat: Likewise.
	* regformats/s390x-linux64v2.dat: Likewise.

gdbserver/ChangeLog:

	* Makefile.in (s390-linux32v1.o, s390-linux32v1.c): New rules.
	(s390-linux32v2.o, s390-linux32v2.c): Likewise.
	(s390-linux64v1.o, s390-linux64v1.c): Likewise.
	(s390-linux64v2.o, s390-linux64v2.c): Likewise.
	(s390x-linux64v1.o, s390x-linux64v1.c): Likewise.
	(s390x-linux64v2.o, s390x-linux64v2.c): Likewise.
	* configure.srv [s390*-*-linux*] (srv_regobj): Add new objects.
	(srv_xmlfiles): Add new XML files.

	* linux-s390-low.c: Include "elf/common.h", <sys/ptrace.h>,
	and <sys/uio.h>.
	(PTRACE_GETREGSET, PTRACE_SETREGSET): Define if undefined.
	(init_registers_s390_linux32v1): Add prototype.
	(init_registers_s390_linux32v2): Likewise.
	(init_registers_s390_linux64v1): Likewise.
	(init_registers_s390_linux64v2): Likewise.
	(init_registers_s390x_linux64v1): Likewise.
	(init_registers_s390x_linux64v2): Likewise.
	(s390_num_regs): Increment to 52.
	(s390_regmap): Add orig_r2 register.
	(s390_num_regs_3264): Increment to 68.
	(s390_regmap_3264): Add orig_r2 register.
	(s390_collect_ptrace_register): Handle orig_r2 register.
	(s390_supply_ptrace_register): Likewise.
	(s390_fill_last_break): New function.
	(s390_store_last_break): Likewise.
	(s390_fill_system_call): New function.
	(s390_store_system_call): Likewise.
	(target_regsets): Handle NT_S390_LAST_BREAK and NT_S390_SYSTEM_CALL
	register sets.
	(s390_check_regset): New function.
	(s390_arch_setup): Check for presence of NT_S390_LAST_BREAK and
	NT_S390_SYSTEM_CALL regsets and use appropriate description.
	Update target_regsets for available register sets.

testsuite/ChangeLog:

	* gdb.base/callfuncs.exp (fetch_all_registers): Filter out read-only
	last_break register on s390*-*-* targets.
2011-12-06 14:14:50 +00:00
Joel Brobecker b18003d168 fix incorrect assumption in gdb.ada/watch_arg
The testcase is assuming that the parameter being watched isn't being
modified. But the way the test program is written, this is not true
at all.  So this changes fixes the code to still reference the variable,
but in a way that does not modify its value.

gdb/testsuite:

        * gdb.ada/watch_arg/pck.ads, gdb.ada/watch_arg/pck.adb: New files.
        * gdb.ada/watch_arg/watch.adb: Adjust code to avoid modification
        of parameter X in procedure Foo.
2011-12-06 14:00:37 +00:00
Stan Shebs fe96589c7e * gdb.trace/tfind.exp: Update help string matches. 2011-12-05 23:32:52 +00:00
Jan Kratochvil 1820ab4711 gdb/testsuite/
* gdb.server/ext-run.exp (get process list): Accept also systemd
	as PID 1.
2011-12-05 18:27:44 +00:00
Jan Kratochvil e11ac3a350 gdb/testsuite/
* gdb.base/break-entry.exp: Move the target use_gdb_stub test before
	starting GDB.
	* gdb.base/default.exp: Replace target use_gdb_stub checks by global
	$use_gdb_stub.
	* gdb.base/display.exp: Likewise.
	* gdb.base/ending-run.exp: Likewise.
	* gdb.base/list.exp (test_listsize): Likewise.
	* gdb.base/setshow.exp: Likewise.
	* gdb.base/valgrind-db-attach.exp: Set global use_gdb_stub to 1.
	* lib/gdb.exp (gdb_run_cmd, gdb_start_cmd): Replace target use_gdb_stub
	check by global $use_gdb_stub.
	(gdb_test_multiple): Forbid run, start or attach for !$use_gdb_stub.
	(default_gdb_start): Set global use_gdb_stub from target use_gdb_stub.
	(default_gdb_init): Unset global $use_gdb_stub.
	(gdb_continue_to_end, rerun_to_main): Replace target use_gdb_stub check
	by global $use_gdb_stub.
	* lib/gdbserver-support.exp: Extend comments for set_board_info
	gdb_protocol and gdb,socketport.
	(gdbserver_start_extended): Set global gdbserver_protocol and
	gdbserver_gdbport.  Clear global use_gdb_stub.
	* lib/mi-support.exp (default_mi_gdb_start): Set global use_gdb_stub
	from target use_gdb_stub.
	(mi_run_cmd): Replace target use_gdb_stub check by global $use_gdb_stub.
2011-12-03 20:20:29 +00:00
Doug Evans 1d41d75cb6 * lib/gdb.exp (gdb_run_cmd, gdb_start_cmd, run_to_main): Add comments.
(gdb_step_for_stub): Add comments.
2011-12-03 18:01:50 +00:00
Maciej W. Rozycki d6d7a51a33 * lib/gdb.exp (gdb_expect): Pass all the exception conditions up
to the caller.
	(gdb_test_multiple): Likewise.
2011-12-02 23:58:01 +00:00
Jan Kratochvil 05acf27496 gdb/testsuite/
Fix gdb.mi/mi-solib.exp without system debug info installed.
	* lib/mi-support.exp (mi_expect_stop): Accept FILE also for `from'
	expect attribute, return 0 for it.  Update comments.
2011-12-02 22:35:17 +00:00
Jan Kratochvil 2268b414f4 gdb/
* Makefile.in (XMLFILES): Add library-list-svr4.dtd.
	* features/library-list-svr4.dtd: New file.
	* remote.c (PACKET_qXfer_libraries_svr4): New.
	(remote_protocol_features): new entry for PACKET_qXfer_libraries_svr4.
	(remote_xfer_partial): Handle TARGET_OBJECT_LIBRARIES_SVR4.
	* solib-svr4.c (struct svr4_library_list): New.
	[HAVE_LIBEXPAT]: Include xml-support.h.
	[HAVE_LIBEXPAT] (svr4_library_list_start_library)
	[HAVE_LIBEXPAT] (svr4_library_list_start_list, svr4_library_attributes)
	[HAVE_LIBEXPAT] (svr4_library_list_children)
	[HAVE_LIBEXPAT] (svr4_library_list_attributes)
	[HAVE_LIBEXPAT] (svr4_library_list_elements, svr4_parse_libraries)
	[HAVE_LIBEXPAT] (svr4_current_sos_via_xfer_libraries)
	[!HAVE_LIBEXPAT] (svr4_current_sos_via_xfer_libraries): New.
	(svr4_read_so_list): Extend the corruption message by addresses.
	(svr4_current_sos): New variable library_list, call
	svr4_current_sos_via_xfer_libraries.
	* target.h (enum target_object): New TARGET_OBJECT_LIBRARIES_SVR4.

gdb/gdbserver/
	* linux-low.c (get_phdr_phnum_from_proc_auxv, get_dynamic, get_r_debug)
	(read_one_ptr, struct link_map_offsets, linux_qxfer_libraries_svr4):
	New.
	(struct linux_target_ops): Install linux_qxfer_libraries_svr4.
	* linux-low.h (struct process_info_private): New member r_debug.
	* server.c (handle_qxfer_libraries): Call
	the_target->qxfer_libraries_svr4.
	(handle_qxfer_libraries_svr4): New function.
	(qxfer_packets): New entry "libraries-svr4".
	(handle_query): Check QXFER_LIBRARIES_SVR4 and report libraries-svr4.
	* target.h (struct target_ops): New member qxfer_libraries_svr4.
	* remote.c (remote_xfer_partial): Call add_packet_config_cmd for
	PACKET_qXfer_libraries_svr4.

gdb/doc/
	* gdb.texinfo (Requirements, Remote Protocol): Reference also `Library
	List Format for SVR4 Targets'.
	(General Query Packets): New item qXfer:libraries-svr4:read.
	(Library List Format for SVR4 Targets): New node.

gdb/testsuite/
	* gdb.base/solib-corrupted.exp: Suppress test on is_remote target.
	(corrupted list): Adjust the expectation.
2011-12-02 22:26:54 +00:00
Jan Kratochvil 585861ead5 gdb/
PR threads/13448
	* dwarf2read.c (decode_locdesc): Handle DW_OP_const8u.
	For DW_OP_GNU_push_tls_address increment the value, new comment for it.

gdb/testsuite/
	PR threads/13448
	* gdb.dwarf2/dw2-var-zero-addr.S: New file.
	* gdb.dwarf2/dw2-var-zero-addr.exp: New file.
	* gdb.threads/tls-var-main.c: New file.
	* gdb.threads/tls-var.c: New file.
	* gdb.threads/tls-var.exp: New file.
2011-12-02 17:01:20 +00:00
Jan Kratochvil 968643aaa9 gdb/testsuite/
PR testsuite/12649
	* gdb.trace/collection.exp (gdb_collect_return_test): Import gdb_prompt.
	Protect gdb_test_multiple by final $gdb_prompt match.
	* gdb.trace/tspeed.exp (gdb_fast_trace_speed_test): Likewise.
	* gdb.trace/tstatus.exp (run_trace_experiment): Likewise.
	(test_tracepoints): Likewise.
2011-12-02 12:43:29 +00:00
Jan Kratochvil 9750bca92c gdb/
PR breakpoints/13346
	* dwarf2read.c (process_psymtab_comp_unit): Set
	PSYMTABS_ADDRMAP_SUPPORTED.
	* psympriv.h (struct partial_symtab): Comment textlow and texthigh
	validity.  New field psymtabs_addrmap_supported.
	* psymtab.c (find_pc_sect_psymtab_closer): New gdb_assert on
	psymtabs_addrmap_supported.
	(find_pc_sect_psymtab): Do not fallback to TEXTLOW and TEXTHIGH for
	!PSYMTABS_ADDRMAP_SUPPORTED.
	(dump_psymtab, maintenance_info_psymtabs): Print also
	psymtabs_addrmap_supported.

gdb/testsuite/
	PR breakpoints/13346
	* gdb.dwarf2/dw2-objfile-overlap-inner.S: New file.
	* gdb.dwarf2/dw2-objfile-overlap-outer.S: New file.
	* gdb.dwarf2/dw2-objfile-overlap.exp: New file.
2011-12-02 01:28:55 +00:00
Joel Brobecker ac1349b75a Make sure all types in gdb.ada/homonym testcase are used...
Otherwise, the compiler does not generate any debug info for them.
This fixes 3 FAILs:

    FAIL: gdb.ada/homonym.exp: ptype local_type_subtype at BREAK_1
    FAIL: gdb.ada/homonym.exp: ptype int_type at BREAK_1
    FAIL: gdb.ada/homonym.exp: ptype local_type_subtype at BREAK_2

gdb/testsuite/ChangeLog:

        * gdb.ada/homonym/pck.ads, gdb.ada/homonym/pck.adb: New files.
        * gdb.ada/homonym/homonym.adb: For use of all types defined
        locally inside both Get_Value subprograms.
2011-12-01 23:16:44 +00:00
Jan Kratochvil 26d44fafef gdb/testsuite/
Fix racy FAILs.
	* gdb.base/foll-exec.exp (zap_session): Use gdb_test_no_output instead
	of send_gdb.
2011-12-01 22:06:45 +00:00
Ulrich Weigand 514f64256c * gdb.base/testenv.exp: Skip on remote targets. Unset global
environment variable after test completed.
2011-11-30 08:25:17 +00:00
Ulrich Weigand 4255c8d248 * gdb.base/solib-nodir.exp: Skip if remote target.
* gdb.base/gdb.fortran.exp: Use shlib= flag when linking main
	application.  Call gdb_load_shlibs.
	* gdb.mi/mi-solib.exp: Use mi_load_shlibs instead of gdb_load_shlibs.
2011-11-30 08:24:32 +00:00
Joel Brobecker a35ad96ac8 New gdb.base/infoline.exp testcase.
gdb/testsuite/ChangeLog:

        * gdb.base/infoline.c, gdb.base/infoline.exp: New files.
2011-11-29 16:59:45 +00:00
Joel Brobecker 1a1d551388 wrong value returned by ada-lang.c:compare_names
The ada-lang.c:compare_names function returns the wrong value
when the first string starts with the same contents as the second
string, followed by '_' and then some characters that do not make
a symbol name suffix.  For instance:

    string1 = "generics__test_generics__instance__print"
    string2 = "generics__test_generics"

In that case, compare_names (string1, string2) return -1, when
clearly, string1 is greater than string2.

A consequence of this problem is that GDB may fail to lookup
"generics.test_generics" from our partial symtabs, because
partial symbols are ordered by strcmp_iw_ordered:

    (gdb) b generics.test_generics
    Function "generics.test_generics" not defined.
    Make breakpoint pending on future shared library load? (y or [n])

gdb/ChangeLog:

        * ada-lang.c (compare_names): Fix wrong return value in case
        string1 starts with the same contents as string2, followed
        by an underscore that do not start a symbol name suffix.

gdb/testsuite/ChangeLog:

        * gdb.ada/fullname_bp: New testcase.
2011-11-29 01:00:52 +00:00
Jan Kratochvil fb0aec578b gdb/testsuite/
Code cleanup.
	* gdb.reverse/i386-sse-reverse.exp (continue to end of sse4_test):
	Convert send_gdb and gdb_expect to gdb_test_multiple.
2011-11-25 23:53:45 +00:00
Jan Kratochvil 50b4ddf832 gdb/testsuite/
PR testsuite/12649
	* gdb.reverse/i386-sse-reverse.exp (continue to end of sse_test #2):
	Wrap send_gdb into a new gdb_test.
2011-11-25 23:50:15 +00:00
Jan Kratochvil 2376d946fa gdb/testsuite/
* gdb.base/jit-so.exp (one_jit_test): Add testcase name to log message.
2011-11-25 23:26:15 +00:00
Keith Seitz 1eec78bdad * lib/mi-support.exp (varobj_tree): New namespace and procs.
(mi_varobj_tree_test_children_callback): New proc.
	(mi_walk_varobj_tree): New proc.
2011-11-23 21:02:55 +00:00
Tom Tromey 36dfb11c8b gdb
PR mi/8444:
	* mi/mi-common.h (EXEC_ASYNC_SOLIB_EVENT, EXEC_ASYNC_FORK)
	(EXEC_ASYNC_VFORK, EXEC_ASYNC_SYSCALL_ENTRY)
	(EXEC_ASYNC_SYSCALL_RETURN, EXEC_ASYNC_EXEC): New constants.
	* mi/mi-common.c (async_reason_string_lookup): Add new reasons.
	* breakpoint.c (print_it_catch_fork, print_it_catch_vfork)
	(print_it_catch_syscall, print_it_catch_exec)
	(internal_bkpt_print_it): Use ui_out.  Emit stop reason.
	(bpstat_print): Add 'kind' argument.  Handle
	TARGET_WAITKIND_LOADED.
	* infrun.c (normal_stop): Update for bpstat_print change.  Don't
	handle TARGET_WAITKIND_LOADED here.
	* breakpoint.h (bpstat_print): Update.
gdb/testsuite
	* lib/mi-support.exp (mi_run_cmd_full): Rename from mi_run_cmd.
	Add "use_mi_command" argument.
	(mi_run_cmd, mi_run_with_cli): New procs.
	* gdb.mi/solib-lib.c: New file.
	* gdb.mi/solib-main.c: New file.
	* gdb.mi/mi-solib.exp: New file.
gdb/doc
	* gdb.texinfo (GDB/MI Async Records): Document new *stopped
	reasons.
2011-11-22 21:25:19 +00:00
Keith Seitz 56767571cc * gdb.mi/mi-var-display.exp: Remove XFAIL for c_variable-7.51,
-var-evaluate-expression of an enumeration and fix expected result.
	* gdb.mi/mi2-varvdisplay.exp: Likewise.
2011-11-21 21:53:50 +00:00
Doug Evans 0e965dd0b2 * gdb.cp/nextoverthrow.exp: Skip test if debug info for
_Unwind_DebugHook is missing.
2011-11-21 17:34:17 +00:00
Stan Shebs f196051f5e * NEWS: Mention tracepoint additions.
* breakpoint.h (struct tracepoint): New field traceframe_usage.
	* breakpoint.c (print_one_breakpoint_location): Identify
	tracepoints as such when reporting hit counts, report
	trace buffer usage.
	(create_tracepoint_from_upload): Copy status info.
	* tracepoint.h (struct trace_status): Rename error_desc to stop_desc,
	add fields user_name, notes, start_time, stop_time.
	(struct uploaded_tp): Add fields hit_count, traceframe_usage.
	* tracepoint.c (trace_user): New global.
	(trace_notes): New global.
	(trace_stop_notes): New global.
	(start_tracing): Add argument and trace note handling.
	(stop_tracing): Ditto.
	(trace_start_command): Add notes argument.
	(trace_stop_command): Ditto.
	(trace_status_command): Report additional status info.
	(trace_status_mi): Similarly.
	(trace_save): Update, record tracepoint status.
	(set_disconnected_tracing): Call target method directly.
	(send_disconnected_tracing_value): Remove.
	(set_trace_user): New function.
	(set_trace_notes): New function.
	(set_trace_stop_notes): New function.
	(parse_trace_status): Handle additional status.
	(parse_tracepoint_status): New function.
	(parse_tracepoint_definition): Call it.
	(tfile_get_tracepoint_status): New function.
	(init_tfile_ops): Use it.
	(_initialize_tracepoint): Add new setshows.
	* target.h (struct target_ops): New methods to_get_tracepoint_status
	and to_set_trace_notes.
	(target_get_tracepoint_status): New macro.
	(target_set_trace_notes): New macro.
	* target.c (update_current_target): Add new methods.
	* remote.c (remote_get_tracepoint_status): New function.
	(remote_set_trace_notes): New function.
	(init_remote_ops): Add them.
	* mi/mi-main.c (mi_cmd_trace_start): Add argument to call.
	(mi_cmd_trace_stop): Ditto.

	* tracepoint.c (struct tracepoint): New field traceframe_usage.
	(tracing_start_time): New global.
	(tracing_stop_time): New global.
	(tracing_user_name): New global.
	(tracing_notes): New global.
	(tracing_stop_note): New global.
	(cmd_qtstart): Set traceframe_usage, start_time.
	(stop_tracing): Set stop_time.
	(cmd_qtstatus): Report additional status.
	(cmd_qtp): New function.
	(handle_tracepoint_query): Call it.
	(cmd_qtnotes): New function.
	(handle_tracepoint_general_set): Call it.
	(get_timestamp): Rename from tsv_get_timestamp.

	* gdb.texinfo (Starting and Stopping Trace Experiments): Document
	note-related options and variables.
	(Tracepoint Packets): Document packet changes.

	* gdb.trace/tstatus.exp: New.
	* gdb.trace/actions.c: Include string.h.
2011-11-20 23:59:49 +00:00
Yao Qi bfccc43c12 gdb/
* breakpoint.c (create_breakpoint): Produce query message according to
	breakpoint's type.
	Allocate tracepoint per correct type.
	Don't check SALs for pending fast tracepoints.
	* tracepoint.c (process_tracepoint_on_disconnect): New.
	(disconnect_tracing): Call process_tracepoint_on_disconnect.

gdb/doc/
	* gdb.texinfo (Create and Delete Tracepoints): Mention pending
	tracepoint.

gdb/testsuite/
	* gdb.trace/pending.exp: New.
	* gdb.trace/pending.c: New.
	* gdb.trace/pendshr1.c: New.
	* gdb.trace/pendshr2.c: New.
	* gdb.trace/change-loc.exp (tracepoint_change_loc_1): Check one
	tracepoint location becomes pending.
	(tracepoint_change_loc_2): New.
2011-11-18 01:21:35 +00:00
David S. Miller 73cd8ab132 * lib/gdb.exp (can_single_step_to_signal_handler): Return zero when
target is sparc*-*-linux*
2011-11-16 18:16:27 +00:00
Paul Koning 7742673004 * gdb.python/py-type.exp: New testcases for exceptions on scalar types 2011-11-15 21:17:40 +00:00
Doug Evans ed59ded5eb Make "!" an alias for "shell".
* NEWS: Add mention.
	* cli/cli-cmds.c (init_cli_cmds): Remove xdb_commands condition on
	adding "!" command, always add it.
	* cli/cli-decode.c (find_command_name_length): Recognize "!" as a
	command of length one.

	doc/
	* gdb.texinfo (Shell Commands): Document "!".

	testsuite/
	* gdb.base/shell.exp: New file.
2011-11-15 05:06:35 +00:00
Stan Shebs 405f8e9499 2011-11-14 Stan Shebs <stan@codesourcery.com>
Kwok Cheung Yeung  <kcy@codesourcery.com>

	* NEWS: Document shorter fast tracepoints and qTMinFTPILen packet.
	* i386-tdep.c (i386_fast_tracepoint_valid_at): Query target for
	the minimum instruction size for fast tracepoints.
	* target.h (struct target_ops): Add new method
	to_get_min_fast_tracepoint_insn_len.
	(target_get_min_fast_tracepoint_insn_len): New.
	* target.c (update_current_target): Set up new target operation.
	* remote.c (remote_write_bytes_aux): Fix typo.
	(remote_get_min_fast_tracepoint_insn_len): New.
	(init_remote_ops): Initialize new field.

	* gdb.texinfo (Create and Delete Tracepoints): Describe what is
	needed to get shorter fast tracepoints.
	(Tracepoint Packets): Document new qTMinFTPILen packet.

	* linux-x86-low.c (small_jump_insn): New.
	(i386_install_fast_tracepoint_jump_pad): Add arguments for
	trampoline and error message, build a trampoline and issue a small
	jump instruction to it.
	(x86_install_fast_tracepoint_jump_pad): Add arguments for
	trampoline and error message.
	(x86_get_min_fast_tracepoint_insn_len): New.
	(the_low_target): Add call to x86_get_min_fast_tracepoint_insn_len.
	* linux-low.h (struct linux_target_ops): Add arguments to
	install_fast_tracepoint_jump_pad operation, add new operation.
	* linux-low.c (linux_install_fast_tracepoint_jump_pad): Add
	arguments.
	(linux_get_min_fast_tracepoint_insn_len): New function.
	(linux_target_op): Add new operation.
	* tracepoint.c (gdb_trampoline_buffer): New IPA variable.
	(gdb_trampoline_buffer_end): Ditto.
	(gdb_trampoline_buffer_error): Ditto.
	(struct ipa_sym_addresses): Add fields for new IPA variables.
	(symbol_list): Add entries for new IPA variables.
	(struct tracepoint): Add fields to hold the address range of the
	trampoline used by the tracepoint.
	(trampoline_buffer_head): New static variable.
	(trampoline_buffer_tail): Ditto.
	(claim_trampoline_space): New function.
	(have_fast_tracepoint_trampoline_buffer): New function.
	(clone_fast_tracepoint): Fill in trampoline fields of tracepoint
	structure.
	(install_fast_tracepoint): Ditto, also add error buffer argument.
	(cmd_qtminftpilen): New function.
	(handle_tracepoint_query): Add response to qTMinFTPILen packet.
	(fast_tracepoint_from_trampoline_address): New function.
	(fast_tracepoint_collecting): Handle trampoline as part of jump
	pad space.
	(set_trampoline_buffer_space): New function.
	(initialize_tracepoint): Initialize new IPA variables.
	* target.h (struct target_ops): Add arguments to
	install_fast_tracepoint_jump_pad operation, add new
	get_min_fast_tracepoint_insn_len operation.
	(target_get_min_fast_tracepoint_insn_len): New.
	(install_fast_tracepoint_jump_pad): Add arguments.
	* server.h (IPA_BUFSIZ): Define.
	* linux-i386-ipa.c: Include extra header files.
	(initialize_fast_tracepoint_trampoline_buffer): New function.
	(initialize_low_tracepoint): Call it.
	* server.h (set_trampoline_buffer_space): Declare.
	(claim_trampoline_space): Ditto.
	(have_fast_tracepoint_trampoline_buffer): Ditto.

	* gdb.trace/ftrace.c: New.
	* gdb.trace/ftrace.exp: New.
2011-11-14 20:07:25 +00:00
Yao Qi 1e4d17643d gdb/
* remote.c (struct remote_state): <install_in_trace> new field.
	(PACKET_InstallInTrace): New enum value.
	(remote_install_in_trace_feature): Support InstallInTrace.
	(remote_supports_install_in_trace): Likewise.
	(remote_protocol_features): Likewise.
	(_initialize_remote): Likewise.
	(remote_can_download_tracepoint): New.
	* target.h (struct target): New field
	`to_can_download_tracepoint'.
	(target_can_download_tracepoint): New macro.
	* target.c (update_current_target): Update.
	* breakpoint.h (struct bp_location): Add comment on field
	`duplicate'.
	(should_be_inserted): Don't differentiate breakpoint and tracepoint.
	(remove_breakpoints): Don't remove tracepoints.
	(tracepoint_locations_match ): New.
	(breakpoint_locations_match): Call it.
	(disable_breakpoints_in_unloaded_shlib): Handle tracepoint.
	(download_tracepoint_locations): New.
	(update_global_location_list): Call it.
	* tracepoint.c (find_matching_tracepoint): Delete.
	(find_matching_tracepoint_location): Renamed from
	find_matching_tracepoint.  Return bp_location rather than
	tracepoint.
	(merge_uploaded_tracepoints): Set `inserted' field to 1 if
	tracepoint is found.

gdb/doc/
	* gdb.texinfo (Create and Delete Tracepoints): Describe changed
	behavior of tracepoint.
	(General Query Packets): New feature InstallInTrace.
	(Remote Configuration): Document "set remote
	install-in-trace-packet".

gdb/gdbserver/
	* server.c (handle_query): Handle InstallInTrace for qSupported.
	* tracepoint.c (add_tracepoint): Sort list.
	(install_tracepoint, download_tracepoint): New.
	(cmd_qtdp): Call them to install and download tracepoints.
	(sort_tracepoints): Removed.
	(cmd_qtstart): Update.

gdb/testsuite/
	* gdb.trace/change-loc-1.c: New.
	* gdb.trace/change-loc-2.c: New.
	* gdb.trace/change-loc.c: New.
	* gdb.trace/change-loc.exp:  New.
	* gdb.trace/change-loc.h:  New.
	* gdb.trace/trace-break.c (marker): Define new symbol.
	* gdb.trace/trace-break.exp (break_trace_same_addr_5):
        New.
	(break_trace_same_addr_6): New.
2011-11-14 15:18:54 +00:00
matt rice 71eba9c25e Move info definitions command to an info macro option. 2011-11-12 17:01:12 +00:00
Keith Seitz 1d93e29a97 PR gdb/12843
* gdb.base/linespecs.exp: New file.
2011-11-11 19:53:12 +00:00
Doug Evans a4b5b48aa8 * gdb.threads/print-threads.exp: Extend timeout for slower
tests.
2011-11-11 17:36:07 +00:00
Doug Evans 792a023056 * gdb.reverse/i387-env-reverse.exp: Extend timeout of
"record to end of main" test.
2011-11-10 19:22:07 +00:00
Doug Evans f6b47be484 * python/py-type.c (typy_fields_items): Call check_typedef.
testsuite/
	* gdb.python/py-type.c (TS): New typedef.
	(ts): New global.
	* gdb.python/py-type.exp: Test field list of typedef.
2011-11-10 19:15:10 +00:00
Joel Brobecker 22355c9080 read_frame_register_value and big endian arches
The read_frame_register_value function as it was implemented introduced
a regression on big-endian targets. The problem appears when trying to
get the value of an entity stored inside a register, and when the size
of the entity is smaller than the size of the register. In that case,
we were always reading the first N bytes of the register, which is wrong
for big-endian architectures, where we need to read the last N bytes of
the register.

gdb/ChangeLog:

        * findvar.c (read_frame_register_value): Read correct bytes from
        register on big-endian architectures.

gdb/testsuite/ChangeLog:

        * gdb.ada/small_reg_param: New testcase.
2011-11-10 17:14:41 +00:00
Tom Tromey a7860e76c9 gdb
PR c++/13342:
	* valops.c (value_full_object): Return early if real type is
	smaller than the enclosing type.
gdb/testsuite
	* gdb.cp/destrprint.exp: New file.
	* gdb.cp/destrprint.cc: New file.
2011-11-09 19:50:15 +00:00
Meador Inge 72a2e3dcf5 gdb/
* arm-tdep.c (thumb_analyze_prologue): Always fallback on the SP
register when the frame can't be determined.
* arm-tdep.c (arm_analyze_prologue): Ditto.

gdb/testsuite/
* gdb.arch/thumb-prologue.c (switch_stack_to_same): New test function.
(switch_stack_to_other): New test function.
* gdb.arch/thumb-prologue.exp: New test cases.
2011-11-09 00:53:40 +00:00
Maciej W. Rozycki 7bf9deb0b2 * lib/mi-support.exp (mi_send_resuming_command_raw): Fix a typo. 2011-11-08 19:51:17 +00:00
Yao Qi d3895d7d29 gdb/testsuite/
* gdb.exp (supports_process_record): New.
	(supports_reverse): New.
	* gdb.reverse/break-precsave.exp: Call support_process_record
	to run test conditionally.
	* gdb.reverse/consecutive-precsave.exp: Likewise.
	* gdb.reverse/i386-precsave.exp: Likewise.
	* gdb.reverse/machinestate-precsave.exp: Likewise.
	* gdb.reverse/solib-precsave.exp: Likewise.
	* gdb.reverse/step-precsave.exp: Likewise.
	* gdb.reverse/until-precsave.exp: Likewise.
	* gdb.reverse/watch-precsave.exp: Likewise.
	* gdb.reverse/break-reverse.exp: Call support_reverse  to run
	test conditionally.
	* gdb.reverse/consecutive-reverse.exp: Likewise.
	* gdb.reverse/finish-precsave.exp: Likewise.
	* gdb.reverse/finish-reverse-bkpt.exp: Likewise.
	* gdb.reverse/finish-reverse.exp: Likewise.
	* gdb.reverse/i386-reverse.exp: Likewise.
	* gdb.reverse/i386-sse-reverse.exp: Likewise.
	* gdb.reverse/machinestate.exp: Likewise.
	* gdb.reverse/next-reverse-bkpt-over-sr.exp: Likewise.
	* gdb.reverse/sigall-precsave.exp: Likewise.
	* gdb.reverse/sigall-reverse.exp: Likewise.
	* gdb.reverse/solib-reverse.exp: Likewise.
	* gdb.reverse/step-reverse.exp: Likewise.
	* gdb.reverse/until-reverse.exp: Likewise.
	* gdb.reverse/watch-reverse.exp: Likewise.
2011-11-08 08:23:49 +00:00
Yao Qi a59306a3db gdb/gdbserver:
2011-11-05  Yao Qi  <yao@codesourcery.com>

	* tracepoint.c (gdb_collect): Loop over tracepoints of same
	address as TPOINT's.

gdb/testsuite:

2011-11-05  Yao Qi  <yao@codesourcery.com>

	* gdb.trace/trace-break.exp: Add test on setting two
	fast tracepoints at the same address.
2011-11-05 13:16:23 +00:00
Jan Kratochvil 87769f591c gdb/testsuite/
* gdb.base/commands.exp (cmd1 error): Fix false ERROR with gdbserver.
2011-11-03 17:43:51 +00:00
Stan Shebs 3065dfb6b4 2011-11-02 Stan Shebs <stan@codesourcery.com>
String collection for tracepoints.
	* NEWS: Mention string collection.
	* common/ax.def (tracenz): New bytecode.
	* ax-gdb.h (trace_string_kludge): Declare.
	* ax-gdb.c: Include valprint.h and c-lang.h.
	(trace_string_kludge): New global.
	(gen_traced_pop): Add string case.
	(agent_command): Add string case.
	* tracepoint.h (decode_agent_options): Declare.
	* tracepoint.c: Include cli-utils.h.
	(decode_agent_options): New function.
	(validate_actionline): Call it.
	(encode_actions_1): Ditto.
	* target.h (struct target_ops): New method to_supports_string_tracing.
	(target_supports_string_tracing): New macro.
	* target.c (update_current_target): Add to_supports_string_tracing.
	* remote.c (struct remote_state): New field string_tracing.
	(remote_string_tracing_feature): New function.
	(remote_protocol_features): New feature tracenz.
	(remote_supports_string_tracing): New function.
	(init_remote_ops): Set to_supports_string_tracing.

	* tracepoint.c (agent_mem_read_string): New function.
	(eval_agent_expr): Call it for tracenz.
	* server.c (handle_query): Report support for tracenz.

	* gdb.texinfo (Tracepoint Action Lists): Document collect/s.
	(General Query Packets): Describe tracenz feature.
	* agentexpr.texi (Bytecode Descriptions): Describe tracenz.

	* gdb.trace/collection.c: Add code using strings.
	* gdb.trace/collection.exp: Add tests of string collection.
2011-11-02 23:44:21 +00:00
Jan Kratochvil 89e208dbfe gdb/testsuite/
* gdb.base/skip-solib.exp (executable_main): New variable.
	(binfile_main): Base it on that.
	Use $executable_main in clean_restart calls.  Drop gdb_exit and
	gdb_start calls.
2011-11-02 08:43:40 +00:00
Yao Qi 7b35ec7f28 Fix date in changelog entry. 2011-11-02 04:12:56 +00:00
Jan Kratochvil 405e54e994 gdb/testsuite/
Fix racy FAILs.
	* lib/mi-support.exp (mi_gdb_test): Replace thread_selected_re and
	breakpoint_re globals import by async.  Set string_regex to .* for
	async.  Remove the optional thread_selected_re and breakpoint_re
	globals expectations.
2011-11-01 20:00:01 +00:00
Joseph Myers 58e8570aab * gdb.base/maint.exp: XFAIL "maint info sections DATA" on MinGW as
well as Cygwin.
2011-11-01 16:21:55 +00:00
Justin Lebar 1bfeeb0f75 2011-10-06 Justin Lebar <justin.lebar@gmail.com>
* Makefile.in: (SFILES): Add skip.c.
	(HFILES_NO_SRCDIR): Add skip.h.
	(COMMON_OBS): Add skip.o.
	* skip.h, skip.c: New.
	* breakpoint.h (set_default_breakpoint): Remove.
	(get_sal_arch): Declare.
	* breakpoint.c: Remove default_breakpoint_valid,
	default_breakpoint_address, default_breakpoint_symtab,
	default_breakpoint_line, default_breakpoint_pspace variables.
	(get_sal_arch): Make public.
	(set_default_breakpoint): Remove.
	(parse_breakpoint_sals, create_breakpoint, clear_command,
	decode_line_spec_1): Remove uses of default_breakpoint variables;
	replaced with function calls into stack.c.
	* cli/cli-cmds.h: Add cmd_list_element *skiplist.
	* cli/cli-cmds.c: Add skiplist.
	(init_cmd_lists): Initialize skiplist.
	(init_cli_cmds): Fix comment (classes of commands appear in
	alphabetical order).
	* infrun.c (handle_inferior_event): Add check that we don't step into
	a function whose pc is marked for skip.
	* stack.c: Declare last_displayed_sal_valid, last_displayed_pspace,
	last_displayed_addr, last_displayed_symtab, last_displayed_line
	variables.
	(set_last_displayed_sal): New static function.
	(print_frame_info): Switch call to set_default_breakpoint to call to
	set_last_displayed_sal.
	(clear_last_displayed_sal, last_displayed_sal_is_valid,
	get_last_displayed_pspace, get_last_displayed_addr,
	get_last_displayed_symtab, get_last_displayed_line,
	get_last_displayed_sal): New public functions.
	* stack.h (clear_last_displayed_sal, last_displayed_sal_is_valid,
	get_last_displayed_pspace, get_last_displayed_addr,
	get_last_displayed_symtab, get_last_displayed_line,
	get_last_displayed_sal): Declare.

2011-10-06  Justin Lebar <justin.lebar@gmail.com>

	Add tests for skip command.
	* testsuite/gdb.base/skip-solib-lib.c: New
	* testsuite/gdb.base/skip-solib-main.c: New
	* testsuite/gdb.base/skip-solib.exp: New
	* testsuite/gdb.base/skip.c: New
	* testsuite/gdb.base/skip.exp: New
	* testsuite/gdb.base/skip1.c: New
	* testsuite/gdb.base/Makefile.in: Adding new files.
2011-11-01 14:51:25 +00:00
Pedro Alves b9fd179153 2011-10-31 Pedro Alves <pedro@codesourcery.com>
gdb/gdbserver/
	* mem-break.c (check_mem_write): Add `myaddr' parameter.  Don't
	clobber the breakpoints' shadows with fast tracepoint jumps.
	* mem-break.h (check_mem_write): Add `myaddr' parameter.
	* target.c (write_inferior_memory): Also pass MYADDR down to
	check_mem_write.

	gdb/testsuite/
        * gdb.trace/trace-break.c: New.
        * gdb.trace/trace-break.exp: New.
2011-10-31 12:55:26 +00:00
Jan Kratochvil 4323feccfd gdb/testsuite/
* gdb.threads/no-unwaited-for-left.exp: Specify $srcfile for
	break-here-2.
2011-10-28 19:24:45 +00:00
Pedro Alves 0e5bf2a8c9 2011-10-28 Pedro Alves <pedro@codesourcery.com>
gdb/
	* linux-nat.c (linux_nat_filter_event): Remove `options'
	parameter, and dead code that used it.  If we're handling a
	PTRACE_EVENT_EXEC event, and the thread group leader is no longer
	in our lwp list, re-add it.
	(check_zombie_leaders): New.
	(linux_nat_wait_1): Remove `options' and `pid' locals.  Always
	wait for children with WNOHANG, and always wait for all children.
	Don't check for no resumed children upfront.  Simplify wait loop.
	Check for zombie thread group leaders after handling all wait
	statuses.  Return TARGET_WAITKIND_NO_RESUMED if there no
	unwaited-for children left.
	* infrun.c (fetch_inferior_event): Handle TARGET_WAITKIND_NO_RESUMED.
	(handle_inferior_event): Handle TARGET_WAITKIND_NO_RESUMED.
	(normal_stop): Handle TARGET_WAITKIND_NO_RESUMED.
	* target.h (enum target_waitkind) <TARGET_WAITKIND_NO_RESUMED>: New.

	gdb/testsuite/
	* gdb.threads/no-unwaited-for-left.c: New.
	* gdb.threads/no-unwaited-for-left.exp: New.
	* gdb.threads/non-ldr-exc-1.c: New.
	* gdb.threads/non-ldr-exc-1.exp: New.
	* gdb.threads/non-ldr-exc-2.c: New.
	* gdb.threads/non-ldr-exc-2.exp: New.
	* gdb.threads/non-ldr-exc-3.c: New.
	* gdb.threads/non-ldr-exc-3.exp: New.
	* gdb.threads/non-ldr-exc-4.c: New.
	* gdb.threads/non-ldr-exc-4.exp: New.
2011-10-28 18:30:00 +00:00
Jan Kratochvil 3a3dad982f gdb/testsuite/
* gdb.base/async-shell.exp: Skip the testfile for use_gdb_stub.
	* gdb.base/attach-pie-misread.exp: Likewise.
	* gdb.base/break-interp.exp: Likewise.
	* gdb.base/default.exp (attach, run "r" abbreviation, run): Skip these
	testcases for use_gdb_stub.
	* gdb.dwarf2/dw2-restore.exp: Fix the run for use_gdb_stub.
	(continue): New testcase.
	* gdb.python/py-events.exp: Skip the testfile for use_gdb_stub.
	* gdb.threads/attach-into-signal.exp: Likewise.
	* gdb.threads/attach-stopped.exp: Likewise.
	* gdb.threads/attachstop-mt.exp: Likewise.
2011-10-28 17:32:30 +00:00
Paul Koning d6a5d40c76 * gdb.python/lib-types.exp (deep_items): Rename from deepitems. 2011-10-28 14:49:21 +00:00
Jan Kratochvil ca539be87d gdb/testsuite/
* lib/mi-support.exp (breakpoint_re): Suppress match reporting.
	(mi_gdb_test): Import globals thread_selected_re
	and breakpoint_re.  Expect them optionally at the regex start.
2011-10-28 08:32:35 +00:00
Doug Evans d234ef5c0c * cli/cli-cmds.c (source_script_with_search): Pass full path to
source_script_from_stream if it may have been found on the search path.
	* python/py-auto-load.c (source_section_scripts): Pass full path to
	source_python_script_for_objfile.
	* python/python.c (source_python_script): Delete stream parameter.
	All callers updated.
	(source_python_script_for_objfile): Ditto.
	* python/python-internal.h (source_python_script_for_objfile): Update.
	* python/python.h (source_python_script): Update.

	testsuite/
	* gdb.python/python.exp: Test source -s.
2011-10-27 15:46:11 +00:00
Paul Koning ab964825cc * gdb.python/lib-types.cc (struct A): New structure.
* gdb.python/lib-types.exp (deepitems): New tests.
2011-10-26 15:10:11 +00:00
Paul Koning 54d8a6445f * gdb.python/py-value.exp: Add testcases for is_lazy attribute,
fetch_lazy method.
2011-10-25 18:35:49 +00:00
Yao Qi b022178194 gdb/testsuite/
* lib/gdb.exp (can_single_step_to_signal_handler): Return 0 when
	target is tic6x-*-*.
2011-10-24 13:51:20 +00:00
Joel Brobecker 6cda5a2082 [Ada] Fix number of lines in -ada-task-info output
When using the new -ada-task-info command with an argument,
the output would say that there are N entries in the returned
table, (where N is the total number of tasks present in the inferior).
But, in fact, the table would only contain at most 1 entry.

This patch fixes this by properly computing the number of
tasks being displayed before giving it to the uiout.

gdb/ChangeLog:

        * ada-tasks.c (print_ada_task_info): Fix computation of
        number of tasks displayed in command output.

gdb/testsuite/ChangeLog:

        * gdb.ada/mi_task_info/task_switch.adb: New file.
        * gdb.ada/mi_task_info.exp: New file.
2011-10-21 18:46:06 +00:00
Jan Kratochvil 5ed9db04f8 gdb/testsuite/
* gdb.cp/expand-psymtabs-cxx.exp: New file.
	* gdb.cp/expand-psymtabs-cxx.cc: New file.
2011-10-21 16:31:17 +00:00
Phil Muldoon 9df2fbc4c1 2011-10-20 Phil Muldoon <pmuldoon@redhat.com>
PR python/12656

	* python/py-frame.c (frapy_read_var): Use const struct *block.
	* python/py-type.c (typy_lookup_typename): Likewise.
	(typy_lookup_type): Likewise.
	(typy_legacy_template_argument): Likewise.
	(typy_template_argument): Likewise.
	(gdbpy_lookup_type): Likewise.
	* python/py-symbol.c (gdbpy_lookup_symbol): Likewise.
	* python/py-block.c (blpy_block_object): Likewise.
	(blpy_iter): Likewise.
	(blpy_get_start): Likewise.
	(blpy_get_end): Likewise.
	(blpy_get_function): Likewise.
	(blpy_get_superblock): Likewise.
	(set_block):  Likewise.
	(block_to_block_object): Likewise.
	(block_object_to_block): Likewise.
	(blpy_is_valid): Likewise.
	(blpy_get_global_block): New function.
	(blpy_get_static_block): New function.
	(blpy_is_global): New function.
	(blpy_is_static): New function.
	* blockframe.c (block_innermost_frame): Likewise.
	* valops.c (value_of_variable): Likewise.
	* frame.h: Update prototypes.
	* python/python-internal.h: Likewise.
	* value.h: Likewise.

2011-10-20  Phil Muldoon  <pmuldoon@redhat.com>

	PR python/12656

	* gdb.texinfo (Blocks In Python): Document is_static, is_global,
	global_block, static_block function.

2011-10-20  Phil Muldoon  <pmuldoon@redhat.com>

	PR python/12656

	* gdb.python/py-block.exp: Add is_global, is_static, static_block,
	global_block tests.
2011-10-20 12:31:30 +00:00
Tom Tromey 736086bae2 * gdb.base/jit-so.exp (one_jit_test): Remove spurious backslash. 2011-10-18 16:55:43 +00:00
Tom Tromey 4af315526a * gdb.base/source.exp: Don't include full file name in test name.
* gdb.python/python.exp: Don't include full file name in test
	name.
2011-10-18 14:14:01 +00:00
Aleksandar Ristovski 4313697959 * solib-svr4.c (read_program_header): New variables pt_phdr, pt_phdr_p,
initialize them from target PT_PHDR p_vaddr, relocate sect_addr by
	pt_phdr if PT_PHDR was found.

	* gdb.base/attach-pie-noexec.c: New files.
	* gdb.base/attach-pie-noexec.exp: New files.
2011-10-18 14:00:42 +00:00
Joseph Myers 543a932338 * lib/gdb.exp (gdb_test_multiple): Expect newline and secondary
prompt for each extra line in command.
2011-10-17 17:10:55 +00:00
Jan Kratochvil 21ae7a4d84 gdb/
Revert:
	2011-07-27  Jan Kratochvil  <jan.kratochvil@redhat.com>
        * dwarf2expr.c (ctx_no_read_reg): New function.
        * dwarf2expr.h (ctx_no_read_reg): New declaration.
        * dwarf2read.c (read_2_signed_bytes, read_4_signed_bytes): Remove.
        (decode_locdesc_read_mem, decode_locdesc_ctx_funcs): New.
        (decode_locdesc): Replace by a caller of dwarf_expr_eval.

gdb/testsuite/
	* gdb.dwarf2/dw2-simple-locdesc.exp (p &s.shl): KFAIL it.
	Revert the part of:
	2011-07-27  Jan Kratochvil  <jan.kratochvil@redhat.com>
	* gdb.dwarf2/dw2-stack-boundary.exp (check partial symtab errors):
	Change the expected string.
2011-10-17 12:57:15 +00:00
Jan Kratochvil 20ec36d942 gdb/testsuite/
Fix results with system glibc debug info installed.
	* gdb.base/disp-step-syscall.exp (continue to $syscall (1st time))
	(continue to $syscall (2nd time), continue to $syscall (3rd time)):
	Accept also __libc_ symbol prefix and no prefix.
2011-10-16 08:42:04 +00:00
Keith Seitz 6501c2fce1 PR c++/13225
* gdb.cp/converts.cc (foo3_1): New function.
	(foo3_2): New functions.
	* gdb.cp/converts.exp: Add tests for int to pointer conversion
	and null pointer conversions of integer constant zero.
	Add test to check if all arguments are checked for incompatible
	conversion BADNESS.
2011-10-14 20:22:50 +00:00
Tom Tromey 55b1fd0ca0 * gdb.threads/attachstop-mt.exp: Add $srcfile to the linespecs.
* gdb.threads/attach-stopped.exp (corefunc): Add $srcfile to the
	linespec.
2011-10-14 16:05:05 +00:00
Jan Kratochvil 22c05d8adc gdb/
Fix internal error regression.
	* value.c (value_primitive_field): Handle value_optimized_out.  Move
	packed bitfields comment.

gdb/testsuite/
	Fix internal error regression.
	* gdb.dwarf2/implptr-optimized-out.S: New file.
	* gdb.dwarf2/implptr-optimized-out.exp: New file.
2011-10-13 16:26:28 +00:00
Jan Kratochvil 1d6edc3c37 gdb/
Fix empty DWARF expressions DATA vs. SIZE conditionals.
	* dwarf2loc.c (dwarf2_find_location_expression): Clear *LOCEXPR_LENGTH.
	(dwarf_expr_frame_base_1): Indicate unavailability via zero *LENGTH.
	(locexpr_tracepoint_var_ref): Check only zero SIZE, not zero DATA.
	(loclist_read_variable, loclist_tracepoint_var_ref): Do not check for
	zero DATA.
	* dwarf2loc.h (struct dwarf2_locexpr_baton): Comment DATA vs. SIZE
	validity.
	* dwarf2read.c (struct dwarf_block): Comment DATA validity.
	(dwarf2_fetch_die_location_block, dwarf2_symbol_mark_computed): Do not
	clear DATA on zero SIZE.

gdb/testsuite/
	Fix empty DWARF expressions DATA vs. SIZE conditionals.
	* gdb.dwarf2/dw2-op-call.S (arraycallnoloc, arraynoloc): New DIEs.
	(loclist): New.
	(4): New abbrev.
	* gdb.dwarf2/dw2-op-call.exp: Remove variable srcfile and executable.
	Use prepare_for_testing, remove clean_restart.
	(p arraynoloc, p arraycallnoloc): New tests.
2011-10-12 22:04:12 +00:00
Jan Kratochvil 9ec7216836 gdb/testsuite/
* gdb.cp/namespace-enum.exp (executable): New variable.
	(binfile): Use ${objdir}/${subdir}/ prefix.
	Use ${executable} for clean_restart.
2011-10-12 09:19:42 +00:00
Sterling Augustine 9c6c53f727 gdb/ChangeLog
2011-10-11  Sterling Augustine  <saugustine@google.com>

	* dwarf2read.c (partial_die_parent_scope): Rearrange conditional
	logic.

gdb/testsuite/ChangeLog
2011-10-11  Sterling Augustine  <saugustine@google.com>

	* gdb.cp/Makefile.in: Add namespace-enum test.
	* gdb.cp/namespace-enum.exp: New file.
	* gdb.cp/namespace-enum.c: New file.
	* gdb.cp/namespace-enum-main.c: New file.
2011-10-11 19:19:08 +00:00
Ulrich Weigand fac7ceb31e * gdb.python/py-shared.exp: Relax filename check to handle remote:
sysroot.
2011-10-11 19:01:31 +00:00
Jan Kratochvil 941b2081b1 gdb/
Revert this part of:
	2011-10-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
	Support @entry in input expressions.
	* c-exp.y (ENTRY, unknown_cpp_name): New.
	(exp: UNKNOWN_CPP_NAME): Change to `exp: unknown_cpp_name'.
	(unknown_cpp_name: UNKNOWN_CPP_NAME, unknown_cpp_name: ENTRY)
	(variable: name_not_typename '@' ENTRY, name: ENTRY)
	(name_not_typename: ENTRY): New.
	(yylex): Recognize ENTRY.

	Reimplement @entry in input expressions.
	* c-exp.y (ENTRY): New.
	(variable: name_not_typename ENTRY): New.
	(lex_one_token): Optionally return ENTRY instead of the '@' lex.

gdb/testsuite/
	Reimplement @entry in input expressions.
	* gdb.base/exprs.c (v_int_array_init): New variable.
	* gdb.base/exprs.exp (print v_int_array_init)
	(print *v_int_array_init@1, print *v_int_array_init@2)
	(print v_int_array_init[0]@1, print v_int_array_init[0]@2)
	(print v_int_array_init[1]@1): New tests.
2011-10-11 15:24:11 +00:00
Joseph Myers 0344e87890 * gdb.cp/gdb2495.exp: Do not include directories in filename in
expected message.
2011-10-11 01:27:49 +00:00
Doug Evans 5a56e9c5e9 Add new "alias" command.
* NEWS: Mention new command.
	* command.h (valid_user_defined_cmd_name_p): Declare.
	* defs.h (make_cleanup_dyn_string_delete): Declare.
	* utils.c: #include "dyn-string.h".
	(do_dyn_string_delete, make_cleanup_dyn_string_delete): New functions.
	* cli/cli-cmds.c: #include "dyn-string.h".
	(argv_to_dyn_string, valid_command_p, alias_command): New functions.
	(init_cli_cmds): Add new command.
	* cli/cli-decode.c (valid_user_defined_cmd_name_p): New function.

	doc/
	* gdb.texinfo (Extending GDB): Document alias command.

	testsuite/
	* gdb.base/alias.exp: Add tests for alias command.
2011-10-09 22:21:43 +00:00
Jan Kratochvil 2bda9cc5ee gdb/
Entry values NEWS entries, DWARF disassembly support.
	* NEWS: New entry values entry.
	(set print entry-values, show print entry-values)
	(set debug entry-values, show debug entry-values): New entries.
	* dwarf2loc.c (disassemble_dwarf_expression): New parameters start and
	indent.  Remove variable start.  Move header printing out.  Respect
	INDENT.  Support DW_OP_GNU_entry_value.
	(locexpr_describe_location_1): Move the header printing here, extend
	the disassemble_dwarf_expression passed parameters.

gdb/testsuite/
	* gdb.arch/amd64-entry-value.s: New file.
	* gdb.mi/mi2-amd64-entry-value.s: New file.
2011-10-09 19:46:05 +00:00
Jan Kratochvil a471c5941e gdb/
Display @entry parameter values even for references.
	* ada-valprint.c (ada_val_print_1) <TYPE_CODE_REF>: Try also
	coerce_ref_if_computed.
	* c-valprint.c (c_val_print) <TYPE_CODE_REF>: Likewise.
	* dwarf2expr.c (dwarf_block_to_dwarf_reg_deref): New function.
	(execute_stack_op) <DW_OP_GNU_entry_value>: Add -1 deref_size to the
	existing push_dwarf_reg_entry_value call.  Add new detection calling
	dwarf_block_to_dwarf_reg_deref.  Update the error message.
	(ctx_no_push_dwarf_reg_entry_value): New parameter deref_size.
	* dwarf2expr.h
	(struct dwarf_expr_context_funcs) <push_dwarf_reg_entry_value>: Add new
	parameter deref_size, describe it in the comment.
	(ctx_no_push_dwarf_reg_entry_value): Add new parameter deref_size.
	(dwarf_block_to_dwarf_reg_deref): New declaration.
	* dwarf2loc.c (dwarf_entry_parameter_to_value): Add new parameter
	deref_size, describe it in the function comment.  New variables
	data_src and size, fetch the alternative block accoring to DEREF_SIZE.
	(dwarf_expr_push_dwarf_reg_entry_value): Add new parameter deref_size,
	describe it in the function comment.  Fetch the alternative block
	accoring to DEREF_SIZE.
	(entry_data_value_coerce_ref, entry_data_value_copy_closure)
	(entry_data_value_free_closure, entry_data_value_funcs): New.
	(value_of_dwarf_reg_entry): New variables checked_type, target_type,
	outer_val, target_val, val and addr.  Try to fetch and create also
	referenced value content.
	(pieced_value_funcs): NULL value for coerce_ref.
	(needs_dwarf_reg_entry_value): Add new parameter deref_size.
	* f-valprint.c (f_val_print) <TYPE_CODE_REF>: Try also
	coerce_ref_if_computed.
	* opencl-lang.c (opencl_value_funcs): NULL value for coerce_ref.
	* p-valprint.c (pascal_val_print) <TYPE_CODE_REF>: Likewise.
	* stack.c (read_frame_arg): Compare also dereferenced values.
	* value.c (value_computed_funcs): Make the parameter v const, use
	value_lval_const for it.
	(value_lval_const, coerce_ref_if_computed): New function.
	(coerce_ref): New variable retval.  Call also coerce_ref_if_computed.
	* value.h (struct lval_funcs): New field coerce_ref.
	(value_computed_funcs): Make the parameter v const.
	(value_lval_const, coerce_ref_if_computed): New declarations.

gdb/testsuite/
	Display @entry parameter values even for references.
	* gdb.arch/amd64-entry-value.cc (reference, datap, datap_input): New
	functions.
	(main): New variables regvar, nodatavarp, stackvar1, stackvar2.  Call
	reference and datap_input.
	* gdb.arch/amd64-entry-value.exp (reference, breakhere_reference): New
	breakpoints.
	(continue to breakpoint: entry_reference: reference)
	(entry_reference: bt at entry)
	(continue to breakpoint: entry_reference: breakhere_reference)
	(entry_reference: bt, entry_reference: ptype regparam)
	(entry_reference: p regparam, entry_reference: ptype regparam@entry)
	(entry_reference: p regparam@entry, entry_reference: p &regparam@entry)
	(entry_reference: p regcopy, entry_reference: p nodataparam)
	(entry_reference: p nodataparam@entry): New tests.
2011-10-09 19:43:41 +00:00
Jan Kratochvil 36b11add17 gdb/
Support @entry in input expressions.
	* c-exp.y (ENTRY, unknown_cpp_name): New.
	(exp: UNKNOWN_CPP_NAME): Change to `exp: unknown_cpp_name'.
	(unknown_cpp_name: UNKNOWN_CPP_NAME, unknown_cpp_name: ENTRY)
	(variable: name_not_typename '@' ENTRY, name: ENTRY)
	(name_not_typename: ENTRY): New.
	(yylex): Recognize ENTRY.
	* eval.c (evaluate_subexp_standard): Support also OP_VAR_ENTRY_VALUE.
	* expprint.c (print_subexp_standard, dump_subexp_body_standard):
	Likewise.
	* parse.c (operator_length_standard): Likewise.
	* std-operator.def: New operator OP_VAR_ENTRY_VALUE.

gdb/doc/
	Support @entry in input expressions.
	* gdb.texinfo (Variables): Describe @entry names suffix.
	(Print Settings): Add anchor for `set print entry-values'.

gdb/testsuite/
	Support @entry in input expressions.
	* gdb.arch/amd64-entry-value.exp (entry: p i@entry, entry: p j@entry)
	(entry_stack: p s1@entry, entry_stack: p s2@entry)
	(entry_stack: p d9@entry, entry_stack: p da@entry, tailcall: p i@entry)
	(tailcall: p j@entry): New tests.
	* gdb.cp/koenig.cc (A::entry): New function.
	(main): Call it.
	* gdb.cp/koenig.exp (p entry (c)): New test.
2011-10-09 19:41:17 +00:00
Jan Kratochvil e18b27534c gdb/
Display @entry parameter values (without references).
	* dwarf2expr.c (dwarf_block_to_fb_offset, dwarf_block_to_sp_offset):
	New functions.
	* dwarf2expr.h (dwarf_block_to_fb_offset, dwarf_block_to_sp_offset):
	New declarations.
	* dwarf2loc.c (dwarf2_find_location_expression): Support location list
	entry record.
	(dwarf_entry_parameter_to_value, value_of_dwarf_reg_entry)
	(value_of_dwarf_block_entry, locexpr_read_variable_at_entry): New
	functions.
	(dwarf2_locexpr_funcs): Install locexpr_read_variable_at_entry.
	(loclist_read_variable_at_entry): New function.
	(dwarf2_loclist_funcs): Install loclist_read_variable_at_entry.
	* dwarf2read.c (read_call_site_scope): Support also DW_OP_fbreg in
	DW_AT_location, call dwarf_block_to_sp_offset for it.
	* frame.h (print_entry_values_no, print_entry_values_only)
	(print_entry_values_preferred, print_entry_values_if_needed)
	(print_entry_values_both, print_entry_values_compact)
	(print_entry_values_default, print_entry_values): New declarations.
	(struct frame_arg): New field entry_kind.
	(read_frame_arg): New parameter entryargp.
	* mi/mi-cmd-stack.c (list_arg_or_local): New gdb_assert for
	arg->entry_kind.  Optionally print the `@entry' suffix.
	(list_args_or_locals): New variable entryarg, initialize it.
	Initialize also entry_kind of arg and entryarg.  Conditionalize
	list_arg_or_local for arg, add list_arg_or_local for entryarg.  Call
	xfree for entryarg.error.
	* stack.c (print_entry_values_no, print_entry_values_only)
	(print_entry_values_preferred, print_entry_values_if_needed)
	(print_entry_values_both, print_entry_values_compact)
	(print_entry_values_default, print_entry_values_choices)
	(print_entry_values): New variables.
	(print_frame_arg): New gdb_assert for arg->entry_kind.  Optionally
	print the `@entry' suffix, possibly in combination for
	print_entry_values_compact.
	(read_frame_arg): New parameter entryargp, new variables entryval,
	entryval_error and val_equal.  Read in also entryargp, respect
	print_entry_values, compare the values using val_equal, fill in also
	argp->entry_kind (together with entryargp->entry_kind).
	(print_frame_args): New variable entryarg, initialize it.
	Conditionalize print_frame_arg for arg, add print_frame_arg for
	entryarg.  Call xfree for entryarg.error.
	(_initialize_stack): Call add_setshow_enum_cmd for `entry-values'.
	* symtab.h (struct symbol_computed_ops): New field
	read_variable_at_entry.

gdb/doc/
	Display @entry parameter values (without references).
	* gdb.texinfo (Tail Call Frames): Add anchor.  Add self tail call
	example.
	(Print Settings): New description of set print entry-values and show
	print entry-values.

gdb/testsuite/
	Display @entry parameter values (without references).
	* gdb.arch/amd64-entry-value.cc (locexpr, stacktest, data, data2)
	(different, validity, invalid): New functions.
	(main): Call them.
	* gdb.arch/amd64-entry-value.exp: New breakpoints breakhere_locexpr,
	stacktest, breakhere_stacktest, different, breakhere_different,
	breakhere_validity and breakhere_invalid.
	(entry: bt): Update for @entry.
	(entry_locexpr: *, entry_stack: *, entry_equal: *, entry_different: *)
	(entry_validity: *, entry_invalid: *): Many new tests.
	* gdb.base/break.exp
	(run until breakpoint set at small function, optimized file): Accept
	also the @entry suffix.
	* gdb.mi/Makefile.in (PROGS): Add mi2-amd64-entry-value.
	* gdb.mi/mi2-amd64-entry-value.c: New files.
	* gdb.mi/mi2-amd64-entry-value.exp: New files.
2011-10-09 19:34:19 +00:00
Jan Kratochvil 2d6c5dc2c7 gdb/
Protect entry values against self tail calls.
	* dwarf2loc.c (VEC (CORE_ADDR), func_verify_no_selftailcall): New.
	(dwarf_expr_dwarf_reg_entry_value): Call func_verify_no_selftailcall.

gdb/testsuite/
	Protect entry values against self tail calls.
	* gdb.arch/amd64-entry-value.cc (self2, self): New.
	(main): Call self.
	* gdb.arch/amd64-entry-value.exp (self: breakhere, self: bt)
	(set debug entry-values 1, self: bt debug entry-values): New tests.
2011-10-09 19:29:11 +00:00
Jan Kratochvil 111c64899c gdb/
Recognize virtual tail call frames.
	* Makefile.in (SFILES): Add dwarf2-frame-tailcall.c.
	(HFILES_NO_SRCDIR): Add dwarf2-frame-tailcall.h.
	(COMMON_OBS): Add dwarf2-frame-tailcall.o.
	* dwarf2-frame-tailcall.c: New file.
	* dwarf2-frame-tailcall.h: New file.
	* dwarf2-frame.c: Include dwarf2-frame-tailcall.h.
	(execute_cfa_program): New function comment.  Return INSN_PTR.  Reset
	REGS.PREV only after CIE execution.
	(struct dwarf2_frame_cache): New field tailcall_cache.
	(dwarf2_frame_cache): New variables entry_pc, entry_cfa_sp_offset,
	entry_cfa_sp_offset_p and instr.  Execute FDE instructions in two
	parts, try to find entry_cfa_sp_offset.  Call
	dwarf2_tailcall_sniffer_first.
	(dwarf2_frame_prev_register): Call dwarf2_tailcall_prev_register_first
	when appropriate.
	(dwarf2_frame_dealloc_cache): New function.
	(dwarf2_frame_sniffer): Preinitialize cache by dwarf2_frame_cache.
	(dwarf2_frame_unwind): Install dwarf2_frame_dealloc_cache.
	(dwarf2_signal_frame_unwind): Do not install dwarf2_frame_dealloc_cache.
	(dwarf2_append_unwinders): Add dwarf2_tailcall_frame_unwind.
	(dwarf2_frame_cfa): Support also dwarf2_tailcall_frame_unwind.
	* dwarf2loc.c (func_addr_to_tail_call_list)
	(tailcall_dump, call_sitep, VEC (call_sitep), chain_candidate)
	(call_site_find_chain_1, call_site_find_chain): New.
	* dwarf2loc.h (struct call_site_chain): New.
	(call_site_find_chain): New declaration.
	* frame.c (get_frame_address_in_block): Support also TAILCALL_FRAME.
	* frame.h (enum frame_type): New entry TAILCALL_FRAME.
	* python/py-frame.c (gdbpy_initialize_frames): Add TAILCALL_FRAME.
	* stack.c (frame_info): Support also TAILCALL_FRAME.

gdb/doc/
	Recognize virtual tail call frames.
	* gdb.texinfo (Optimized Code): Add reference to Tail Call Frames.
	(Tail Call Frames): New node.
	(Frames In Python): Add gdb.TAILCALL_FRAME.

gdb/testsuite/
	Recognize virtual tail call frames.
	* gdb.arch/amd64-entry-value.cc (c, a, b, amb_z, amb_y, amb_x, amb)
	(amb_b, amb_a): New.
	(main): Call a and b.
	* gdb.arch/amd64-entry-value.exp (tailcall: breakhere, tailcall: bt)
	(tailcall: p i, tailcall: p j, set $sp0=$sp, up, p $sp0 == $sp, frame 3)
	(p $sp0 + sizeof (void *) == $sp, ambiguous: breakhere, ambiguous: bt):
	New tests.
2011-10-09 19:26:44 +00:00
Jan Kratochvil 8e3b41a906 gdb/
Implement basic support for DW_TAG_GNU_call_site.
	* block.c: Include gdbtypes.h and exceptions.h.
	(call_site_for_pc): New function.
	* block.h (call_site_for_pc): New declaration.
	* defs.h: Include hashtab.h.
	(make_cleanup_htab_delete, core_addr_hash, core_addr_eq): New
	declarations.
	* dwarf2-frame.c (dwarf2_frame_ctx_funcs): Install
	ctx_no_push_dwarf_reg_entry_value.
	* dwarf2expr.c (read_uleb128, read_sleb128): Support R as NULL.
	(dwarf_block_to_dwarf_reg): New function.
	(execute_stack_op) <DW_OP_GNU_entry_value>: Implement it.
	(ctx_no_push_dwarf_reg_entry_value): New function.
	* dwarf2expr.h (struct dwarf_expr_context_funcs): New field
	push_dwarf_reg_entry_value.
	(ctx_no_push_dwarf_reg_entry_value, dwarf_block_to_dwarf_reg): New
	declarations.
	* dwarf2loc.c: Include gdbcmd.h.
	(dwarf_expr_ctx_funcs): New forward declaration.
	(entry_values_debug, show_entry_values_debug, call_site_to_target_addr)
	(dwarf_expr_reg_to_entry_parameter)
	(dwarf_expr_push_dwarf_reg_entry_value): New.
	(dwarf_expr_ctx_funcs): Install dwarf_expr_push_dwarf_reg_entry_value.
	(dwarf2_evaluate_loc_desc_full): Handle NO_ENTRY_VALUE_ERROR.
	(needs_dwarf_reg_entry_value): New function.
	(needs_frame_ctx_funcs): Install it.
	(_initialize_dwarf2loc): New function.
	* dwarf2loc.h (entry_values_debug): New declaration.
	* dwarf2read.c (struct dwarf2_cu): New field call_site_htab.
	(read_call_site_scope): New forward declaration.
	(process_full_comp_unit): Copy call_site_htab.
	(process_die): Support DW_TAG_GNU_call_site.
	(read_call_site_scope): New function.
	(dwarf2_get_pc_bounds): Support NULL HIGHPC.
	(dwarf_tag_name): Support DW_TAG_GNU_call_site.
	(cleanup_htab): Delete.
	(write_psymtabs_to_index): Use make_cleanup_htab_delete instead of it.
	* exceptions.h (enum errors): New NO_ENTRY_VALUE_ERROR.
	* gdb-gdb.py (StructMainTypePrettyPrinter): Support
	FIELD_LOC_KIND_DWARF_BLOCK.
	* gdbtypes.h (enum field_loc_kind): New entry
	FIELD_LOC_KIND_DWARF_BLOCK.
	(struct main_type): New loc entry dwarf_block.
	(struct call_site, FIELD_DWARF_BLOCK, SET_FIELD_DWARF_BLOCK)
	(TYPE_FIELD_DWARF_BLOCK): New.
	* python/py-type.c: Include dwarf2loc.h.
	(check_types_equal): Support FIELD_LOC_KIND_DWARF_BLOCK.  New
	internal_error call on unknown FIELD_LOC_KIND.
	* symtab.h (struct symtab): New field call_site_htab.
	* utils.c (do_htab_delete_cleanup, make_cleanup_htab_delete)
	(core_addr_hash, core_addr_eq): New functions.

gdb/testsuite/
	Implement basic support for DW_TAG_GNU_call_site.
	* gdb.arch/Makefile.in (EXECUTABLES): Add amd64-entry-value.
	* gdb.arch/amd64-entry-value.cc: New file.
	* gdb.arch/amd64-entry-value.exp: New file.
2011-10-09 19:21:39 +00:00
Jan Kratochvil 181cebd4f8 gdb/
Fix DW_OP_GNU_implicit_pointer for DWARF32 v3+ on 64-bit arches.
	* dwarf2-frame.c (execute_stack_op): Initialize ctx->ref_addr_size.
	* dwarf2expr.c (execute_stack_op) <DW_OP_GNU_implicit_pointer>: Use
	ctx->ref_addr_size.  Handle its invalid value.
	* dwarf2expr.h (struct dwarf_expr_context): New field ref_addr_size.
	* dwarf2loc.c (dwarf2_evaluate_loc_desc_full)
	(dwarf2_loc_desc_needs_frame): Initialize ctx->ref_addr_size.
	* dwarf2loc.h (dwarf2_per_cu_ref_addr_size): New declaration.
	* dwarf2read.c (decode_locdesc): Initialize ctx->ref_addr_size.
	(dwarf2_per_cu_ref_addr_size): New function.

gdb/testsuite/
	Fix DW_OP_GNU_implicit_pointer for DWARF32 v3+ on 64-bit arches.
	* gdb.dwarf2/implptr-64bit.S: New file.
	* gdb.dwarf2/implptr-64bit.exp: New file.
2011-10-09 18:46:41 +00:00
Jan Kratochvil 741f5e3c63 gdb/
Fix initial language detection with -readnow.
	* dwarf2read.c (dw2_find_symbol_file): Handle OBJF_READNOW case.
	* symfile.h (struct quick_symbol_functions): State find_symbol_file
	searches only for global symbols.

gdb/testsuite/
	Fix initial language detection with -readnow.
	* gdb.cp/readnow-language.cc: New file.
	* gdb.cp/readnow-language.exp: New file.
2011-10-09 18:37:27 +00:00
Jan Kratochvil a73d2258a7 gdb/
Fix printed anonymous struct name.
	* dwarf2read.c (fixup_partial_die): Handle for anonymous structs also
	DW_TAG_interface_type.  Strip for anonymous structs any prefixes.
	(anonymous_struct_prefix): New function.
	(determine_prefix): New variables retval.  Call anonymous_struct_prefix.
	(dwarf2_name): Strip for anonymous structs any prefixes.

gdb/testsuite/
	Fix printed anonymous struct name.
	* gdb.cp/anon-struct.exp (print type of X::t2): New test.
2011-10-09 18:33:28 +00:00
Joseph Myers af36949570 * gdb.base/solib-symbol.exp: Do not include directories in
filenames in expected messages.
2011-10-09 18:14:41 +00:00
Doug Evans 1fa57852d6 * python/lib/gdb/printing.py (register_pretty_printer): New argument
`replace'.

	testsuite/
	* gdb.python/py-pp-maint.py: Add tests for `replace' arg.
2011-10-07 22:46:15 +00:00
Kevin Pouget 01b7169780 Add missing files to previous commit (Allow Python notification of new object-file loadings.) 2011-10-07 08:39:57 +00:00
Kevin Pouget bd054e06e3 Fix ChangeLog messup (Allow Python notification of new object-file loadings.) 2011-10-07 07:51:20 +00:00
Kevin Pouget 20c168b519 Allow Python notification of new object-file loadings.
* Makefile.in (SUBDIR_PYTHON_SRCS): Add py-newobjfilevent.c.
	(SUBDIR_PYTHON_OBS): Add py-newobjfileevent.o.
	Add build rule for this file.
	* python/py-event.h (emit_new_objfile_event): New prototype.
	(newobjfile): New Python event emitter.
	* python/py-evts.c (gdbpy_initialize_py_events): Add new_objfile to
	Python event registry.
	* python/py-inferior.c: Include objfiles.h
	(python_new_objfile): New function.
	(gdbpy_initialize_inferior): Add python_new_objfile to the new objfile
	observers.
	* python/py-newobjfileevent.c: New file.
	* python-internal.h (gdbpy_initialize_new_objfile_event): New
	prototype.
	* python/python.c (_initialize_python): Add
	gdbpy_initialize_new_objfile_event call.
	* NEWS: Add item for new Python event "gdb.newobjfile"

2011-10-06  Kevin Pouget  <kevin.pouget@st.com>

	Allow Python notification of new object-file loadings.
	* gdb.texinfo (Events In Python): Document `gdb.NewObjFileEvent'
	event type.

2011-10-06  Kevin Pouget  <kevin.pouget@st.com>

	Allow Python notification of new object-file loadings.
	* gdb.python/py-events.exp: Test newobjfile event.
	* gdb.python/py-events.py: Register newobjfile callback.
	* gdb.python/py-events.c: Add call to shared library
	* gdb.python/py-events-shlib.c: New file.
2011-10-07 07:38:30 +00:00
Joseph Myers 8031b6f821 * gdb.base/fixsection.exp: Do not include directories in filename
in expected message.
2011-10-07 00:24:38 +00:00
Pierre Muller 7fea69231b Add tests for passing of environment variables to inferior.
* gdb.base/testenv.c: New test source.
	* gdb.base/testenv.exp: New expect test.
2011-10-05 14:23:37 +00:00
Paul Koning 687f2a88e7 * gdb.python/py-value.c (main): Break before return. 2011-10-04 17:43:16 +00:00
Kevin Pouget cb6be26b8b 2011-10-04 Kevin Pouget <kevin.pouget@st.com>
PR python/12691: Add the inferior to Python exited event
       * python/py-exitedevent.c (create_exited_event_object): Add inferior
       to exited_event.
       * python/py-event.h (emit_exited_event): Likewise
       * python/-inferior.c (python_inferior_exit): Likewise

 2011-10-04  Kevin Pouget  <kevin.pouget@st.com>

       PR python/12691: Add the inferior to Python exited event
       * gdb.python/py-events.exp: Test the inferior attribute of exited
       event with a fork.
       * gdb.python/py-events.py: Print inferior number on exit.
       * gdb.python/py-events.c: Fork the inferior.

 2011-10-04  Kevin Pouget  <kevin.pouget@st.com>

       PR python/12691: Add the inferior to Python exited event
       * gdb.texinfo (Events In Python): Describe exited inferior attribute.
2011-10-04 08:04:13 +00:00
Edjunior Barbosa Machado fb21370048 * gdb.base/jit.exp: Add testcase name to log message 2011-10-03 20:13:57 +00:00
Paul Koning aa2071bd24 * gdb.python/py-value.exp
(python inval = gdb.parse_and_eval('*(int*)0'))
(python argc_lazy = gdb.parse_and_eval('argc'), sanity check argc)
(set argc=2, python print argc_lazy): New tests.
2011-10-03 16:15:26 +00:00
Joel Brobecker dd11a36cfe thread-specific breakpoints not saved properly by save-breakpoint
Initially, I noticed that the save command was often missing
new lines in the file that it generated.  For instance, consider:

        % gdb save-bp
        (gdb) b break_me
        (gdb) b save-bp.c:27
        (gdb) save breakpoints bps

The contents of the bps file would be:

        % cat bps
        break break_mebreak save-bp.c:27

Looking further into the problem, I realized that the missing newlines
are just a consequence of a missing call to print_recreate_thread.
After having generated the breakpoint location in the break command,
we cannot put a new line until we have looked at whether we need to
add a 'thread NUM' argument.

gdb/ChangeLog:

        * breakpoint.c (bkpt_print_recreate): Add call to
        print_recreate_thread.

gdb/testsuite/ChangeLog:

        * gdb.base/save-bp.exp, gdb.base/save-bp.c: New files.
2011-10-02 02:13:13 +00:00
Jan Kratochvil 46f886f1f5 gdb/testsuite/
* gdb.python/py-value.exp (test_value_in_inferior): New variable
	can_read_0, test for it.
	(python print gdb.parse_and_eval('*(int*)0')): Rename to ...
	(parse_and_eval with memory error): ... here, make it untested if
	can_read_0.
2011-10-01 11:02:11 +00:00
Marek Polacek c5cb204fbb gdb.python/python.exp: fix up race 2011-09-30 15:07:33 +00:00
Joseph Myers 68fb0ec00b * lib/gdb.exp (is_amd64_regs_target, is_x86_like_target): Allow
for 64-bit multilibs from i?86-* targets.
2011-09-29 15:17:50 +00:00
Marek Polacek 6aee0d90b5 lib/gdb.exp: Fix a typo 2011-09-29 14:36:47 +00:00
Marek Polacek e9101ff5a7 gdb.base/foll-fork.exp: fix up race 2011-09-29 14:13:00 +00:00
Paul Koning 7a81bdbf67 * gdb.python/py-type.c (enum E): New.
* gdb.python/py-type.exp (test_fields): Add tests for Python
mapping access to fields.
(test_enums): New test for field access on enums.
2011-09-28 20:06:01 +00:00
Stan Shebs 6710bf39b7 Add return address collection for tracepoints.
* tracepoint.c (encode_actions_1): Add case for $_ret.
	(validate_actionline): Check for $_ret.
	(trace_dump_actions): Ditto.
	* ax-gdb.h (gen_trace_for_return_address): Declare.
	* ax-gdb.c: Include arch-utils.h.
	(gen_trace_for_return_address): New function.
	(agent_command): Add return address special case.
	* amd64-tdep.c: Include ax.h and ax-gdb.h.
	(amd64_gen_return_address): New function.
	(amd64_init_abi): Call it.
	* i386-tdep.c: Include ax.h and ax-gdb.h.
	(i386_gen_return_address): New function.
	(i386_init_abi): Call it.
	* arch-utils.h (default_gen_return_address): Declare.
	* arch-utils.c (default_gen_return_address): New function.
	* gdbarch.sh (gen_return_address): New method.
	* gdbarch.h, gdbarch.c: Regenerate.

	* gdb.texinfo (Tracepoint Action Lists): Document $_ret.

	* gdb.trace/collection.exp: Test collection of $_ret.
2011-09-27 13:09:37 +00:00
Andreas Tobler b2a6bdebec 2011-09-22 Andreas Tobler <andreast@fgznet.ch>
* lib/gdb.exp (gdb_compile): Set rpath and remove -ldl from the
	list of compilation switches for <*-*-freebsd*>.
2011-09-22 04:58:22 +00:00
Stan Shebs 3c9057f381 * gdb.trace/tspeed.exp: New file.
* gdb.trace/tspeed.c: New file.
2011-09-19 16:55:26 +00:00
Yao Qi 3451853062 Support displaced stepping for Thumb 16-bit insns.
gdb/
	* arm-tdep.c (THUMB_NOP) Define.
	(thumb_copy_unmodified_16bit): New.
	(thumb_copy_b, thumb_copy_bx_blx_reg): New.
	(thumb_copy_alu_reg): New.
	(arm_copy_svc): Move some common code to ...
	(install_svc): ... here.  New.
	(thumb_copy_svc): New.
	(install_pc_relative): New.
	(thumb_copy_pc_relative_16bit): New.
	(thumb_decode_pc_relative_16bit): New.
	(thumb_copy_16bit_ldr_literal): New.
	(thumb_copy_cbnz_cbz): New.
	(cleanup_pop_pc_16bit_all): New.
	(thumb_copy_pop_pc_16bit): New.
	(thumb_process_displaced_16bit_insn): New.
	(thumb_process_displaced_32bit_insn): New.
	(thumb_process_displaced_insn): process thumb instruction.

	Support displaced stepping for Thumb 32-bit insns.
	gdb/
	* arm-tdep.c (thumb_copy_unmodified_32bit): New.
	(thumb2_copy_preload): New.
	(thumb2_copy_copro_load_store): New.
	(thumb2_copy_b_bl_blx): New.
	(thumb2_copy_alu_imm): New.
	(thumb2_copy_load_reg_imm): New.
	(thumb2_copy_load_literal): New
	(thumb2_copy_block_xfer): New.
	(thumb_32bit_copy_undef): New.
	(thumb_32bit_copy_unpred): New.
	(thumb2_decode_ext_reg_ld_st): New.
	(thumb2_decode_svc_copro): New.
	(decode_thumb_32bit_store_single_data_item): New.
	(thumb_copy_pc_relative_32bit): New.
	(thumb_decode_pc_relative_32bit): New.
	(decode_thumb_32bit_ld_mem_hints): New.
	(thumb2_copy_table_branch): New
	(thumb_process_displaced_32bit_insn): Process Thumb 32-bit
	instructions.

	gdb/testsuite/
	* gdb.arch/arm-disp-step.S (test_ldr_literal): Test for Thumb
	instructions.
	(test_adr_32bit, test_pop_pc): Likewise.
	(test_ldr_literal_16, test_cbz_cbnz, test_adr): New test for
	Thumb instructions.
	* gdb.arch/arm-disp-step.exp (test_ldm_stm_pc): Match $gdb_prompt
	in gdb_test_multiple.
	(test_ldr_literal_16, test_cbz_cbnz, test_adr): New.
2011-09-18 14:34:55 +00:00
Yao Qi ab254057b8 gdb/testsuite/
* lib/gdb.exp (can_single_step_to_signal_handler): New.
	* gdb.base/kill-after-signal.exp: Call it.  Skip if target doesn't
	support single step to signal handler.
2011-09-18 02:36:27 +00:00
Yao Qi 9c317b7184 gdb/testsuite/
* gdb.base/disp-step-fork.c: New.
	* gdb.base/disp-step-syscall.exp: New.
	* gdb.base/disp-step-vfork.c: New.
2011-09-17 13:34:01 +00:00
Joel Brobecker a812315168 [Ada] Re-implement `info tasks' command using ui-out
This is in preparation for providing a GDB/MI equivalent of
the `info tasks' command.  The previous implementation was using
various printf commands to generate the command output, which
does not work at all if we want to use that same code to generate
the result for that new GDB/MI command.

This patch thus re-implements the `info tasks' command (with no
arguments) in a way that makes it GDB/MI friendly.

There is an additional hicup, which is the fact that the `info tasks'
command displays a completely different type of output when a task
ID is given. For instance:

    (gdb) info task 2
    Ada Task: 0x644d20
    Name: my_callee
    Thread: 0
    LWP: 0x5809
    Parent: 1 (main_task)
    Base Priority: 48
    State: Blocked in accept or select with terminate

The above output is better when in CLI mode, but really not
what we want when in GDB/MI mode. In GDB/MI mode, we want to
follow what the `-thread-info' command does when a task-id
is given as an argument, which is to produce the same table,
but with only one element/task in it.

For compatibility as well as practical reasons, we do not want
to change the output of the `info task TASKNO' command when in
CLI mode.  But it's easy to preserve this behavior while providing
the desirable output when in GDB/MI mode.  For this, the function
used to generated the `info tasks' output has been enhanced to take
an argument interpreted as a string. The CLI command knows to never
provide that argument, while the GDB/MI command will pass one if
provided by the user.

gdb/ChangeLog:

        * ada-tasks.c (print_ada_task_info): New function, merging
        short_task_info and info_tasks together.  Reimplement using
        ui-out instead of printing to stdout directly.  Move the code
        building and checking the task list here, instead of leaving it
        in info_tasks_command.
        (info_task): Move the code building and checking the task
        list here, instead of leaving it in info_tasks_command.
        (info_tasks_command): Delete code building and checking
        the task list - moved elsewhere.  Update calls to info_tasks
        and info_task.

One of the minor changes the switch caused is the introduction
of a space between the "current" column, and the task "ID"
column, which wasn't there before.  This matches what we do
in the "info threads" command, so I kept that change.  This
required an adjustment in the testsuite, however...

gdb/testsuite/ChangeLog:

        * gdb.ada/tasks.exp: Make the expected output for
        the `info tasks' tests more resilient to spacing
        changes.
2011-09-16 19:09:57 +00:00
Jan Kratochvil 63a9aad80e gdb/testsuite/
* gdb.python/py-evthreads.exp (Run to breakpoint 1)
	(reached breakpoint 2, reached breakpoint 3): Update expected output.
2011-09-16 07:34:27 +00:00
Kevin Pouget 2aa483373c 2011-09-15 Kevin Pouget <kevin.pouget@st.com>
PR Python/12692 Add gdb.selected_inferior() to Python interface.
	* python/py-inferior.c (GdbMethods): New Python method definition.

doc:
	PR Python/12692 Add gdb.selected_inferior() to Python interface.
	* gdb.texinfo (Inferiors In Python): Describe new
	gdb.selected_inferior() function.

testsuite:
	PR Python/12692 Add gdb.selected_inferior() to Python interface.
	* gdb.python/py-inferior.exp: Add testcase for gdb.selected_inferior().
2011-09-15 12:42:30 +00:00
Kevin Pouget 6839b47f2b 2011-09-15 Kevin Pouget <kevin.pouget@st.com>
Handle multiple breakpoint hits in Python interface:
	* python/py-bpevent.c (create_breakpoint_event_object): Rename C/Python
	variable to breakpoints.
	* python/py-stopevent.c (emit_stop_event): Return a Python tuple of
	bps instead of single breakpoint. Fix some space typos.
	* python/py-stopevent.c (create_breakpoint_event_object): Rename
	variable to breakpoints.

testsuite:
	* gdb.python/py-events.exp: Set a duplicate breakpoint and check its
	presence.
	* gdb.python/py-events.py (breakpoint_stop_handler): Browse all the
	breakpoint hits.

doc:
	* gdb.texinfo (Events In Python): New function documentation:
	gdb.BreakpointEvent.breakpoints. Indicate that
	gdb.BreakpointEvent.breakpoint is now deprecated.
2011-09-15 12:27:20 +00:00
Jan Kratochvil 0935723e5e gdb/testsuite/
* gdb.python/py-events.exp: Remove pretty printing comment.
	* gdb.python/py-evsignal.exp: New file.
	* gdb.python/py-evthreads.c: Include signal.h.
	(thread3): Remove variable count3.  Remove variable bad and use raise
	instead.
	(thread2): Remove variable count2.  Move thread3 pthread_create here,
	merge pthread_join to a single line.
	(main): Remove variable count1.  Merge pthread_join with pthread_create
	to a single line.
	* gdb.python/py-evthreads.exp: Remove pretty printing comment.  New
	KFAIL python/12966 for gdbserver.  Test return value of
	gdb_compile_pthreads.  Use gdb_run_cmd.  Replace send_gdb and
	gdb_expect by gdb_test and gdb_test_multiple.
	(thread 2, thread 3): New tests.
2011-09-13 21:39:59 +00:00
Pedro Alves 4801a9a356 gdb/
2011-09-12  Pedro Alves  <pedro@codesourcery.com>
	    Matt Rice  <ratmice@gmail.com>

	PR gdb/13175

	* interps.c (struct interp) <interpreter_out>: Delete field.
	(interp_new): Remove the data and uiout parameters and adjust.
	(interp_set): Only set the current_uiout from the interpreter's
	uiout after initializing the interpreter.  Adjust call to
	init_proc.
	(interp_ui_out): Adjust to call procs->ui_out_proc.
	(interp_data, interp_name): New.
	* interps.h (interp_init_ftype): Add `self' parameter.
	(interp_ui_out_ftype): New typedef.
	(struct interp_procs) <ui_out_proc>: New method pointer.
	(interp_new): Remove the data and uiout parameters.
	(interp_data, interp_name): Declare.
	* tui/tui-interp.c (tui_init): Adjust prototype.
	(tui_ui_out): New.
	(_initialize_tui_interp): Install tui_ui_out.  Don't instanciate
	tui_out here.  Adjust call to interp_new.
	* tui/tui-io.c (tui_initialize_io): Don't set current_uiout here.
	* cli/cli-interp.c (cli_interpreter_init): Adjust prototype.
	(cli_ui_out): New.
	(_initialize_cli_interp): Install it.  Adjust call to interp_new.
	* mi/mi-common.h (struct mi_interp) <uiout>: New field.
	* mi/mi-interp.c (mi_interpreter_init): Adjust prototype.
	Initialize mi->uiout depending on the mi_version as extracted from
	the interpreter's name.
	(mi_ui_out): New.
	(_initialize_mi_interp): Install mi_ui_out.  Adjust calls to
	interp_new.  Don't allocate the ui_out's of the interpreters here.

gdb/testsuite/
2011-09-12  Matt Rice  <ratmice@gmail.com>
	    Pedro Alves  <pedro@codesourcery.com>

	PR gdb/13175

	* gdb.base/interp.exp: New tests.
	* gdb.base/interp.c: New file.
2011-09-12 21:25:22 +00:00
Doug Evans 24ece742a0 * gdb.dwarf2/clztest.exp: Fix initialization of tests array.
* gdb.dwarf2/typeddwarf.exp: Ditto.
2011-09-12 18:07:22 +00:00
Jan Kratochvil 7f06221767 gdb/testsuite/
Fix compatibility with x32 arch.
	* testsuite/gdb.dwarf2/typeddwarf.exp: Check also is_lp64_target.
	* testsuite/gdb.trace/backtrace.exp: Use is_amd64_regs_target and
	is_x86_like_target.
	* testsuite/gdb.trace/collection.exp: Likewise.
	* testsuite/gdb.trace/report.exp: Likewise.
	* testsuite/gdb.trace/unavailable.exp: Likewise.
	* testsuite/gdb.trace/while-dyn.exp: Likewise.
	* testsuite/lib/gdb.exp (is_amd64_regs_target): New function.
	(is_x86_like_target): Check also is_amd64_regs_target.
2011-09-08 17:40:54 +00:00
Jan Kratochvil 08711b9a36 gdb/
PR breakpoints/12435
	* amd64-tdep.c (amd64_skip_prologue): New variables start_pc_sal,
	next_sal, buf, offset and xmmreg.  Advance PC if it sees the PR.
	* dwarf2read.c (process_full_comp_unit): Initialize
	amd64_prologue_line_bug.
	* symtab.h (struct symtab): New field amd64_prologue_line_bug.

gdb/testsuite/
	PR breakpoints/12435
	* gdb.arch/amd64-prologue-xmm.c: New file.
	* gdb.arch/amd64-prologue-xmm.exp: New file.
	* gdb.arch/amd64-prologue-xmm.s: New file.
2011-09-08 15:38:16 +00:00
Jan Kratochvil b99b5f66e1 gdb/
* stack.c (print_frame_args): New variable except.  Wrap
	read_var_value and common_val_print into TRY_CATCH.

gdb/testsuite/
	* gdb.dwarf2/dw2-param-error-main.c: New file.
	* gdb.dwarf2/dw2-param-error.S: New file.
	* gdb.dwarf2/dw2-param-error.exp: New file.
2011-09-08 15:24:25 +00:00
Pedro Alves a391a2f6df 2011-09-08 Pedro Alves <pedro@codesourcery.com>
* gdb.base/annota1.exp, gdb.base/annota3.exp: Extract the
	inferior's pid and look for a core dump named core.$pid.  Use
	`remote_file' commands on the host instead of hand coding shell
	commands on the build.
	* gdb.base/valgrind-db-attach.exp: Kill the program before
	finishing the test.
2011-09-08 14:56:34 +00:00
matt rice 7d8e6458d5 PR gdb/10720
* event-top.c (cli_command_loop): Replace readline setup with
direct call to display_gdb_prompt.
(display_gdb_prompt): Do not call observer mechanism during
synchronous execution.

testsuite:
* lib/prompt.exp: New file for testing the first prompt.
* gdb.python/py-prompt.exp: Ditto.
* gdb.python/py-prompt.c: Ditto (copy of ext-attach.c).
2011-09-02 21:16:54 +00:00
Pedro Alves 68e77c9e30 2011-09-02 Pedro Alves <pedro@codesourcery.com>
gdb/testsuite/
	* gdb.threads/gcore-thread.exp: Set the global core_supported to
	0, before testing gcore.
2011-09-02 19:21:02 +00:00
Jan Kratochvil df6dc84da9 gdb/testsuite/
* dw2-ifort-parameter-debug.S: Update copyright year.
	* dw2-ifort-parameter.c: Update copyright year.
	* dw2-ifort-parameter.exp: Update copyright year.

	* dw2-ifort-parameter-debug.S: New file.
	* dw2-ifort-parameter.c: New file.
	* dw2-ifort-parameter.exp: New file.
2011-09-01 07:19:40 +00:00
Jan Kratochvil 9655e94382 gdb/
Revert:
	2010-05-21  Pierre Muller  <muller@ics.u-strasbg.fr>
	* dwarf2read.c (new_symbol): Handle DW_AT_variable_parameter
	attribute.

gdb/testsuite/
	* dw2-ifort-parameter-debug.S: New file.
	* dw2-ifort-parameter.c: New file.
	* dw2-ifort-parameter.exp: New file.
2011-09-01 07:17:46 +00:00
Jan Kratochvil 353d1d731a gdb/
* breakpoint.c (bpstat_do_actions): New variable cleanup_if_error, call
	make_bpstat_clear_actions_cleanup and discard_cleanups for it.
	* defs.h (make_bpstat_clear_actions_cleanup): New declaration.
	* exceptions.c (throw_exception): Remove the bpstat_clear_actions call.
	* inf-loop.c (inferior_event_handler): New variable cleanup_if_error,
	call make_bpstat_clear_actions_cleanup and discard_cleanups for it.
	Call bpstat_clear_actions for failed fetch_inferior_event_wrapper.
	* infrun.c (fetch_inferior_event): Call
	make_bpstat_clear_actions_cleanup.
	* top.c (execute_command): New variable cleanup_if_error, call
	make_bpstat_clear_actions_cleanup and discard_cleanups for it.
	* utils.c (do_bpstat_clear_actions_cleanup)
	(make_bpstat_clear_actions_cleanup): New functions.

gdb/testsuite/
	* gdb.base/commands.exp (error_clears_commands_left): New function.
	(): Call it.
2011-08-26 21:45:24 +00:00
Jan Kratochvil 5c07461a74 gdb/testsuite/
* gdb.mi/mi-inheritance-syntax-error.cc (A): Make `a' public.
	(C): Initialize `a'.
	* gdb.mi/mi-inheritance-syntax-error.exp
	(-data-evaluate-expression $path):  Expect `a' as 5.
2011-08-26 21:11:08 +00:00
Marc Khouzam 0d932b2f8e 2011-08-26 Marc Khouzam <marc.khouzam@ericsson.com>
PR mi/11912
	* varobj.c (cplus_describe_child): Add the keyword
	'class' to the output of the method when dealing
	with a cast to a base class.

2011-08-26  Marc Khouzam  <marc.khouzam@ericsson.com>

	PR mi/11912
	* gdb.mi/mi-inheritance-syntax-error.cc: New file.
	* gdb.mi/mi-inheritance-syntax-error.exp: New file.
	* gdb.mi/mi-var-cp.cc: Updated for new 'class'
	keyword in output of -var-info-path-expression.
2011-08-26 12:32:59 +00:00
Jan Kratochvil bdb5404946 gdb/testsuite/
* gdb.trace/backtrace.exp: Use is_lp64_target to check 64bit target.
	* gdb.trace/collection.exp: Likewise.
	* gdb.trace/report.exp: Likewise.
	* gdb.trace/unavailable.exp: Likewise.
	* gdb.trace/while-dyn.exp: Likewise.
2011-08-26 09:20:44 +00:00
Keith Seitz 59cde39c1e * gdb.cp/meth-typedefs.cc: New file.
* gdb.cp/meth-typedefs.exp: New file.
2011-08-18 16:19:01 +00:00
Phil Muldoon fa3a4f150f 2011-08-17 Phil Muldoon <pmuldoon@redhat.com>
Tom Tromey  <tromey@redhat.com>
            Matt Rice <ratmice@gmail.com>

        * python/lib/gdb/prompt.py: New file.
        * python/lib/gdb/command/prompt.py: New file.
        * NEWS: Document set extended-prompt and gdb.prompt library

2011-08-17  Phil Muldoon  <pmuldoon@redhat.com>

        * gdb.texinfo (Prompt): Add set/show extended-prompt
        documentation
        (Basic Python): Add prompt_hook anchor.
        (Python modules): Reword module text to reflect multiple modules.
        (gdb.prompt): Document gdb.prompt module.

2011-08-17  Phil Muldoon  <pmuldoon@redhat.com>

        * gdb.python/python.exp: Add extended-prompt tests.
2011-08-17 10:41:22 +00:00
Jan Kratochvil c1049fca4e gdb/testsuite/
* gdb.arch/i386-dr3-watch.exp
	(watchpoint on gap1 does not fit debug registers)
	(delete all watchpoints): Fix racy expect strings.
2011-08-15 07:56:20 +00:00
Yao Qi d93f7b5c95 gdb/testsuite/
* gdb.base/maint.exp: set data_section to ".neardata".
	* gdb.base/savedregs.c (thrower): Trigger SIGILL on NO-MMU machine.
	* gdb.base/savedregs.exp: Handle SIGILL.
	* gdb.mi/mi-syn-frame.c (bar): Trigger SIGILL on NO-MMU machine.
	* gdb.xml/tdesc-regs.exp: Set core-regs for tic6x-*-*.
2011-08-14 15:58:40 +00:00
Doug Evans 457e09f060 * NEWS: Mention new "type" attribute of python gdb.Symbol objects.
* python/py-symbol.c (sympy_get_type): New function.
	(symbol_object_getset): Add "type".

	doc/
	* gdb.texinfo (Symbols In Python): Document symbol.type.

	testsuite/
	* gdb.python/py-symbol.exp: Add test for symbol.type.
2011-08-12 22:21:57 +00:00
Ulrich Weigand 5d0bb2fbbc * gdb.threads/pthreads.exp: Enable on non-native configurations.
* gdb.mi/mi-pthreads.exp: Likewise.
	* gdb.mi/mi2-pthreads.exp: Likewise.
	* gdb.mi/gdb669.exp.exp: Likewise.
2011-08-12 15:54:35 +00:00
Pedro Alves fcdfa2809a 2011-08-09 Pedro Alves <pedro@codesourcery.com>
gdb/testsuite/
	* lib/mi-support.exp (detect_async): Rename to...
	(mi_detect_async): ... this.
	* gdb.mi/mi-nonstop-exit.exp: Adjust.
	* gdb.mi/mi-nonstop.exp: Adjust.
	* gdb.mi/mi-ns-stale-regcache.exp: Adjust.
	* gdb.mi/mi-nsintrall.exp: Adjust.
	* gdb.mi/mi-nsmoribund.exp: Adjust.
	* gdb.mi/mi-nsthrexec.exp: Adjust.
2011-08-09 17:45:19 +00:00
Pedro Alves 9d8fa39233 2011-08-09 Pedro Alves <pedro@codesourcery.com>
gdb/
	* printcmd.c (current_display_number): Update comment.
	(disable_current_display_cleanup): Delete.
	(do_one_display): Use make_cleanup_restore_integer.  Gracefully
	catch errors thrown while evaluating and printing the display.

	gdb/testsuite/
	* gdb.base/display.c (do_loops): New `p_i' local.
	* gdb.base/display.exp: Test displaying a variable that is
	temporarily at a bad address.
2011-08-09 16:21:18 +00:00
Jan Kratochvil b6cede7829 gdb/
* dwarf2loc.c (dwarf2_evaluate_loc_desc_full) <DWARF_VALUE_STACK>
	(dwarf2_evaluate_loc_desc_full) <DWARF_VALUE_LITERAL>: New variable
	objfile_gdbarch.  Fix BFD_ENDIAN_BIG case.

gdb/testsuite/
	* gdb.dwarf2/dw2-op-stack-value.S: New file.
	* gdb.dwarf2/dw2-op-stack-value.exp: New file.
2011-08-08 21:41:14 +00:00
Jan Kratochvil 3c542bc312 gdb/testsuite/
* gdb.dwarf2/dw2-case-insensitive.exp (regexp case-sensitive off)
	(p fuNC_symtab): Permit also ppc64 leading dot.
2011-08-08 19:50:53 +00:00
Jan Kratochvil 67bedb8cb1 gdb/testsuite/
* gdb.dwarf2/dw2-simple-locdesc.S: Replace .value by .2byte.
2011-08-08 19:16:39 +00:00
Pedro Alves af6e93b2d1 gdb/
* exceptions.c (throw_exception): Don't disable the current
	display.
	* printcmd.c (disable_current_display_cleanup): New function.
	(do_one_display): Install a cleanup to disable the current display
	if doing the display throws.

	gdb/testsuite/
	* gdb.trace/unavailable.exp (test_maybe_regvar_display): New
	procedure.
	(gdb_collect_args_test, gdb_collect_locals_test): Use it.
2011-08-05 15:17:59 +00:00
Yao Qi 1cf0e11f28 gdb/testsuite/
* gdb.base/callfuncs.exp: Set language after main.
        * gdb.cp/cplusfuncs.exp: Likewise.
        * gdb.cp/inherit.exp: Likewise.
2011-08-05 09:41:27 +00:00
Ulrich Weigand a1e28cb2af * gdb.base/nostdlib.exp: Skip on gdb_stub targets.
* gdb.base/watch-vfork.exp: Skip on remote targets.
2011-08-04 15:00:50 +00:00
Ulrich Weigand d4f5bbb99f * gdb.threads/thread-find.exp: Support remote targets. 2011-08-04 12:49:33 +00:00
Ulrich Weigand 724f4f803f * gdb.base/jit.exp: Download solib_binfile to target.
* gdb.base/jit-so.exp:  Likewise.  Also, use gdb_load_shlibs
	and call dlopen without full path name.
	* gdb.cp/infcall-dlopen.exp: Use gdb_load_shlibs and call
	dlopen without full path name.
2011-08-04 11:56:29 +00:00
Philippe Waroquiers 934709f0f2 2011-08-03 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* breakpoint.c (update_global_location_list): Ensure
	invariant 'first loc marked not duplicated and inserted,
	following locs marked duplicated/not inserted' is respected
	for multiple locations at the same address.
	(unduplicated_should_be_inserted) New function.
	(swap_insertion) New function.

2011-08-03  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	* gdb.base/break-always.exp: Complete the test
	with duplicated breakpoints and enabling/disabling them.
2011-08-03 21:17:09 +00:00
Tom Tromey c26106c40a PR gdb/11289:
* gdb.cp/overload.exp: Fix regexps.  Remove kfails.
2011-08-02 20:59:44 +00:00
Paul Pluzhnikov 9300444e01 fix date of last checkin 2011-08-01 16:03:06 +00:00
Paul Pluzhnikov fbe12357d4 2011-08-01 Paul Pluzhnikov <ppluzhnikov@google.com>
PR gdb/13045
	* doublest.c (convert_doublest_to_floatformat): Pass correct
	mantissa length to put_field.

testsuite/ChangeLog:

2011-07-30  Paul Pluzhnikov  <ppluzhnikov@google.com>

	PR gdb/13045
	* gdb.base/float.exp: Add new test case for PR gdb/13045
	* gdb.base/float.c: New file.
2011-08-01 16:02:03 +00:00
Phil Muldoon 00bd41d6bc 2011-07-28 Phil Muldoon <pmuldoon@redhat.com>
* varobj.c (value_get_print_value): Move hint check later into the
	function.  Comment function.  Free thevalue before reusing it.

2011-07-28  Phil Muldoon  <pmuldoon@redhat.com>

	* gdb.python/py-mi.exp: Test printers returning string hint, and
	also not returning a value.
	* gdb.python/py-prettyprint.c: Add testcase for above.
	* gdb.python/py-prettyprint.py: Add test printer for above.
2011-07-28 10:36:40 +00:00
Jan Kratochvil d24f74ce45 gdb/testsuite/
* gdb.dwarf2/dw2-simple-locdesc.S: Change DWARF version to 3.
	(.Ldie26, .Ldie41, .Ldie4a, .Ldie54, .Ldie5b): Remove.
	(.Ldie30) Add as field "data4".
	(.Ldie32) Rename field "b" to "shl".
	(abbrev4) Change for the "data4" field.
	(abbrev5, abbrev6) Remove.
	* gdb.dwarf2/dw2-simple-locdesc.exp (p &s.b): Rename to ...
	(p &s.shl): ... here.  Add comment.
	(p &s.data4): New.
2011-07-27 21:18:40 +00:00
Jan Kratochvil bb7da2bfb5 gdb/
Fix crash on lval_computed values.
	* valops.c (value_zero): Use not_lval for lval_computed.

gdb/testsuite/
	Fix crash on lval_computed values.
	* gdb.dwarf2/implptr.exp (print sizeof (j[0])): New test.
2011-07-27 19:25:56 +00:00
Jan Kratochvil 11081198f1 gdb/
* typeprint.c (_initialize_typeprint): Extend the help of "whatis" and
	"ptype" by their typedefs difference.

gdb/testsuite/
	* gdb.base/help.exp (help whatis): Update the expected string.
2011-07-27 17:41:21 +00:00
Jan Kratochvil 3c6e0cb359 gdb/
* dwarf2expr.c (ctx_no_read_reg): New function.
	* dwarf2expr.h (ctx_no_read_reg): New declaration.
	* dwarf2read.c (read_2_signed_bytes, read_4_signed_bytes): Remove.
	(decode_locdesc_read_mem, decode_locdesc_ctx_funcs): New.
	(decode_locdesc): Replace by a caller of dwarf_expr_eval.

gdb/testsuite/
	* gdb.dwarf2/dw2-simple-locdesc.S: New file.
	* gdb.dwarf2/dw2-simple-locdesc.exp: New file.
	* gdb.dwarf2/dw2-stack-boundary.exp (check partial symtab errors):
	Change the expected string.
2011-07-27 17:08:06 +00:00
Pedro Alves efa80663c6 2011-07-26 Pedro Alves <pedro@codesourcery.com>
gdb/
	* breakpoint.c (works_in_software_mode_watchpoint): Also return
	true for software watchpoints.

	gdb/testsuite/
	* gdb.base/watchpoint.exp
	(test_disable_enable_software_watchpoint): New procedure.
	(top level): Run it.
2011-07-26 19:39:59 +00:00
Ulrich Weigand db8e457004 * gdb.python/py-mi.exp: Avoid '+' in filenames. Call C version of
executable file "${binfile}", C++ version "${binfile}-cxx".
	* gdb.python/py-prettyprint.exp: Likewise.
	* gdb.python/py-symbol.exp: Likewise.
	* gdb.python/py-type.exp: Likewise.
	* gdb.python/py-value.exp: Likewise.
	* gdb.python/py-template.exp (test_template_arg): Pass full executable
	file name instead of just suffix.
2011-07-26 18:38:55 +00:00
Jan Kratochvil 543305c9cd gdb/
Fix implicit pointer offsets.
	* dwarf2loc.c (indirect_pieced_value): Comment byte_offset.  Use also
	ptr.OFFSET.

gdb/testsuite/
	Fix implicit pointer offsets.
	* gdb.dwarf2/implptr.c (add): New marker baz breakpoint.
	* gdb.dwarf2/implptr.exp (set baz breakpoint for implptr)
	(continue to breakpoint: continue to baz breakpoint for implptr)
	(sanity check element 0, sanity check element 1)
	(enter the inlined function, check element 0 for the offset)
	(check element 1 for the offset)
	(continue to breakpoint: ignore the second baz breakpoint): New tests.
	(set foo breakpoint for implptr): Update the breakpoint number.
2011-07-25 16:04:53 +00:00
Ulrich Weigand b3215adc06 * gdb.python/py-mi.exp: Use different file names for different
versions of the executable under test.
	* gdb.python/py-prettyprint.exp: Likewise.
	* gdb.python/py-symbol.exp: Likewise.
	* gdb.python/py-template.exp: Likewise.
	* gdb.python/py-type.exp: Likewise.
	* gdb.python/py-value.exp: Likewise.
2011-07-22 18:01:43 +00:00
Ulrich Weigand 182b9acc4b * gdb.python/py-breakpoint.exp: Re-set can-use-hw-watchpoints
flag after restarting GDB if necessary.
2011-07-22 17:46:18 +00:00
Ulrich Weigand e6052b5dd3 * gdb.python/py-shared.exp: Call gdb_load_shlibs. 2011-07-22 17:45:16 +00:00
Pedro Alves 1ced966e34 2011-07-22 Pedro Alves <pedro@codesourcery.com>
gdb/testsuite/
	* gdb.arch/i386-dr3-watch.exp: Test that the i386 watchpoints
	backend doesn't leave used debug registers behind.

	gdb/gdbserver/
	* i386-low.c (i386_insert_aligned_watchpoint): Don't pass the info
	to the inferior here.
	(i386_remove_aligned_watchpoint): Ditto.
	(i386_handle_nonaligned_watchpoint): Return immediate on fail to
	fit part of the watchpoint in the debug registers.
	(i386_update_inferior_debug_regs): New.
	(i386_low_insert_watchpoint): Work on a local mirror of the debug
	registers, and only update the inferior on success.
	(i386_low_remove_watchpoint): Ditto.

	gdb/
	* i386-nat.c (I386_DR_VACANT, I386_DR_LOCAL_ENABLE)
	(I386_DR_GLOBAL_ENABLE, I386_DR_DISABLE, I386_DR_SET_RW_LEN)
	(I386_DR_GET_RW_LEN, I386_DR_WATCH_HIT): Add state parameter and
	adjust.
	(dr_mirror, dr_status_mirror, dr_control_mirror): Delete.
	(struct i386_debug_reg_state): New.
	(i386_init_dregs): New.
	(dr_mirror): New.
	(i386_cleanup_dregs): Use i386_init_dregs.
	(i386_show_dr): Add state parameter and adjust.
	(i386_insert_aligned_watchpoint): Ditto.  Don't pass the info to
	the inferior here.
	(i386_remove_aligned_watchpoint): Likewise.
	(i386_handle_nonaligned_watchpoint): Add state parameter and adjust.
	(i386_update_inferior_debug_regs): New.
	(i386_insert_watchpoint): Work on a local mirror of the debug
	registers, and only update the inferior on success.
	(i386_remove_watchpoint): Ditto.
	(i386_region_ok_for_watchpoint): Adjust.
	(i386_stopped_data_address): Adjust.
	(i386_insert_hw_breakpoint): Adjust.
	(i386_remove_hw_breakpoint): Adjust.
2011-07-22 16:58:32 +00:00
Tom Tromey 3543a589b2 gdb
* amd64-tdep.c (amd64_pseudo_register_read_value): Rename
	from amd64_pseudo_register_read.  Change arguments.  Call
	mark_value_bytes_unavailable when needed.
	(amd64_init_abi): Use set_gdbarch_pseudo_register_read_value, not
	set_gdbarch_pseudo_register_read.
	* sentinel-frame.c (sentinel_frame_prev_register): Use
	regcache_cooked_read_value.
	* regcache.h (regcache_cooked_read_value): Declare.
	* regcache.c (regcache_cooked_read_value): New function.
	(regcache_cooked_read): Call
	gdbarch_pseudo_register_read_value if available.
	* i386-tdep.h (i386_pseudo_register_read_value): Declare.
	(i386_pseudo_register_read): Remove.
	* i386-tdep.c (i386_pseudo_register_read_into_value): Rename from
	i386_pseudo_register_read.  Change arguments.  Call
	mark_value_bytes_unavailable when needed.
	(i386_pseudo_register_read_value): New function.
	(i386_gdbarch_init): Call set_gdbarch_pseudo_register_read_value,
	not set_gdbarch_pseudo_register_read.
	* gdbarch.sh (pseudo_register_read_value): New method.
	* gdbarch.c, gdbarch.h: Rebuild.
	* findvar.c (value_from_register): Call get_frame_register_value.
gdb/testsuite
	* gdb.dwarf2/typeddwarf.c: XFAIL 'z' on x86-64.
	* gdb.dwarf2/typeddwarf.exp (xfail-gdb-test): Add arch_pattern
	argument.
	* gdb.dwarf2/typeddwarf-amd64.S: New file.
2011-07-22 15:31:52 +00:00
matt rice 14d1530353 * gdb.threads/Makefile.in: Avoid globbing corethreads.exp
in mostlyclean rule.  Add files ending in .core.
2011-07-22 01:05:24 +00:00
matt rice 9b158ba08e PR macros/12999
* macrotab.h (macro_callback_fn): Add new arguments to callback.
* macrotab.c (foreach_macro): Ditto.
(foreach_macro_in_scope): Ditto.
* macrocmd.c (print_macro_callback): New function.
(info_macro_command): Move some code to print_macro_definition.
(print_macro_definition): New function.
(print_one_macro): Add new arguments to callback.

testsuite/
* gdb.base/info-macros.c: New test sources.
* gdb.base/info-macros.exp: New tests.

docs/
* gdb.texinfo (Macros): Add info definitions and info macros commands.
Update text and cindex entries for info macro command.
2011-07-21 15:13:30 +00:00
Phil Muldoon d17b6f8101 2011-07-21 Phil Muldoon <pmuldoon@redhat.com>
Tom Tromey  <tromey@redhat.com>

	* top.c (set_prompt): Rewrite to free previous prompt, free
	asynch_new_prompt and set both on new prompts.
	* event-top.c (display_gdb_prompt): Add prompt substitution
	logic.
	* python/python.c (before_prompt_hook): New function.

2011-07-21  Phil Muldoon  <pmuldoon@redhat.com>

	* gdb.python/python.exp: Add prompt substitution tests.

2011-07-21  Phil Muldoon  <pmuldoon@redhat.com>

	* observer.texi (GDB Observers): Add before_prompt observer.
	* gdb.texinfo (Basic Python): Add documentation for prompt
	substitution.
2011-07-21 11:03:48 +00:00
Jan Kratochvil 918dd91059 gdb/
Fix crash if referenced CU is aged out.
	* dwarf2loc.c (per_cu_dwarf_call): New variable back_to, use to for
	xfree of block.data.
	(indirect_pieced_value): New variable back_to, use to for xfree of
	baton.data.
	(dwarf2_compile_expr_to_ax): New variable back_to, use to for xfree of
	block.data.
	* dwarf2read.c (dwarf2_find_base_address): New prototype.
	(load_cu): New function from ...
	(dw2_do_instantiate_symtab): ... the code here ...
	(process_full_comp_unit): ... and here.
	(dwarf2_fetch_die_location_block): Call load_cu first.  Call xmemdup on
	retval.data.

gdb/testsuite/
	Fix crash if referenced CU is aged out.
	* gdb.dwarf2/dw2-op-call.exp (maintenance set dwarf2 max-cache-age 0):
	New.
	* gdb.dwarf2/implptr.exp: Likewise.
2011-07-19 20:28:52 +00:00
Jan Kratochvil 0e37a63c3c gdb/
* dwarf2loc.c (indirect_pieced_value): Use check_typedef for VALUE's
	type.

gdb/testsuite/
	* gdb.dwarf2/implptr.S: Rebuilt.
	* gdb.dwarf2/implptr.c (intp, intpp, intppp): New typedefs.
	(bar): Use them for j, k, l.
	* gdb.dwarf2/implptr.exp: New variable opts.  Support runtest parameter
	COMPILE.
	(print j in implptr:bar): Update for the intp typedef.
	(print p[0].x in implptr:foo): Use more exact regex.
2011-07-19 20:25:14 +00:00
Tom Tromey f65cf84c3e * gdb.cp/static-method.exp: Add missing single quote. 2011-07-18 15:15:06 +00:00
Yao Qi d5b4a7be2c gdb/testsuite/
* gdb.base/async-shell.exp: Skip test if displaced stepping is not
	supported.
	* gdb.mi/mi-nonstop-exit.exp: Likewise.
	* gdb.mi/mi-nonstop.exp: Likewise.
	* gdb.mi/mi-ns-stale-regcache.exp: Likewise.
	* gdb.mi/mi-nsintrall.exp: Likewise.
	* gdb.mi/mi-nsmoribund.exp: Likewise.
	* gdb.mi/mi-nsthrexec.exp: Likewise.
	* gdb.python/py-evthreads.exp: Likewise.
2011-07-18 04:14:21 +00:00
Jan Kratochvil e9ea266294 gdb/testsuite/
Code cleanup.
	* gdb.cp/namespace.exp (xfail_class_types): New variable.  Initialize
	it.  Substitute it instead of test_compiler_info everywhere.
2011-07-15 18:46:10 +00:00
Ulrich Weigand ce4515734c * gdb.base/type-opaque.exp: Use gdb_load_shlibs. Run test on
remote targets as well.
2011-07-15 14:13:00 +00:00
Ulrich Weigand 756d88a7fe * lib/gdb.exp (gdb_compile_shlib_pthreads): New helper.
* gdb.threads/tls-shared.exp: Use it.  Call gdb_load_shlibs.
2011-07-15 14:11:22 +00:00
Ulrich Weigand 31f83dc55a * lib/gdb.exp (gdb_compile): Specify rpath if the *target* is
a remote machine, not the host.
	(gdb_compile_shlib): Set soname if target is remote.
2011-07-15 14:10:26 +00:00
Paul Pluzhnikov df46027df1 Cleanup: kill trailing whitespace 2011-07-14 16:41:56 +00:00
Paul Pluzhnikov 059241a073 2011-07-14 Paul Pluzhnikov <ppluzhnikov@google.com>
* gdb.cp/minsym-fallback.exp: Link in C++ mode.
2011-07-14 16:33:21 +00:00
matt rice 28a0b48c48 * gdb.python/py-objfile-script-gdb.py: Renamed to
py-objfile-script-gdb.py.in.
* gdb.python/py-objfile-script-gdb.py.in: Renamed from
py-objfile-script-gdb.py.
* gdb.python/py-objfile-script.exp: Update reference to
py-objfile-script-gdb.py.
2011-07-13 17:00:56 +00:00
Jan Kratochvil 9a771b671f gdb/testsuite/
* gdb.dwarf2/dw2-op-call.S (array1): Use the real label; do not
	reference undefined label.
2011-07-13 15:18:13 +00:00
Jan Kratochvil 04ad99e60b gdb/
* dwarf2expr.c (read_sleb128): Fix signed extension overflowing host
	`int'.

gdb/testsuite/
	* gdb.dwarf2/dw2-const.S (Pointer size): Change from 4 to 8.
	(DW_AT_high_pc, DW_AT_low_pc): Remove them.
	(val8, .Ltype_const8, .Ltype_int8, DW_TAG_variable): New.
	* gdb.dwarf2/dw2-const.exp (print/x val8): New test.
2011-07-11 13:40:24 +00:00
Phil Muldoon 713389e024 2011-07-11 Phil Muldoon <pmuldoon@redhat.com>
PR python/12438
	* python/python.c: Set gdbpy_should_print_stack default to off.
	(set_python): Deprecate maint set python print-stack to
	class_deprecate.
	(_initialize_python): Deprecate maint set/show python print-stack.
	Add new prefix command, python.  Add new setting, print-backtrace.
	* NEWS: Document set python print-stack.  Document default change.

2011-07-11  Phil Muldoon  <pmuldoon@redhat.com>

        PR python/12438
	* gdb.texinfo (Python Commands): Add deprecate note to maint
          set/show python print-stack.  Document set/show python
          print-backtrace.

2011-07-11  Phil Muldoon  <pmuldoon@redhat.com>

        PR python/12438
	* gdb.python/python.exp: Add maint set/show python print-stack
          deprecated tests.  Add set/show python print-backtrace tests.
2011-07-11 13:07:38 +00:00
Jan Kratochvil 97d146f805 gdb/testsuite/
* gdb.java/jprint.exp (print a java.lang.String): xfail without system
	debug info.
2011-07-07 14:08:21 +00:00
matt rice facde0e593 gdb.python/python.exp: Update filename paths.
gdb.python/py-symtab.exp: Ditto.
2011-07-06 22:15:02 +00:00
Joel Brobecker 3b2a0cf216 Fix JIT clang-lli regression (unable to read JIT descriptor from memory)
2011-07-06  Paul Pluzhnikov  <ppluzhnikov@google.com>

        * jit.c (jit_inferior_init): Forward declare.
        (jit_breakpoint_re_set_internal): Call jit_inferior_init.

testsuite/ChangeLog:

2011-07-06  Paul Pluzhnikov  <ppluzhnikov@google.com>

        * gdb.base/jit-so.exp: New test.
        * gdb.base/jit-dlmain.c: New file.
        * gdb.base/jit-main.c: Allow "main" to be elsewhere.
2011-07-06 21:40:17 +00:00
Marek Polacek 438640d112 gdb.python/py-evthreads.exp: add missing $ 2011-07-06 19:52:21 +00:00
Mike Frysinger 33a365dfad gdb: testsuite: add Blackfin support
This fills out a few of the test places where needed for Blackfin targets.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-06 18:40:30 +00:00
Marek Polacek 8f7ae68682 Fix race in gdb.python/py-evthreads.exp 2011-07-06 15:00:15 +00:00
Tom Tromey eb2a6f420b gdb
* gnu-v3-abi.c (gnuv3_rtti_type): Check TYPE_CPLUS_REALLY_JAVA.
	* gdbtypes.h (struct cplus_struct_type) <is_java>: New field.
	(TYPE_CPLUS_REALLY_JAVA): New macro.
	* dwarf2read.c (process_structure_scope): Set
	TYPE_CPLUS_REALLY_JAVA.
gdb/testsuite
	* gdb.java/jprint.java (jprint.hi): New field.
	* gdb.java/jprint.exp: Print string.
2011-07-05 13:36:42 +00:00
Thiago Jung Bauermann 177b42fefa gdb/
* ada-lang.c: Fix typos.
	* amd64-tdep.c: Likewise.
	* breakpoint.c: Likewise.
	* cli/cli-decode.c: Likewise.
	* findcmd.c: Likewise.
	* inline-frame.c: Likewise.
	* mi/mi-main.c: Likewise.
	* minsyms.c: Likewise.
	* monitor.c: Likewise.
	* monitor.h: Likewise.
	* prologue-value.c: Likewise.
	* reverse.c: Likewise.
	* s390-tdep.c: Likewise.

gdb/testsuite/
	* gdb.base/call-sc.c: Likewise.
	* gdb.base/ifelse.exp: Likewise.
	* gdb.base/structs.c: Likewise.

gdb/doc/
	* gdb.texinfo: Likewise.
2011-07-05 04:35:00 +00:00
Jan Kratochvil e17476d75f gdb/testsuite/
* gdb.cp/m-static.exp: Call get_compiler_info.
	(static const int initialized nowhere): Call setup_xfail for gcc <= 4.4.
	* gdb.cp/pr9167.exp (p b): Likewise.
	* gdb.cp/temargs.exp: Do not set have_pr_45024_fixed for gcc 4.6.
	(test value of P in inner_m, test type of Z in inner_m): Call
	setup_xfail for gcc <= 4.5.
2011-07-02 15:13:13 +00:00
Jan Kratochvil 46fc714c1b gdb/testsuite/
* gdb.cp/m-static.exp: Call get_compiler_info.
	(static const int initialized nowhere): Call setup_xfail for gcc<=4.4.
2011-07-02 12:08:44 +00:00
Jan Kratochvil 418c7cf761 gdb/
* linespec.c (find_method): Accept the function type automatically only
	if it was specified with parameter types.

gdb/testsuite/
	* gdb.cp/paren-type.cc: New files.
	* gdb.cp/paren-type.exp: New files.
2011-07-01 20:27:59 +00:00
Jan Kratochvil 3d50dd94cb gdb/
Stop on first linespec terminator instead of eating what we can.
	* linespec.c (is_linespec_boundary): New function.
	(name_end): Remove function.
	(keep_name_info): New parameter on_boundary, replace the body.
	(decode_line_1): Provide the parameter to keep_name_info.
	(decode_compound): Likewise.  Drop the trailing java return type
	handling.  Twice.

gdb/testsuite/
	Stop on first linespec terminator instead of eating what we can.
	* gdb.cp/minsym-fallback-main.cc (main): Call also C::operator ().
	* gdb.cp/minsym-fallback.cc (C::operator ()): Define.
	* gdb.cp/minsym-fallback.exp (break 'C::f()'): Change to ...
	(break C::f()): ... this one.
	(break C::operator()()): New test.
	* gdb.cp/minsym-fallback.h (C::operator ()): Declare.
	* gdb.java/jmisc.exp (break jmisc.main(java.lang.String[])int): New
	test.
2011-07-01 20:19:04 +00:00
Jan Kratochvil dcf9f4ab7f gdb/
Fall back linespec to minimal symbols.
	* linespec.c (decode_line_1): New variable ex, saved_argptr.  Protect
	decode_compound by TRY_CATCH, fall back on minsyms if it failed.
	(find_method, symbol_found): Change error to cplusplus_error.

gdb/testsuite/
	Fall back linespec to minimal symbols.
	* gdb.base/psymtab.exp (Don't search past end of psymtab.): Update the
	error message.
	* gdb.cp/cplusfuncs.exp (list foo::operator int*): Likewise.
	* gdb.cp/minsym-fallback-main.cc: New file.
	* gdb.cp/minsym-fallback.cc: New file.
	* gdb.cp/minsym-fallback.exp: New file.
	* gdb.cp/minsym-fallback.h: New file.
2011-07-01 20:16:39 +00:00
Jan Kratochvil 3f542ed1a3 gdb/
* symtab.c (symbol_find_demangled_name): Likewise.

gdb/testsuite/
	* gdb.cp/no-dmgl-verbose.cc: New file.
	* gdb.cp/no-dmgl-verbose.exp: New file.
2011-07-01 19:18:36 +00:00
Jan Kratochvil 900e11f9ec gdb/
* dwarf2read.c (check_physname): New variable.
	(dwarf2_physname): Prefer DW_AT_linkage_name over dwarf2_compute_name.
	(show_check_physname): New function.
	(_initialize_dwarf2_read): Add `check-physname' for check_physname.

gdb/doc/
	* gdb.texinfo (Debugging Output): Document set debug
	check-physname.

gdb/testsuite/
	* gdb.base/break-interp.exp (reach_1, test_ld): Allow also the prefix
	__GI_.
	* gdb.cp/psymtab-parameter.cc (func): Make it a template function.
	(f): New function.
	* gdb.cp/psymtab-parameter.exp (complete break 'func(): Rename to ...
	(complete p 'func<short>(): ... here.
	* gdb.dwarf2/dw2-linkage-name-trust-main.cc: New file.
	* gdb.dwarf2/dw2-linkage-name-trust.S: New file.
	* gdb.dwarf2/dw2-linkage-name-trust.exp: New file.
	* gdb.cp/temargs.exp (test type of F in k3_m, test value of F in k3_m):
	Make them KFAIL gcc/49546.
2011-07-01 19:12:12 +00:00
Joel Brobecker 00eb2c4ae8 bettter display for temporary Ada exception catchpoints
Temporary catchpoints on Ada exceptions are now displayed as "Temporary
catchpoint" as opposed to just "Catchpoint".  This is cosmetic only, but
in line with what's done for other catchpoints as well as breakpoints.

gdb/ChangeLog:

        * ada-lang.c (print_it_exception): Print temporary catchpoints
        as "Temporary catchpoint".
        (print_mention_exception): Likewise.

gdb/testsuite/ChangeLog:

        * gdb.ada/catch_ex.exp: Add temporary catchpoint tests.
2011-07-01 18:35:36 +00:00
Jan Kratochvil 85a20c42ea gdb/testsuite/
Test GCC PR debug/49546.
	* gdb.cp/temargs.exp (set sixth breakpoint for temargs)
	(test type of F in k3_m, test value of F in k3_m): New.
	* gdb.cp/temargs.cc (struct S3, struct K3): New.
	(main): New variable k3.  Call k3.k3_m.
2011-07-01 18:32:06 +00:00
Joel Brobecker d2d43431e8 Fix printing address of packed array
When trying to print the address of a non-packed array, GDB
correctly prints the type name and address:

    (gdb) print &var
    $2 = (access pa.var) 0xbffff1d8

However, it is behaving differently when dealing with a packed
array:

    (gdb) p &var
    (access array (4 .. 8) of boolean <packed: 1-bit elements>) (4 =>
    false, false, false, true, false)

The type description isn't all that bad, but GDB shouldn't be
printing the array value!

This patch fixes the `print` and `ptype` command on packed and
non-packed array.  It also fixes a gdb.ada test to match with
the new ouput.

gdb/ChangeLog (Jean-Charles Delay):

        * ada-typeprint.c (ada_print_type): Fix both PAD type and
        pointer to constrained packed array type output.
        * ada-valprint.c (ada_val_print_1): Fix pointer to constrained
        packed array output.

gdb/testsuite/ChangeLog (Jean-Charles Delay):

        * gdb.ada/packed_array.exp: Fix expected outout.
2011-07-01 18:27:25 +00:00
Joel Brobecker 54ae186fb5 Fix ada array bounds display
Array bounds were not correctly displayed when the SHOW parameter of
print_type functions is set to -1.  This shows up in the following
type of situation, where we have a declaration as follow:

    Anon_Array_Int_Obj : array (1..10) of Integer := (others => 8);

In GDB/MI mode, trying to print the type info for our array object
yields:

    (gdb) -var-create ai 0 Anon_Array_Int_Obj
    (gdb) -var-info-type ai
    ^done,type="array (...) of integer"

The actual bounds are missing.  Contrast this with what happens
when in GDB/CLI mode:

    (gdb) ptype Anon_Array_Int_Obj
    type = array (1 .. 10) of integer

This patch fixes array type printing accordingly. And as it turns
out, it also improves the output for one of the tests already present,
so it shows that it's not just the GDB/MI mode that's affected.

gdb/ChangeLog (Jean-Charles Delay):

	* ada-typeprint.c (print_array_type): removed if condition on show
	being negative for bounds printing.

gdb/testsuite/ChangeLog (Jean-Charles Delay):

	* gdb.ada/packed_array.exp: fixed expected output.
2011-07-01 18:27:12 +00:00
Joel Brobecker 8f17729f21 treat identical enum types as the same type
This is to avoid an unnecessary multiple-choice menu for an
expression involving an enumeral declared in two types, when
the second type is an identical copy of the first type. This
happens in the following situation:

       type Color is (Black, Red, Green, Blue, White);
       type RGB_Color is new Color range Red .. Blue;

In that case, an implict type is created, and is used as the base
type for type RGB_Color.  This base type is a copy of type Color.
We've added some extensive comments explaining the situation and
our approach further.

gdb/ChangeLog:

        * ada-lang.c (ada_identical_enum_types_p): New function.
        (symbols_are_identical_enums): New function.
        (remove_extra_symbols): Do nothing if NSYMS < 2.
        Use symbols_are_identical_enums.

gdb/testsuite/ChangeLog:

        * gdb.ada/same_enum: New testcase.
2011-07-01 18:26:50 +00:00
Joel Brobecker f5aa6869de missing type description for typedef to pointer value
If we evaluate an expression that results in a value that is a typedef
to pointer, then the debugger fails to print the type description
before printing the actual value:

    (gdb) print e.plan(1)
    $1 = 0x0

The expected output is:

    (gdb) print e.plan(1)
    $1 = (access integer) 0x0

gdb/ChangeLog:

        * ada-valprint.c (ada_value_print): Handle typedefs.

gdb/testsuite/ChangeLog:

        * gdb.ada/ptr_typedef: New testcase.
2011-07-01 18:26:22 +00:00
Joel Brobecker 828292f271 variables whose type is a typedef to an array pointer
If we declare a type as being an access to array type, and then
declare a variable of that type, for instance:

        type Some_Array is array [...];
        type Array_Access is access all Some_Array;
        Table : Array_Access := [...];

The variable "Table" may be defined in the debugging information
as being a typedef to the array pointer type. In the past, it was
defined directly as the array pointer type, but this has been changed
to make sure that the typedef type gets used.

If the typedef type wasn't used, it would allow the compiler to stop
emitting that typedef type when compiling with
-feliminate-unused-debug-types.  The removal of this typedef would
be a problem, because GDB relies on the typedef to create symbols
for pointer types, and without it, we would no longer be able to
do "ptype array_access".

This patch helps prevent incorrect output or even crashes when that
extra typedef layer is used.

The testing is already mostly covered by arrayptr.exp, but I still
added a 'ptype' test, just for good measure.

gdb/ChangeLog: (Eric Botcazou)

        * ada-lang.c (thin_descriptor_type): Deal with typedefs.
        (decode_constrained_packed_array): Likewise.
        (ada_evaluate_subexp) <TERNOP_SLICE>: Likewise.

gdb/testsuite/ChangeLog (Joel Brobecker):

        * gdb.ada/arrayptr.exp: Add ptype test.
2011-07-01 18:25:49 +00:00
Joel Brobecker 3536d9e3f5 Fix date in testsuite/ChangeLog entry. 2011-07-01 18:25:33 +00:00
Joel Brobecker 18920c4226 handle character-based enumeration typedefs
Consider the following type:

   type Char_Enum_Type is ('A', 'B', 'C', 'D');

If the compiler generates a Char_Enum_Type typedef in the debugging
information, the debugger fails in the following case:

   (gdb) p Char_Enum_Type'('B')
   $1 = 66

For our type, the underlying value of 'B' is actually 1, not 66
(ASCII 'B').  We are failing this case because we were not handling
typedef to enum types before.  This patch fixes this.

gdb/ChangeLog:

        * ada-exp.y (convert_char_literal): Handle typedef types.

gdb/testsuite/ChangeLog:

        * gdb.ada/char_enum: New testcase.
2011-07-01 18:25:17 +00:00
Yao Qi 54aeeb996d 2011-07-02 Yao Qi <yao@codesourcery.com>
* gdb.base/dump.exp (capture_pointer_with_type): New.
	Get value from address instead of name.
	Start GDB once, and do `dump' and `restore'
	tests together.
2011-07-01 16:42:42 +00:00
Mike Frysinger db863c4274 gdb: tests: set remotetimeout to gdb_load_timeout for remote targets
Rather than relying on the default remotetimeout value (which might be
too small for some slower devices), use the existing gdb_load_timeout
config option to set it.

This adds two new helpers for getting/setting the remotetimout to keep
the new logic simple.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-01 00:19:25 +00:00
Andrew Burgess e9e642a83f http://sourceware.org/ml/gdb-patches/2011-06/msg00442.html
Don't compile c++ tests for platforms that don't support c++.
2011-06-30 08:53:38 +00:00
Jan Kratochvil 32019081a7 gdb/
Fix non-only rename list for Fortran modules import.
	* cp-namespace.c (cp_scan_for_anonymous_namespaces): Adjust the
	cp_add_using_directive caller.
	(cp_add_using_directive): New parameter excludes, describe it.  New
	variables ix and param.  Compare if also excludes match.  Allocate NEW
	with variable size, initialize EXCLUDES there.
	(cp_lookup_symbol_imports): New variable excludep, test
	current->EXCLUDES with it.
	* cp-support.h: Include vec.h.
	(struct using_direct): New field excludes, describe it.
	(DEF_VEC_P (const_char_ptr)): New.
	(cp_add_using_directive): New parameter excludes.
	* defs.h (const_char_ptr): New typedef.
	* dwarf2read.c (read_import_statement): New variables child_die,
	excludes and cleanups, read in excludes.
	(read_namespace): Adjust the cp_add_using_directive caller.

gdb/testsuite/
	Fix non-only rename list for Fortran modules import.
	* gdb.fortran/module.exp (print var_x, print var_y, print var_z): New
	tests.
	* gdb.fortran/module.f90 (module moduse): New.
	(program module): use moduse, test var_x, var_y and var_z.
2011-06-29 22:05:16 +00:00
Tom Tromey 0ecee54cfd PR testsuite/12040:
* gdb.fortran/array-element.exp: Use f90, not f77.
	* gdb.fortran/complex.exp: Use f90, not f77.
	* gdb.fortran/derived-type.exp: Use f90, not f77.
	* gdb.fortran/library-module.exp: Use f90, not f77.
	* gdb.fortran/logical.exp: Use f90, not f77.
	* gdb.fortran/module.exp: Use f90, not f77.
	* gdb.fortran/multi-dim.exp: Use f90, not f77.
	* gdb.fortran/subarray.exp: Use f90, not f77.
2011-06-29 17:50:47 +00:00
Tom Tromey 3b2b8feaf4 gdb
PR fortran/10036:
	* valprint.h (generic_emit_char, generic_printstr): Declare.
	* valprint.c (wchar_printable, append_string_as_wide)
	(print_wchar): Move from c-lang.c.
	(generic_emit_char): New function; mostly taken from c_emit_char.
	(generic_printstr): New function; mostly taken from c_printstr.
	* f-valprint.c (f_val_print) <TYPE_CODE_ARRAY>: Handle strings
	represented as arrays.
	<TYPE_CODE_CHAR>: Treat as TYPE_CODE_INT; recognize as character
	type.
	* f-typeprint.c (f_type_print_base) <TYPE_CODE_CHAR>: Treat
	identically to TYPE_CODE_INT.
	* f-lang.c (f_get_encoding): New function.
	(f_emit_char): Use generic_emit_char.
	(f_printchar): Replace comment.
	(f_printstr): Use generic_printstr.
	* dwarf2read.c (read_base_type) <DW_ATE_unsigned>: Handle Fortran
	"character" types specially.
	<DW_ATE_signed_char, DW_ATE_unsigned_char>: Make TYPE_CODE_CHAR
	for Fortran.
	* c-lang.c (wchar_printable, append_string_as_wide, print_wchar):
	Move to valprint.c
	(c_emit_char): Call generic_emit_char.
	(c_printstr): Call generic_printstr.
gdb/testsuite
	* gdb.fortran/charset.exp: New file.
	* gdb.fortran/charset.f90: New file.
2011-06-29 15:32:40 +00:00
Tom Tromey 42159ca500 PR testsuite/12040:
* lib/future.exp: New file, mostly extracted from ada.exp.
	Rewrote compatibility code to use rename.
	(gdb_find_gfortran): New proc.
	(gdb_default_target_compile): Refresh from dejagnu; plus a pending
	gfortran patch.
	* lib/ada.exp (gdb_find_gnatmake, gdb_default_target_compile):
	Move to future.exp.
	* lib/gdb.exp: Always load future.exp.
2011-06-29 14:44:45 +00:00
Yao Qi af69a5cef7 2011-06-28 Yao Qi <yao@codesourcery.com>
* gdb.cp/exception.cc: Don't include iostream.
	(bar): Remove print statement.
	(catcher): New.
	(main): Remove print statements.  Call function catcher.
	* gdb.cp/exception.exp : Don't match inferior's output in regexp.
	Set breakpoint on catcher, and check the value of parameter.
2011-06-28 08:36:18 +00:00
Yao Qi ab5c6a729c 2011-06-23 Yao Qi <yao@codesourcery.com>
* gdb.cp/mb-inline.exp: Parse the output of `info break' to check breakpoint
	1.2 is disabled.  KFAIL for uclinux.
2011-06-23 14:38:13 +00:00
Marek Polacek 9497469fbd Fix races in mi2-var-display.exp. 2011-06-23 09:51:11 +00:00
Marek Polacek 5d197ed097 Fix races in mi2-return.exp. 2011-06-23 09:45:24 +00:00
Marek Polacek b9132588e0 Fix races in mi2-console.exp. 2011-06-23 09:40:50 +00:00
Marek Polacek e55595cad5 Fix races in mi2-basics.exp. 2011-06-23 09:38:14 +00:00
Yao Qi be777e08f4 gdb/testsuite/
* gdb.base/moribund-step.exp: Skip test if displaced stepping is not
	supported.
	* lib/gdb.exp (support_displaced_stepping): New.
2011-06-23 07:46:13 +00:00
Yao Qi 615556d61e 2011-06-23 Yao Qi <yao@codesourcery.com>
* gdb.threads/execl.exp: Skip on remote target.
2011-06-23 06:26:28 +00:00
Marek Polacek 833b0ca776 Fix races in gdb.mi/mi-var-display.exp. 2011-06-22 16:12:46 +00:00
Marek Polacek 1ee4023ae3 Fix races in gdb.mi/mi-nsitrall.exp. 2011-06-22 15:41:47 +00:00
Marek Polacek d0b1d6240c Fix races in gdb.mi/mi-nsmoribund.exp. 2011-06-22 15:38:00 +00:00
Marek Polacek 79aa92c124 Fix races in gdb.mi/mi-return.exp. 2011-06-22 15:32:16 +00:00
Yao Qi 5ce5db06f1 gdb/testsuite/
* gdb.threads/ia64-sigill.exp: Remove "set debug lin-lwp 1".
2011-06-14 08:03:32 +00:00
Jan Kratochvil 533a737ed5 gdb/
* symtab.c (output_partial_symbol_filename): Exchange the filename and
	fullname parameters order.

gdb/testsuite/
	* gdb.dwarf2/dw2-filename.exp (info sources): New testcase.
2011-06-10 21:50:55 +00:00
Tom Tromey d0e53741e0 * gdb.cp/temargs.exp: Let tests pass if compiler bug is fixed.
Add tests for pointer-to-member-function.
	* gdb.cp/temargs.cc (S::somefunc): New function.
	(K2): New class.
	(main): Instantiate K2; call method.
2011-06-10 16:21:47 +00:00
Joel Brobecker b5916bbd42 py-inferior.exp: Make sure local var is allocated on the stack.
The testcase, at some point, is trying to change the contents
of a string that was defined as follow:

    char *str = "hello, testsuite";

The problem is that the string is constant, and str is never used
to change the contents of the string in the program, so the compiler
is free to allocate it in a read-only section.  This is what happens
on x86-windows, for instance.

As a result, trying to change the contents of the string during
the `python gdb.inferiors()[0].write_memory (addr, str)' results
in the following error:

    (gdb) python gdb.inferiors()[0].write_memory (addr, str)
    gdb: write target memory, 5 bytes at 0x00403064
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    gdb.MemoryError: Cannot access memory at address 0x403064
    Error while executing Python code.

This patch prevents this from happening by declaring str as an
array rather than a pointer.

gdb/testsuite/ChangeLog:

        * gdb.python/py-inferior.c (f2): Make str an array rather
        than a pointer.
        * gdb.python/py-inferior.exp: Adjust testcase accordingly.
2011-06-08 16:56:11 +00:00
Jan Kratochvil 5be4dfca58 gdb/
* cli/cli-cmds.c (shell_escape): Use waitpid.
	* rs6000-nat.c (exec_one_dummy_insn): Likewise.

gdb/testsuite/
	* gdb.base/async-shell.c: New file.
	* gdb.base/async-shell.exp: New file.
2011-06-07 17:26:47 +00:00
Pedro Alves 9f47e25402 2011-06-06 Pedro Alves <pedro@codesourcery.com>
gdb/testsuite/
	* gdb.threads/pending-step.exp: Add more context to SIGTRAP match.
2011-06-06 13:33:08 +00:00
Joel Brobecker 64b9b33460 Various spelling fixes.
gdb/ChangeLog:

        From Stephen Kitt  <steve@sk2.org>
        * breakpoint.c, breakpoint.h, cli/cli-dump.c, dwarf2expr.c,
        gdbarch.c, gdbarch.sh, remote.c: Various spelling fixes.

gdb/testsuite/ChangeLog:

        From Stephen Kitt  <steve@sk2.org>
        * gdb.base/help.exp: Adjust following some spelling corrections
        in GDB.
2011-06-03 23:47:46 +00:00
Yao Qi dbc0f13167 2011-06-01 Yao Qi <yao@codesourcery.com>
* gdb.base/ending-run.exp: Match __uClibc_main for uClibc.
2011-06-01 15:55:55 +00:00
Keith Seitz fd336a18df PR c++/12750
* gdb.cp/static-method.cc: New file.
	* gdb.cp/static-method.exp: New file.
2011-05-31 22:14:21 +00:00
Keith Seitz fa8b9902af PR symtab/12704
* gdb.cp/anon-ns.cc: New file.
	* gdb.cp/anon-ns.exp: New file.
2011-05-31 21:54:49 +00:00
Pedro Alves 0a5b1e09bf 2011-05-31 Pedro Alves <pedro@codesourcery.com>
gdb/gdbserver/
	* linux-x86-low.c (i386_dr_low_get_addr): Fix off by one in
	assertion.
	* win32-i386-low.c (i386_dr_low_get_addr): Ditto.

	gdb/testsuite/
	* gdb.arch/i386-dr3-watch.c: New file.
	* gdb.arch/i386-dr3-watch.exp: New file.
2011-05-31 21:18:56 +00:00
Yao Qi 0578b8d157 2011-05-30 Yao Qi <yao@codesourcery.com>
* gdb.base/callfuncs.c (t_structs_fc): New.
	(t_structs_dc, t_structs_ldc): New.
	(t_double_many_args):
	(DEF_FUNC_MANY_ARGS_1, DEF_FUNC_MANY_ARGS_2): Define.
	(DEF_FUNC_MANY_ARGS_3, DEF_FUNC_VALUES_1): Define.
	(DEF_FUNC_VALUES_2, DEF_FUNC_VALUES_3): Define.
	* gdb.base/callfuncs.exp: Call new functions.
2011-05-30 02:51:58 +00:00
Yao Qi ff4d2c6018 2011-05-30 Yao Qi <yao@codesourcery.com>
* gdb.base/callfuncs.exp (rerun_and_prepare): New.
	Call rerun_and_prepare for each test to isolate effects.
2011-05-30 02:32:21 +00:00
Yao Qi 6680506ef0 2011-05-30 Yao Qi <yao@codesourcery.com>
* gdb.base/varargs.c (find_max_float_real): New.
        (find_max_double_real, find_max_long_double_real): New.
        * gdb.base/varargs.exp: Call these new added functions.
	* lib/gdb.exp (setup_kfail_for_target): New.
2011-05-30 02:27:51 +00:00
Yao Qi e43ec454f9 2011-05-30 Yao Qi <yao@codesourcery.com>
* gdb.base/funcargs.c (callca, callcb, callcc): New.
	(callcd, callce, callcf, callc1a, callc1b): New.
	(callc2a, callc2b): New.
	* gdb.base/funcargs.exp (complex_args): New.
	(complex_integral_args, complex_float_integral_args): New.
	* lib/gdb.exp (support_complex_tests): New.  Determine
	whether to run test cases on _Complex types.
2011-05-30 02:20:16 +00:00