Commit Graph

32974 Commits

Author SHA1 Message Date
Tom Tromey 365156ada1 * dwarf2read.c (init_cutu_and_read_dies): Revert patch from
2013-07-22.
2013-07-23 06:56:53 +00:00
Yao Qi 2eb14a9b5c gdb/testsuite/
* gdb.mi/mi-var-cmd.exp: Adjust pattern to match current error
	message.
2013-07-23 06:54:47 +00:00
Jan Kratochvil 66cbcda46f Fix the following ChangeLog entry:
2013-07-22  Doug Evans  <dje@google.com>

gdb/
	* exec.h (remove_target_sections): Delete arg abfd.
	* exec.c (exec_close): Update call to remove_target_sections.
	(remove_target_sections): Delete arg abfd.
	* solib.c (update_solib_list): Ditto.
	(reload_shared_libraries_1): Ditto.
	(clear_solib): Ditto, and unconditionally call remove_target_sections.
	* target.h (struct target_section): Rename key to owner.
	All uses updated.
2013-07-22 20:52:23 +00:00
Jan Kratochvil 046ac79fc7 2013-07-22 Doug Evans <dje@google.com>
gdb/
	* exec.h (remove_target_sections): Delete arg abfd.
	* exec.c (remove_target_sections): Delete arg abfd.
	(exec_close): Update call to remove_target_sections.
	* solib.c (update_solib_list): Ditto.
	(reload_shared_libraries_1): Ditto.
	(clear_solib): Ditto, and unconditionally call remove_target_sections.
2013-07-22 20:51:11 +00:00
Tom Tromey 29b2cc46a5 fix solib-som.c
som_open_symbol_file_object was leaking a cleanup.

	* solib-som.c (som_open_symbol_file_object): Call do_cleanups.
2013-07-22 18:00:50 +00:00
Tom Tromey d11600184f fix init_cutu_and_read_dies
init_cutu_and_read_dies creates an outer cleanup and uses its
immediately nested inner cleanup conditionally.  This seems overly
complicated to me; simpler is to just deal with the outer cleanup and
drop the inner one.  That is what this patch implements.

	* dwarf2read.c (init_cutu_and_read_dies): Remove 'free_cu_cleanup'.
	Simplify cleanup handling.
2013-07-22 17:58:51 +00:00
Tom Tromey 2f324bf6cb fix dwarf_decode_line_header
dwarf_decode_line_header has one return that is missing a call to
do_cleanups.  This patch adds it.

This was found using the cleanup checker.

	* dwarf2read.c (dwarf_decode_line_header): Call do_cleanups
	on all return paths.
2013-07-22 17:53:55 +00:00
Ulrich Weigand e23b9d6ed2 2013-07-22 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
* ppc-linux-nat.c (PPC_DEBUG_FEATURE_DATA_BP_DAWR): New define.
	(ppc_linux_region_ok_for_hw_watchpoint): Add checking to use the new
	DAWR interface for longer ranges hardware watchpoint (up to 512 bytes).
2013-07-22 13:17:51 +00:00
Phil Muldoon 1cf55f60bf 2013-07-22 Phil Muldoon <pmuldoon@redhat.com>
* top.c (print_gdb_version): Add help, apropos description and
	url to online documentation.
2013-07-22 11:42:31 +00:00
Will Newton 5d0a3b53c0 gdb/testsuite/gdb.base: Enable disp-step-syscall.exp tests for ARM.
disp-step-syscall.exp is not run for ARM targets because ARM syscall
instructions have not been added to the list of possible syscall
instructions. This patch adds ARM syscall instructions to enable
disp-step-syscall.exp tests for ARM targets. Attached patch is tested
on ARMv7 and helps pass all disp-step-syscall.exp tests for ARM
targets.

gdb/testsuite/ChangeLog:

2013-07-19  Omair Javaid  <Omair.Javaid@linaro.org>

	* gdb.base/disp-step-syscall.exp: Add svc and swi syscall
	instructions and enable disp-step-syscall for arm targets.
2013-07-19 10:24:34 +00:00
Will Newton 9a5911c08b gdb/testsuite/gdb.dwarf2: Replace @ with % for ARM compatability.
The ARM assembler recognises @ symbol as a comment marker and
therefore is unable to assemble some of gdb.dwarf2 testsuite tests.
This patch replaces all occurrences of @ symbol with % sign to allow
tests stay compatible with both ARM and x86 assembly. This patch has
been tested on x86_64 and ARMv7 targets.

gdb/testsuite/ChangeLog:

2013-07-19  Omair Javaid  <Omair.Javaid@linaro.org>

        * gdb.dwarf2/fission-reread.S: Replace @ sign with % sign to remove
        assembler errors on arm.
        * gdb.dwarf2/mac-fileno.S: Likewise.
        * gdb.dwarf2/member-ptr-forwardref.S: Likewise.
        * gdb.dwarf2/pr13961.S: Likewise.
2013-07-19 10:01:26 +00:00
Hui Zhu fa87697221 2013-07-19 Hui Zhu <hui@codesourcery.com>
PR gdb/15692
	* mi/mi-cmd-break.c (mi_argv_to_format): Handle double quotes.

2013-07-19  Hui Zhu  <hui@codesourcery.com>

	PR gdb/15692
	* gdb.mi/mi-dprintf.exp: Add double quotes test.
2013-07-19 07:26:46 +00:00
Yao Qi 1527aea867 gdb/
* target.c (update_current_target): Change the default action
	of 'to_traceframe_info' from tcomplain to return_zero.
	* target.h (struct target_ops) <to_traceframe_info>: Add more
	comments.
	* valops.c (read_value_memory): Call
	traceframe_available_memory unconditionally.

gdb/testsuite/

	* gdb.trace/read-memory.exp (test_from_remote): Update test.
	(teset_from_exec): Likewise.
2013-07-18 23:09:49 +00:00
Yao Qi 73c1d57e3e gdb/testsuite/
* gdb.trace/read-memory.c: New.
	* gdb.trace/read-memory.exp: New.
2013-07-18 23:04:00 +00:00
Yao Qi a075c3e55b gdb/testsuite/
* lib/gdb.exp (gdb_compile_shlib): Pass the tail name of
	$dest to link options if host is remote.  Move the
	generated file to $dest.a on host if host is remote.
2013-07-18 22:38:58 +00:00
Will Newton 623cc28540 gdb/testsuite/gdb.threads: Ensure TLS tests link against pthreads.
On Ubuntu by default the compiler passes --as-needed to ld which
means no DT_NEEDED entry is added for libpthread when building
the TLS tests. This causes the test to fail as libpthread is
required to look up TLS variables. Add calls to pthread_testcancel
to make sure libpthread gets linked.

gdb/testsuite/ChangeLog:

2013-07-18  Will Newton  <will.newton@linaro.org>

	* gdb.threads/tls-nodebug.c: Call pthread_testcancel
	to ensure the test is linked against pthreads.
	* gdb.threads/tls-var-main.c: Likewise.
	* gdb.threads/tls-shared.c: Likewise.
2013-07-18 15:49:22 +00:00
Yao Qi 1f74d3b559 gdb/testsuite/
* lib/future.exp (gdb_default_target_compile): Use tail name
	of $destfile as the output name of compile.  Move the
	generated file to $destfile on build.
2013-07-18 05:13:27 +00:00
Yao Qi f6dc277e05 gdb/testsuite/
* lib/gdb.exp (gdb_compile): Set
	gdb_saved_set_unbuffered_mode_obj to
	set_unbuffered_mode_saved.o if host is remote.  Invoke
	remote_download to copy $unbuf_obj to host.
2013-07-18 05:07:25 +00:00
Yao Qi 886f230ed7 gdb/
Commit the changelog change for my previous commit.
2013-07-18 01:47:00 +00:00
Yao Qi 303c5ee187 gdb/
* coffread.c (coff_symfile_read): Iterate over minimal symbols,
	if the name is prefixed by "__imp_" or "_imp_", look for minimal
	symbol without prefix.  If found, set its type to
	'mst_solib_trampoline'.
2013-07-18 01:45:15 +00:00
Doug Evans e704570352 * NEWS: Mention "set print raw frame-arguments".
* gdbcmd.h (setprintrawlist, showprintrawlist): Declare.
	* stack.c (print_raw_frame_arguments): New static global.
	(print_frame_arg): Set opts.raw from print_raw_frame_arguments.
	(_initialize_stack): New command "set/show print raw frame-arguments".
	* valprint.c (setprintrawlist, showprintrawlist): New globals.
	(set_print_raw, show_print_raw): New functions.
	(_initialize_valprint): New prefix command "set/show print raw".
	* valprint.h (value_print_options): Improve comments.

	doc/
	* gdb.texinfo (Print Settings): Document "print raw frame-arguments".

	testsuite/
	* gdb.python/py-frame-args.c: New file.
	* gdb.python/py-frame-args.py: New file.
	* gdb.python/py-frame-args.exp New file.
2013-07-17 20:35:11 +00:00
Doug Evans 453e48a5a5 * cli/cli-cmds.c (init_cmd_lists): Delete unnecessary initialization
of all *list variables.
2013-07-17 20:26:28 +00:00
Doug Evans 16419bae30 * gdbcmd.h (togglelist): Delete.
* cli/cli-cmds.c (togglelist): Delete.
	(init_cmd_lists): Update.
	* cli/cli-cmds.h (togglelist): Delete.
2013-07-17 19:01:48 +00:00
Tom Tromey 626f2d1cfd * dwarf2read.c (dwarf2_per_objfile_free): Clear
dwarf2_per_objfile.
2013-07-17 15:22:30 +00:00
Doug Evans 57e6060ea5 * nto-tdep.c (nto_relocate_section_addresses): Update,
target_section.bfd deleted.
	* ppc64-tdep.c (ppc64_convert_from_func_ptr_addr): Ditto.
	* s390-tdep.c (s390_load): Ditto.
	* solib-aix.c (solib_aix_relocate_section_addresses): Ditto.
2013-07-17 05:28:04 +00:00
Andrew Burgess 5ea5559b9a Check for NULL character before calling strchr.
http://sourceware.org/ml/gdb-patches/2013-07/msg00322.html

gdb/ChangeLog

        * common/format.c (parse_format_string): Add checks for NULL
        character before calling strchr.

gdb/testsuite/ChangeLog

        * gdb.base/printcmds.exp (test_printf): Add tests for format
        strings with missing format specifier.
2013-07-16 21:12:14 +00:00
Doug Evans 2c57100624 * solist.h (target_so_ops.find_and_open_solib): Clarify usage of
temp_pathname argument.
	* nto-tdep.c (nto_find_and_open_solib): Fix setting of temp_pathname
	when opening the file fails.
2013-07-16 20:43:48 +00:00
Doug Evans 2b2848e211 * target.h (struct target_section): Delete member bfd.
All users updated to use the_bfd_section->owner instead.
	* exec.c (add_to_section_table): Assert bfd is expected value.
	Remove initialization of target_section.bfd.
	(remove_target_sections): Update.
	(section_table_available_memory): Update.
	(section_table_xfer_memory_partial): Update.
	(print_section_info): Update.
	(exec_set_section_address): Update.
	* record-full.c (record_full_core_xfer_partial): Update.
	* solib-svr4.c (svr4_relocate_section_addresses): Update.
	* solib-target.c (solib_target_relocate_section_addresses): Update.
	* symfile.c (build_section_addr_info_from_section_table): Update.
	* target.c (memory_xfer_live_readonly_partial): Update.
	(memory_xfer_partial_1): Update.
2013-07-16 20:41:55 +00:00
Tom Tromey 4229ca0ea6 simple test suite fix in gdb.ada
This changes one spot in gdb.ada to use standard_testfile.

	* gdb.ada/info_types.exp: Use standard_testfile.
2013-07-16 18:52:18 +00:00
Tom Tromey 5ee657d5a2 simple test suite fix in gdb.mi
This is another simple test suite change for the parallelization
project.

This changes mi-basics.exp to avoid the use of subdir and objdir and
instead use standard_output_file.

There are still some uses of objdir, but as noted in a new comment in
the patch, these uses are parallel-safe.

	* gdb.mi/mi-basics.exp: Use standard_output_file.
	(test_dir_specification, test_cwd_specification)
	(test_path_specification): Use testsubdir, not subdir and objdir.
2013-07-16 18:49:32 +00:00
Tom Tromey 20e3d738fe test suite fixlet for gdb.trace
This is a minor fix to clean up the last remaining test suite
parallelization issue in gdb.trace.

mi-traceframe-changed.exp refers to objdir.  This patch changes the
code to have the same effect, but avoid using that variable.

	* gdb.trace/mi-traceframe-changed.exp: Don't use objdir.
2013-07-16 18:48:31 +00:00
Ulrich Weigand 926bf92da5 2013-07-15 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
* ppc-linux-nat.c: Since the new PowerPC specific ptrace interface is
	now available for embedded (BookE) and server (BookS) processors,
	correct mentions of 'booke' and adjust comments accordingly in order to
	avoid confusion. Rename struct 'booke_debug_info' to 'hwdebug_info'.
	(have_ptrace_booke_interface): Rename function and variable
	'have_ptrace_booke_interface' to 'have_ptrace_hwdebug_interface'.
	Rename struct 'booke_debug_info' to 'hwdebug_info'. Update all uses.
	(booke_cmp_hw_point): Rename function 'booke_cmp_hw_point' to
	'hwdebug_point_cmp'. Update all uses.
	(booke_find_thread_points_by_tid): Rename function
	'booke_find_thread_points_by_tid' to
	'hwdebug_find_thread_points_by_tid'. Update all uses.
	(booke_insert_point): Rename function 'booke_insert_point' to
	'hwdebug_insert_point'. Update all uses.
	(booke_remove_point): Rename function 'booke_remove_point' to
	'hwdebug_remove_point'. Update all uses.
2013-07-15 16:01:26 +00:00
Maciej W. Rozycki d929bc19b9 include/elf/
* mips.h (Tag_GNU_MIPS_ABI_FP): Remove comment.
	(Val_GNU_MIPS_ABI_FP_ANY, Val_GNU_MIPS_ABI_FP_DOUBLE,
	Val_GNU_MIPS_ABI_FP_SINGLE, Val_GNU_MIPS_ABI_FP_SOFT,
	Val_GNU_MIPS_ABI_FP_64): New enum.

	bfd/
	* elfxx-mips.c (mips_elf_merge_obj_attributes): Replace hardcoded
	magic numbers with enum values.

	binutils/
	* readelf.c (display_mips_gnu_attribute): Replace hardcoded magic
	numbers with enum values.

	gdb/
	* mips-tdep.c (mips_gdbarch_init): Replace hardcoded magic
	numbers with enum values.
2013-07-15 15:07:30 +00:00
Ali Anwar 054e8d9e20 2013-07-15 Ali Anwar <ali_anwar@codesourcery.com>
PR threads/13217
        * thread.c (thread_apply_all_command): Check for valid threads
        and thread count.
        (thread_array_cleanup): New struct.
        (set_thread_refcount): New function.
2013-07-15 11:14:32 +00:00
Andrew Burgess cf0063592d Reuse print_hex_chars function.
http://sourceware.org/ml/gdb-patches/2013-07/msg00234.html

	* infcmd.c (default_print_one_register_info): Reuse code in
	print_hex_chars.
2013-07-11 09:07:41 +00:00
Tom Tromey 94e36acc3c * Makefile.in (GDB_WARN_CFLAGS_NO_DEFS, ADA_EXP_C): New macros.
(ada-exp.o): New target.
2013-07-10 18:13:52 +00:00
Sergio Durigan Junior 915dd369a2 http://sourceware.org/ml/gdb-patches/2013-07/msg00065.html
Doug Evans committed the change above, but forgot to update one of
the callers of get_raw_print_options, at mt-tdep.c.  This commit fixes
this.

2013-07-10  Sergio Durigan Junior  <sergiodj@redhat.com>

	* mt-tdep.c (mt_registers_info): Call
	get_no_prettyformat_print_options instead of
	get_raw_print_options (regression by last patch from Doug
	Evans).
2013-07-10 03:15:05 +00:00
Joel Brobecker 51b8642693 [testsuite/Ada] Add testing of access to packed arrays.
This patch adds some tests that evidence a regression fixed by
the following patch from Pedro Alves:

    [PATCH] ada-lang.c:coerce_unspec_val_to_type: Preserve laziness
    http://www.sourceware.org/ml/gdb-patches/2013-07/msg00178.html

gdb/testsuite/ChangeLog:

        * gdb.ada/arrayptr/foo.adb: Add some code defining an access
        to a packed array.
        * gdb.ada/arrayptr.exp: Add a few tests using that new access
        to packed array.
2013-07-10 00:35:01 +00:00
Joel Brobecker eca07816f8 ada-lang.c:coerce_unspec_val_to_type: Preserve laziness.
ada-lang.c:coerce_unspec_val_to_type does:

      if (value_lazy (val)
	  || TYPE_LENGTH (type) > TYPE_LENGTH (value_type (val)))
	result = allocate_value_lazy (type);
      else
	{
	  result = allocate_value (type);
	  memcpy (value_contents_raw (result), value_contents (val),
		  TYPE_LENGTH (type));
	}
      set_value_component_location (result, val);
      set_value_bitsize (result, value_bitsize (val));
      set_value_bitpos (result, value_bitpos (val));
      set_value_address (result, value_address (val));
      set_value_optimized_out (result, value_optimized_out (val));

Notice that before value_optimized_out was made to auto-fetch lazy
values, VAL would end up still lazy if it was lazy on entry.  It's not
really a problem here if VAL is lazy, and VAL->optimized_out is 0,
because RESULT is also left lazy.  IOW, this just wants to copy the
VAL->optimized_out flag to RESULT->optimized_out, nothing else.

As a side-effect of the change in value_optimized_out, the following
testcase now regresses. Consider:

       type Small is range -64 .. 63;
       for Small'Size use 7;
       type Arr is array (1..10) of Small;
       pragma Pack (Arr);

       type Arr_Ptr is access Arr;
       An_Arr_Ptr : Arr_Ptr := new Arr'(10, 20, 30, 40, 50, 60, 62, 63,
                                        -23, 42);

    Trying to print one element of An_Arr_Ptr yields:

        (gdb) p an_arr_ptr(3)
        Cannot access memory at address 0x0

The patch adds the value_optimized_out_const function for that,
allowing us to avoid trying to fetch a value at a dummy address.

(I found this out by grepping for set_value_optimized_out and trying
to convert the uses I found to instead allocate the value with
allocate_optimized_out_value.)

Tested on x86_64 Fedora 17.

gdb/
2013-07-09  Pedro Alves  <palves@redhat.com>

	* ada-lang.c (coerce_unspec_val_to_type): Use
	value_optimized_out_const.
	* value.c (value_optimized_out_const): New function.
	* value.h (value_optimized_out_const): New declaration.
2013-07-10 00:34:38 +00:00
Joel Brobecker 7d7c647756 Fix FAIL: gdb.ada/small_reg_param.exp: continue to call_me
If enough information is provided by the compiler, the debugger
now prints the entry value of various parameters:

    (gdb) continue
    Continuing.

    Breakpoint 2, pck.call_me (w=w@entry=50) at [...]
    20            Last_Word := W;

This patch adjusts the expected output to allow an optional
"w@entry=" in the parameter value.

gdb/testsuite/ChangeLog:

        * gdb.ada/small_reg_param.exp: Accept optional entry value
        for parameter "w".
2013-07-10 00:10:37 +00:00
Joel Brobecker 52cd8b7d70 Remove trailing space in gdb.ada/small_reg_param.exp
gdb/testsuite/ChangeLog:

        * gdb.ada/small_reg_param.exp: Remove trailing space.
2013-07-10 00:10:26 +00:00
Doug Evans 2a998fc037 * defs.h (enum val_prettyformat): Renamed from val_prettyprint.
Enum values rename as well.  All uses updated.
	* valprint.h (value_print_options): Rename member pretty to
	pretty format.  Rename member prettyprint_arrays to
	prettyformat_arrays.  Rename member prettyprint_structs to
	prettyformat_structs.  All uses updated.
	(get_no_prettyformat_print_options): Renamed from
	get_raw_print_options.
	* valprint.c (get_no_prettyformat_print_options): Renamed from
	get_raw_print_options.  All callers updated.
	(show_prettyformat_structs): Renamed from show_prettyprint_structs.
	All callers updated.
	(show_prettyformat_arrays): Renamed from show_prettyprint_arrays.
	All callers updated.
	(_initialize_valprint): Improve help text for "set print pretty" and
	"set print arrays".

	testsuite/
	* gdb.base/default.exp: Update expected output of "show print array"
	and "show print pretty".
2013-07-09 16:57:09 +00:00
Andrew Burgess 466c1fcab7 Revert recent changes to value_bits_valid.
http://sourceware.org/ml/gdb-patches/2013-07/msg00243.html

  * value.c (value_bits_valid): Revert previous change, and change
  by Pedro on 2013-07-04, due to regressions in
  gdb.dwarf2/implptr.exp and gdb.dwarf2/pieces.exp.
2013-07-09 14:11:53 +00:00
Ulrich Weigand 0329e9fbe8 2013-07-08 Andreas Arnez <arnez@linux.vnet.ibm.com>
* gdb.threads/wp-replication.exp: Stop counting available hardware
	watchpoints after NR_THREADS iterations.
2013-07-08 11:35:49 +00:00
Andrew Burgess 1953058fe9 Add $gdb_prompt to test regexp.
http://sourceware.org/ml/gdb-patches/2013-07/msg00173.html

	* gdb.python/py-explore.exp: Add $gdb_prompt to test regexp.
2013-07-08 11:16:01 +00:00
Andrew Burgess ad0f030310 Fix bug in value_bits_valid.
http://sourceware.org/ml/gdb-patches/2013-07/msg00174.html

	* value.c (value_bits_valid): If the value is not lval_computed
	or has no check validity handler then the answer is the
	optimized_out flag, otherwise defer to the handler.
2013-07-08 10:21:33 +00:00
Yao Qi 7c0de7419b gdb/testsuite/
* boards/native-gdbserver.exp: Move invoke of
	process_multilib_options to gdbserver-base.exp.
	Move set_board_info 'compiler', 'gdb,noinferiorio',
	'gdb,nofileio', 'gdb_server_prog' and 'gdb,predefined_tsv' to
	gdbserver-base.exp.
	Move proc ${board}_download, ${board}_upload and
	${board}_file to gdbserver-base.exp.
	* boards/native-extended-gdbserver.exp: Likewise.
	* boards/native-stdio-gdbserver.exp: Likewise.
	* boards/gdbserver-base.exp: New file.
2013-07-07 08:52:39 +00:00
Eli Zaretskii 48d1d6f5c6 top.c (print_gdb_configuration): Explain in output of --configuration
what does "relocatable" mean.
2013-07-06 07:34:48 +00:00
Eli Zaretskii b187bec1eb Rearrange --help output.
* main.c (print_gdb_help): Regroup options in the --help text.
	See http://sourceware.org/ml/gdb-patches/2013-04/msg00362.html for
	the relevant discussions.
2013-07-06 07:28:24 +00:00
Yao Qi 52d361e1b3 gdb/
* breakpoint.h (struct breakpoint_ops) <create_breakpoints_sal>:
	Remove parameter 'lsal'.
	* breakpoint.c (create_breakpoint): Move local variable 'lsal'
	to inner block.  Caller update.
	(base_breakpoint_create_breakpoints_sal): Update.
	(bkpt_create_breakpoints_sal): Likewise.
	(tracepoint_create_breakpoints_sal): Likewise.
	(strace_marker_create_breakpoints_sal): Get 'lsal' from the
	element 0 of vector 'canonical->sals'.
2013-07-06 07:14:54 +00:00
Luis Machado e1ec1b420c * rs6000-tdep.c (rs6000_stab_reg_to_regnum): Return the real
register number instead of the pseudo register one.
	(rs6000_dwarf2_reg_to_regnum): Likewise.
2013-07-06 02:46:00 +00:00
Luis Machado 497a4c488f * gdb.base/dump.exp: Remove arch-specific tests and do a
generic data address check to set is64bitonly correctly.
2013-07-06 02:36:46 +00:00
Luis Machado bb3f62fce7 * gdb.mi/gdb2549.exp (register_tests): Expect any decimal for
the register number instead of expecting only 0.
2013-07-06 02:32:31 +00:00
Will Newton 005faa9df8 gdb/testsuite/gdb.base/gnu-ifunc-lib.c: Use %function syntax.
ARM uses @ as a comment character, but % seems to be usable by all
existing ifunc enabled architectures.

gdb/testsuite/ChangeLog:

2013-07-05  Will Newton  <will.newton@linaro.org>

	* gdb.base/gnu-ifunc-lib.c: Use %function instead of @function
	in asm syntax to allow building on ARM.
2013-07-05 10:40:10 +00:00
Yao Qi 4767856f50 gdb/testsuite/
* boards/local-remote-host.exp: Remove obsolete comments.
	* boards/native-extended-gdbserver.exp: Likewise.
	* boards/native-gdbserver.exp: Likewise.
	* boards/native-stdio-gdbserver.exp: Likewise.
2013-07-05 08:50:22 +00:00
Pedro Alves 7195e6f018 Use allocate_optimized_out_value instead of set_value_optimized_out.
Allocate the value as optimized out from the start rather than allocating
a value with contents, and then marking it optimized out.

gdb/
2013-07-04  Pedro Alves  <palves@redhat.com>

	* findvar.c (value_of_register): Use allocate_optimized_out_value
	if the register has been optimized out, instead of
	set_value_optimized_out.
	* frame-unwind.c (frame_unwind_got_optimized): Use
	allocate_optimized_out_value.
2013-07-04 18:10:04 +00:00
Pedro Alves 58722cac5a value_bits_valid: Fix latent bug.
Doing something else, I factored out the bits of the value_bits_valid
function that actually handle the check_validity hook, and
surprisingly found out that the result was misbehaving.  Turns out
value_bits_valid has a latent bug.  If the value is not lval_computed,
or doesn't have a check_validity hook, then we should assume the value
is entirely valid, not invalid.  This is currently masked by the
value->optimized_out check -- I ran the testsuite with a gdb_assert(0)
inserted in place of that return being touched by the patch, and it
never triggers.

Tested on x86_64 Fedora 17.

gdb/
2013-07-04  Pedro Alves  <palves@redhat.com>

	* value.c (value_bits_valid): If the value is not lval_computed,
	or doesn't have a check_validity hook, assume the value is entirely
	valid.
2013-07-04 16:08:22 +00:00
Andrew Burgess 691a26f5dd http://sourceware.org/ml/gdb-patches/2013-07/msg00059.html
gdb/ChangeLog

        * stack.c (read_frame_arg): No longer fetch lazy values.
        * value.c (value_optimized_out): If the value is not already
        marked optimized out, and is lazy then fetch it.
        (value_primitive_field): Move optimized out check to later in the
        function, after we have loaded any lazy values.
        (value_fetch_lazy): Use optimized out flag directly rather than
        calling optimized_out method.

gdb/testsuite/ChangeLog

        * gdb.dwarf2/dw2-reg-undefined.exp: New file.
        * gdb.dwarf2/dw2-reg-undefined.c: Likewise.
        * gdb.dwarf2/dw2-reg-undefined.S: Likewise.
2013-07-04 11:11:25 +00:00
Andrew Burgess a58e2656df http://sourceware.org/ml/gdb-patches/2013-07/msg00056.html
* valops.c: Don't include "user-regs.h".
	(value_fetch_lazy): Moved to value.c.
	* value.c: Include "user-regs.h".
	(value_fetch_lazy): Moved from valops.c.
2013-07-04 09:49:43 +00:00
Yao Qi bd88542004 gdb/
2013-07-04  Yao Qi  <yao@codesourcery.com>

	Revert:
	2013-06-27  Yao Qi  <yao@codesourcery.com>

	* common/create-version.sh: Update comments.  Handle the case
	that TARGET_ALIAS is empty.

gdb/gdbserver/

2013-07-04  Yao Qi  <yao@codesourcery.com>

	* Makefile.in (host_alias): Use @host_noncanonical@.
	(target_alias): Use @target_noncanonical@.
	* configure.ac: Use ACX_NONCANONICAL_TARGET and
	ACX_NONCANONICAL_HOST.
	* configure: Regenerated.

	Revert:
	2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>

	* configure.ac (version_host, version_target): Set and AC_SUBST them.
	* configure: Rebuild.
	* Makefile.in (version_host, version_target): Get from configure.
	(version.c): Use $(version_host) and $(version_target).
2013-07-04 01:22:38 +00:00
Pedro Alves 17ef446eed On mainline/development, also link GDBserver with -lmcheck.
This factors --enable-libmcheck related bits from GDB's configure.ac
and makes GDBserver use them too.  Specifically, the 'development'
global is moved to a separate script to it can be sourced by both GDB
and GDBserver, and the --enable-libmcheck/--disable-libmcheck bits
proper are moved to a new m4 file.

I started out by defining 'development' in the m4 file, but in the end
decided against it, as a separate script has the advantage that
changing it in release branches does not require regenerating
configure, unlike today.

I had also started out by making the new GDB_AC_LIBMCHECK itself
handle the yes/no default fallback depending on release/developement,
but since I had split out 'development' to a separate script, and, GDB
needs the python checks anyway (hence we'd need to do the python
checks in gdb's configure.ac, and pass in a 'default lmcheck yes/no'
parameter to GDB_AC_LIBMCHECK anyway), I ended up keeping
GDB_AC_LIBMCHECK isolated from the 'development' global.  IOW, it's
the caller's business to handle it.

Tested on x86_64 Fedora 17.  Built GDB and GDBserver with and without
--enable-libmcheck, and observed --enable-libmcheck overrides the
disablement of -lmcheck caused by python supporting threads, and that
GDBserver links with -lmcheck when expected.  Also observed that
changing the 'development' global, and issuing "make" triggers a
relink, and '-lmcheck' is included or not from the link accordingly.

gdb/
2013-07-03  Pedro Alves  <palves@redhat.com>

	* Makefile.in (config.status): Depend on development.sh.
	(aclocal_m4_deps): Add libmcheck.m4.
	* acinclude.m4: Include libmcheck.m4.
	* configure.ac: Source development.sh instead of setting
	'development' here.  --enable-libmcheck/--disable-libmcheck code
	factored out to GDB_AC_LIBMCHECK.  Run it.
	* development.sh: New file.
	* libmcheck.m4: New file.
	* configure: Regenerate.

gdb/gdbserver/
2013-07-03  Pedro Alves  <palves@redhat.com>

	* Makefile.in (config.status): Depend on development.sh.
	* acinclude.m4: Include libmcheck.m4.
	* configure: Regenerate.
2013-07-03 13:25:46 +00:00
Jan Kratochvil 4d142eaa28 gdb/testsuite/
* gdb.base/break-on-linker-gcd-function.exp: Replace
	prepare_for_testing by build_executable_from_specs and clean_restart.
2013-07-02 20:06:12 +00:00
Tom Tromey ac6dd50fbf * contrib/ari/update-web-ari.sh: Update for version.in change. 2013-07-02 17:58:54 +00:00
Tom Tromey bd1df410dd * common/ptid.h: Comment fixes. 2013-07-02 16:58:51 +00:00
Tom Tromey 3105ebf928 remove mention of "target nrom"
The documentation refers to "target nrom", but this target doesn't
appear in the tree.  It was zapped here:

2002-12-16  Andrew Cagney  <ac131313@redhat.com>
[...]
        * remote-nrom.c, remote-os9k.c, remote-vx960.c: Delete.

This patch removes the reference from the documentation.

	* gdb.texinfo (Target Commands): Don't mention "target nrom".
2013-07-02 16:58:32 +00:00
Mircea Gherzan 7a9a748743 gdbserver, win32: fix some function typedefs
2013-05-25  Mircea Gherzan  <mircea.gherzan@intel.com>

gdbserver/
	* win32-low.c (winapi_DebugActiveProcessStop): Move the WINAPI
	attribute inside the parentheses.
	(winapi_DebugSetProcessKillOnExit): Ditto.
	(winapi_DebugBreakProcess): Ditto.
	(winapi_GenerateConsoleCtrlEvent): Ditto.

Change-Id: I3aab72f2a1725a46b9da0e41a4ba08d7886284b9
Signed-off-by: Mircea Gherzan <mircea.gherzan@intel.com>
2013-07-02 11:59:24 +00:00
Mircea Gherzan 49b64de6e4 gdbserver: avoid empty structs
2013-06-25  Mircea Gherzan  <mircea.gherzan@intel.com>

gdbserver/

	* notif.h (notif_event): Add a dummy member to avoid compiler
	errors.

Change-Id: I490dbdb70a24f52b3947371f7c0397bf7a18423c
Signed-off-by: Mircea Gherzan <mircea.gherzan@intel.com>
2013-07-02 10:08:01 +00:00
Tom Tromey 4db1a1dc03 change gdb to use BFD's "dwz" functions
BFD recently got a few functions related to "dwz" files.  This patch
changes gdb to use them, just to share a bit more code.

This changes dwarf2_get_dwz_file to possibly return NULL.  This
simplified a bit of code elsewhere.

Built and regtested on x86-64 Fedora 18.  I specifically regtested it
using my pending dwz test case.

	* dwarf2read.c (dwarf2_get_dwz_file): Return NULL if
	.gnu_debugaltlink not found.  Use bfd_get_alt_debug_link_info.
	(dwarf2_read_index, create_all_comp_units): Update.
2013-07-01 19:55:17 +00:00
Tom Tromey dd9aa0484e add -Wold-style-definition
This adds -Wold-style-definition to gdb's list of warnings.  This
found a couple of spots where "()" was used where "(void)" is more
correct.

Tested by rebuilding on x86-64 Fedora 18.

	* configure.ac (build_warnings): Add -Wold-style-definition.
	* configure: Rebuild.
	* machoread.c (_initialize_machoread): Use "(void)".
	* macrocmd.c (macro_inform_no_debuginfo): Fix formatting;
	use "(void)".
2013-07-01 19:52:32 +00:00
Tom Tromey 44d100c3b9 add -Wold-style-declaration
This adds -Wold-style-declaration to gdb's list of warnings.

It turns out that a few places use "const static" rather than
"static const".  The former is deprecated according to the C standard.

Tested by rebuilding with --enable-targets=all on x86-64 Fedora 18.

	* configure.ac (build_warnings): Add -Wold-style-declaration.
	* configure: Rebuild.
	* dsrec.c (make_srec): Use "static const", not "const static".
	* h8300-tdep.c (h8300_breakpoint_from_pc): Use "static const",
	not "const static".
	* mi/mi-parse.c (mi_no_values, mi_simple_values, mi_all_values):
	Use "static const", not "const static".
	* mn10300-tdep.c (mn10300_breakpoint_from_pc): Use "static const",
	not "const static".
	* moxie-tdep.c (moxie_breakpoint_from_pc): Use "static const",
	not "const static".
	* rs6000-tdep.c (rs6000_breakpoint_from_pc): Use "static const",
	not "const static".
	* v850-tdep.c (v850_breakpoint_from_pc): Use "static const",
	not "const static".
	(v850_dbtrap_breakpoint_from_pc): Likewise.
	* xstormy16-tdep.c (xstormy16_breakpoint_from_pc): Use "static const",
	not "const static".
2013-07-01 19:50:11 +00:00
Tom Tromey 2945b8076c add -Wmissing-parameter-type
This adds -Wmissing-parameter-type to gdb's list of warnings.

This one doesn't happen to trigger for a --enable-targets=all build on
x86-64 Fedora 18.

	* configure.ac (build_warnings): Add -Wmissing-parameter-type.
	* configure: Rebuild.
2013-07-01 19:48:05 +00:00
Pedro Alves d5749ee715 [GDBserver] hostio.c: Fallback to packet buffer size if PATH_MAX is not available.
PATH_MAX is not defined on systems which have no limit on filename
length, such as GNU/Hurd.  As designed, the hostio RSP packets carry
the paths as parameters in the request/reply packets, which themselves
have an upper size limit, so lifting the filename limit completely
would require a redesign with new hostio packets.  While that doesn't
happen, we can at least support filename lengths as long as the packet
buffer can fit.

gdb/gdbserver/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* hostio.c (HOSTIO_PATH_MAX): Define.
	(require_filename, handle_open, handle_unlink, handle_readlink):
	Use it.
2013-07-01 11:29:17 +00:00
Pedro Alves d8d2a3ee47 Normalize on PATH_MAX instead of MAXPATHLEN throughout.
With the pathmax gnulib module in place, we can use PATH_MAX
consistently throughout, instead of the current mixbag of PATH_MAX and
MAXPATHLEN uses.  It's no longer necessary to include sys/param.h
(supposedly, I can't check all ports touched here) for MAXPATHLEN.

Don't remove sys/param.h from GDB's configure.ac, as later tests in
the file use HAVE_SYS_PARAM_H checks.

Tested on x86_64 Fedora 17.

Also cross-built for --host=i686-w64-mingw32, and --host=i586-pc-msdosdjgpp.

gdb/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* defs.h: Include "pathmax.h".
	* utils.c: Don't include sys/param.h.
	(gdb_realpath): Remove code that checks for MAXPATHLEN.
	* solib-ia64-hpux.c (ia64_hpux_handle_load_event): Use PATH_MAX
	instead of MAXPATHLEN.
	* solib-sunos.c: Don't include sys/param.h.
	* xcoffread.c: Don't include sys/param.h.
	* bsd-kvm.c: Don't include sys/param.h.
	* darwin-nat.c: Don't include sys/param.h.
	(darwin_pid_to_exec_file): Use PATH_MAX instead of MAXPATHLEN.
	* darwin-nat-info.c: Don't include sys/param.h.
	* fbsd-nat.c (fbsd_pid_to_exec_file): Use PATH_MAX instead of
	MAXPATHLEN.
	* i386obsd-nat.c: Don't include sys/param.h.
	* inf-child.c: Don't include sys/param.h.
	(inf_child_fileio_readlink): Use PATH_MAX instead of MAXPATHLEN.
	* linux-fork.c: Don't include sys/param.h.
	(fork_save_infrun_state): Use PATH_MAX instead of MAXPATHLEN.
	* linux-nat.c: Don't include sys/param.h.
	(linux_child_pid_to_exec_file, linux_proc_pending_signals)
	(linux_proc_pending_signals): Use PATH_MAX instead of MAXPATHLEN.
	* m68klinux-nat.c: Don't include sys/param.h.
	* nbsd-nat.c: Don't include sys/param.h.
	(nbsd_pid_to_exec_file): Use PATH_MAX instead of MAXPATHLEN.
	* ppc-linux-nat.c: Don't include sys/param.h.
	* rs6000-nat.c: Don't include sys/param.h.
	* spu-linux-nat.c. Don't include sys/param.h.
	* windows-nat.c: Don't include sys/param.h.
	* xtensa-linux-nat.c: Don't include sys/param.h.
	* config/i386/nm-fbsd.h: Don't include sys/param.h.

gdb/gdbserver/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* server.h: Include "pathmax.h".
	* linux-low.c: Don't include sys/param.h.
	(linux_pid_exe_is_elf_64_file): Use PATH_MAX instead of
	MAXPATHLEN.
	* win32-low.c: Don't include sys/param.h.
	(win32_create_inferior): Use PATH_MAX instead of MAXPATHLEN.
2013-07-01 11:28:30 +00:00
Pedro Alves 38ec22075a Import the "pathmax" gnulib module.
This imports the "pathmax" gnulib module, making PATH_MAX always
available on systems that have the notion of a constant max path limit
(i.e., practically everywhere except the Hurd), along with fixing a
couple broken systems --- see pathmax.h in the patch.

This means we can normalize on PATH_MAX throughout the tree (instead
of some places using MAXPATHLEN, or defining fallback constants
ourselves).

This is the just the importing step.

gdb/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add pathmax.
	* gnulib/Makefile.in (aclocal_m4_deps): Add import/m4/pathmax.m4.
	* gnulib/aclocal.m4: Regenerate.
	* gnulib/config.in: Regenerate.
	* gnulib/configure: Regenerate.
	* gnulib/import/pathmax.h: New file.
	* gnulib/import/Makefile.am: Regenerate.
	* gnulib/import/Makefile.in: Regenerate.
	* gnulib/import/m4/gnulib-cache.m4: Regenerate.
	* gnulib/import/m4/gnulib-comp.m4: Regenerate.
	* gnulib/import/m4/pathmax.m4: New file.
2013-07-01 11:25:43 +00:00
Pedro Alves e655c1a2f5 Reimplement DJGPP's .gdbinit -> gdb.ini renaming.
This simplifies the .gdbinit filename selection logic.

We have a GDBINIT_FILENAME define that supposedly configurations would
override, but none do so.  Instead, the only configuration that wants
a different file name instead of ".gdbinit", djgpp, does a strcpy over
the gdbinit global array.  This means the array needs to be sized, and
the code that does that is doing the usual
'PATH_MAX/FILENAME_MAX/fallback constant/etc.' mess.

Instead of all that, it's much simpler to have configure specificy the
.gdbinit filename.  As bonus, we can then make the "gdbinit" global
array const.

gdb/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* configure.ac (GDBINIT): Define, depending on host.
	* go32-nat.c (init_go32_ops): Don't override gdbinit here.
	* top.c (PATH_MAX): Delete fallback definition.
	(GDBINIT_FILENAME): Delete.
	(gdbinit): Reimplement as const char array set to the GDBINIT
	string constant.
	* top.h (gdbinit): Make const.
2013-07-01 11:24:17 +00:00
Pedro Alves 50dd979345 Constify main.c:get_init_files.
A following patch will want to make the "gdbinit" global array const.
As usual, that forces in a cascading series of const additions.  This
patch preemptively does those.  I went all the way up to constifying
catch_command_errors, but then that would require constifying
execute_command as well (which is a much more significant effort).  So
as stop point, I found the cleanest would be to add a variant of
catch_command_errors that takes const args, and use that in the few
spots that needed it due to the the get_init_files constification.

gdb/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* cli/cli-cmds.c (source_script): Make 'file' parameter const.
	* cli/cli-cmds.h (source_script): Likewise.
	* exceptions.c (catch_command_errors_const): New function.
	* exceptions.h (catch_command_errors_const): Declare.
	* main.c (get_init_files): Make parameters const, and adjust.
	(captured_main): Make 'system_gdbinit', 'home_gdbinit' and
	'local_gdbinit' locals const.  Adjust to use
	catch_command_errors_const.
	(print_gdb_help): Make 'system_gdbinit', 'home_gdbinit' and
	'local_gdbinit' locals const.
2013-07-01 11:22:12 +00:00
Pedro Alves bc7dea8de9 Rely on gnulib's unistd.h replacement.
With gnulib's unistd module, we can assume unistd.h is always present, and that
STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO are always defined.

Don't remove unistd.h from GDB's configure.ac, as later tests in the
file use HAVE_UNISTD_H checks.

gdb/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* defs.h: Don't check HAVE_UNISTD_H before including <unistd.h>.
	(STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Delete.
	* tracepoint.c: Don't check HAVE_UNISTD_H before including
	<unistd.h>.

gdb/gdbserver/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* event-loop.c: Don't check HAVE_UNISTD_H before including
	<unistd.h>.
	* gdbreplay.c: Likewise.
	* remote-utils.c: Likewise.
	* server.c: Likewise.
	* configure.ac: Don't check for unistd.h.
	* configure: Regenerate.
2013-07-01 11:19:27 +00:00
Pedro Alves 8839a007ad Import the "unistd" gnulib module.
I wanted to import the pathmax module, and that pulls in the unistd
module as dependency.  The unistd module is actually bigger than the
pathmax module.  If we're going to end up with it, might as well
import it explicitly, and make use of it throughout.

The "unistd" module makes a GNU-like <unistd.h> always available.
This means we no longer need to do:

 +#ifdef HAVE_UNISTD_H
  #include <unistd.h>
 +#endif

and we can remove a few constants from defs.h.

This is just the importing step.

gdb/
2013-07-01  Pedro Alves  <palves@redhat.com>

	Import the "unistd" gnulib module.
	* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add "unistd".
	* gnulib/Makefile.in (aclocal_m4_deps): Add import/m4/off_t.m4,
	import/m4/ssize_t.m4, import/m4/sys_types_h.m4 and
	import/m4/unistd_h.m4.
	* gnulib/aclocal.m4: Renenerate.
	* gnulib/config.in: Renenerate.
	* gnulib/configure: Renenerate.
	* gnulib/import/Makefile.am: Renenerate.
	* gnulib/import/Makefile.in: Renenerate.
	* gnulib/import/m4/gnulib-cache.m4: Renenerate.
	* gnulib/import/m4/gnulib-comp.m4: Renenerate.
	* gnulib/import/m4/off_t.m4: New file.
	* gnulib/import/m4/ssize_t.m4: New file.
	* gnulib/import/m4/sys_types_h.m4: New file.
	* gnulib/import/m4/unistd_h.m4: New file.
	* gnulib/import/sys_types.in.h: New file.
	* gnulib/import/unistd.c: New file.
	* gnulib/import/unistd.in.h: New file.
2013-07-01 11:18:09 +00:00
Pedro Alves 8c0da261b5 utils.c: pathconf call, check for _PC_PATH_MAX instead of HAVE_UNISTD_H.
This check in utils.c for HAVE_UNISTD_H is being used as proxy for
"HAVE_PATHCONF", as pathconf is supposed to be declared in unistd.h.

It's possible that there are systems out there that have realpath,
unistd.h and alloca, but not pathconf+_PC_PATH_MAX.  I don't know of
any by heart, but if we import gnulib's unistd module (which a
following patch will do), then unistd.h ends up always available, so
the check ends up incorrect.  As pathconf is being called with
_PC_PATH_MAX, check for that instead.

gdb/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* utils.c <pathconf/_PC_PATH_MAX use>: Check if _PC_PATH_MAX is
	defined instead of checking HAVE_UNISTD_H.
2013-07-01 11:15:39 +00:00
Pedro Alves 3574124b5f Reimport gnulib from scratch.
Moving aside gnulib/import/, and re-running our
gnulib/update-gnulib.sh script, surprisingly, one gets a different
result compared to what's in the tree.  This is with pristine FSF
autoconf and FSF automake, at the versions required by
update-gnulib.sh.  However, if one just runs the update-gnulib.sh
scripts against the _existing_ tree, then nothing changes...  I
suspect gnulib-tool's merge logic might be preserving some things by
design.  This gets rid of cruft that might have accumulated over
gnulib updates.  onceonly.m4 seems to fit in that category.

gdb/
2013-07-01  Pedro Alves  <palves@redhat.com>

	Reimport gnulib from scratch.
	* gnulib/Makefile.in (aclocal_m4_deps): Remove reference to
	import/m4/onceonly.m4.
	* gnulib/aclocal.m4: Renegerate.
	* gnulib/config.in: Renegerate.
	* gnulib/configure: Renegerate.
	* gnulib/import/Makefile.in: Renegerate.
	* gnulib/import/extra/update-copyright: Renegerate.
	* gnulib/import/m4/onceonly.m4: Delete.
2013-07-01 11:14:42 +00:00
Pedro Alves 702dc4fd25 Delete pagination_enabled extern declaration in tui/tui-regs.c.
It's declared in utils.h.

gdb/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* tui/tui-regs.c (pagination_enabled): Delete declaration.
2013-07-01 10:09:27 +00:00
Jan Kratochvil 47e1ce27f4 gdb/
Code cleanup.
	* remote.c (async_remote_interrupt_twice): Make it static.
	* remote.h (async_remote_interrupt_twice): Remove the declaration.
2013-06-30 17:14:59 +00:00
Sergio Durigan Junior e82839d425 This patch implements the support for SystemTap SDT probes on IA-64.
Joel Brobecker reported a bug which was happening because of the
"Improved linker-debugger interface", by Gary Benson, when tested on
IA-64 with rhES5.  The message is:

<http://sourceware.org/ml/gdb-patches/2013-06/msg00745.html>

The failure happened because GDB was trying to parse the probes'
operands using only the generic parser (implemented on stap-probe.c),
because the arch-specific parser was not implemented.  Thus, I am
committing the following changes which solve the bug.

2013-06-29  Sergio Durigan Junior  <sergiodj@redhat.com>

	* ia64-linux-tdep.c: Include <ctype.h>.
	(ia64_linux_stap_is_single_operand): New function.
	(ia64_linux_init_abi): Initialize SystemTap related attributes.
2013-06-30 00:35:39 +00:00
Tom Tromey d6c2da5446 move version.in from gdb/common back to gdb
This reverts part of the earlier version.in change.  It moves
version.in back to the gdb directory.  This works around the CVS bug
we've found.

gdb
	* Makefile.in (version.c): Use version.in, not
	common/version.in.
	* common/create-version.sh: Likewise.
	* common/version.in: Move...
	* version.in: ...here.
gdb/doc
	* Makefile.in (version.subst): Use version.in, not
	common/version.in.
	* gdbint.texinfo (Versions and Branches, Releasing GDB):
	Likewise.
gdb/gdbserver
	* Makefile.in (version.c): Use version.in, not
	common/version.in.
sim/common
	* Make-common.in (version.c): Use version.in, not
	common/version.in.
	* create-version.sh: Likewise.
sim/ppc:
	* Make-common.in (version.c): Use version.in, not
	common/version.in.
2013-06-28 18:59:51 +00:00
Pedro Alves 74da6f00a3 Move pagination_enabled declaration to a proper place.
Declare it close to other related declarations in utils.h, and remove
local extern declaration hack.

gdb/
2013-06-28  Pedro Alves  <palves@redhat.com>

	* infrun.c (set_observer_mode): Don't declare pagination_enabled
	here.
	* utils.h (pagination_enabled): Declare.
2013-06-28 17:19:39 +00:00
Pedro Alves d32dc48ed4 infrun.c: Move non_stop_1 etc., higher up in file.
The "non_stop_1" global is out of place, mixed with the observer bits.
This moves all the non-stop user-interface-related bits together.

gdb/
2013-06-28  Pedro Alves  <palves@redhat.com>

	* infrun.c (non_stop, non_stop_1, set_non_stop, show_non_stop):
	Move higher up in file.
2013-06-28 17:06:14 +00:00
Tom Tromey 0edd9e3b86 * tracepoint.c (deprecated_readline_begin_hook)
(deprecated_readline_hook, deprecated_readline_end_hook): Don't
	declare.
2013-06-28 14:23:11 +00:00
Pedro Alves 4eb5910882 [PR tui/14880] Fetch values before comparing their contents.
PR tui/14880 shows a reproducer that triggers this assertion:

  int
  value_available_contents_eq (const struct value *val1, int offset1,
  			     const struct value *val2, int offset2,
  			     int length)
  {
    int idx1 = 0, idx2 = 0;

    /* This routine is used by printing routines, where we should
       already have read the value.  Note that we only know whether a
       value chunk is available if we've tried to read it.  */
    gdb_assert (!val1->lazy && !val2->lazy);

(top-gdb) bt
#0  internal_error (file=0x88a26c "../../src/gdb/value.c", line=549, string=0x88a220 "%s: Assertion `%s' failed.") at ../../src/gdb/utils.c:844
#1  0x000000000057b9cd in value_available_contents_eq (val1=0x10fa900, offset1=0, val2=0x10f9e10, offset2=0, length=8) at ../../src/gdb/value.c:549
#2  0x00000000004fd756 in tui_get_register (frame=0xd5c430, data=0x109a548, regnum=0, changedp=0x109a560) at ../../src/gdb/tui/tui-regs.c:736
#3  0x00000000004fd111 in tui_check_register_values (frame=0xd5c430) at ../../src/gdb/tui/tui-regs.c:521
#4  0x0000000000501884 in tui_check_data_values (frame=0xd5c430) at ../../src/gdb/tui/tui-windata.c:234
#5  0x00000000004f976f in tui_selected_frame_level_changed_hook (level=1) at ../../src/gdb/tui/tui-hooks.c:222
#6  0x00000000006f0681 in select_frame (fi=0xd5c430) at ../../src/gdb/frame.c:1490
#7  0x00000000005dd94b in up_silently_base (count_exp=0x0) at ../../src/gdb/stack.c:2268
#8  0x00000000005dd985 in up_command (count_exp=0x0, from_tty=1) at ../../src/gdb/stack.c:2280
#9  0x00000000004dc5cf in do_cfunc (c=0xd3f720, args=0x0, from_tty=1) at ../../src/gdb/cli/cli-decode.c:113
#10 0x00000000004df664 in cmd_func (cmd=0xd3f720, args=0x0, from_tty=1) at ../../src/gdb/cli/cli-decode.c:1888
#11 0x00000000006e43e1 in execute_command (p=0xc7e6c2 "", from_tty=1) at ../../src/gdb/top.c:489

The fix is to fetch the value before comparing the contents.  The
comment additions to value.h explain why it can't be
value_available_contents_eq itself that fetches the contents.

Tested on x86_64 Fedora 17.

gdb/
2013-06-28  Pedro Alves  <palves@redhat.com>

	PR tui/14880
	* tui/tui-regs.c (tui_get_register): Fetch register value contents
	before checking whether they're available.
	* value.c (value_available_contents_eq): Change comment.
	* value.h (value_available_contents_eq): Expand comment.
2013-06-28 12:36:48 +00:00
Mircea Gherzan 257b6bec77 gdbserver: fix the standalone build
When directly invoking gdb/gdbserver/configure && make, the build will
fail because the $(host_alias) is empty and thus create-version.sh does
not get enough parameters.

The output of gdbserver --version without this patch (built like above):

  [...]
  This gdbserver was configured as ""

After applying this patch:

  [...]
  This gdbserver was configured as "x86_64-unknown-linux-gnu"

2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>

gdbserver:

	* configure.ac (version_host, version_target): Set and AC_SUBST
	them.
	* configure: Rebuild.
	* Makefile.in (version_host, version_target): Get from
	configure.
	(version.c): Use $(version_host) and $(version_target).

Change-Id: Id48240532ad3d624ec78867a6db5ebd4c09583ff
Signed-off-by: Mircea Gherzan <mircea.gherzan@intel.com>
2013-06-28 12:29:15 +00:00
Tom Tromey 97b1715633 * target.c (find_run_target): Remove.
* target.h (find_run_target): Remove.
2013-06-27 19:52:41 +00:00
Tom Tromey 6a3bfc5cda * corelow.c (core_gdbarch): Now static. 2013-06-27 19:38:55 +00:00
Tom Tromey c9ef825d2e * target.c (target_struct_index): Remove. 2013-06-27 19:38:24 +00:00
Pedro Alves e5823f1cb5 Move comment on the 'stepping over resolver' mechanism to the internals manual.
This whole comment is now a bit out of place.  I looked into moving it
to handle_inferior_event, close to where in_solib_dynsym_resolve_code
is used, but then there are 3 such places.  I then looked at
fragmenting it, pushing bits closer to the definitions of
in_solib_dynsym_resolve_code and gdbarch_skip_solib_resolver, but then
we'd lose the main advantage which is the overview.  In the end, I
realized this can fit nicely as internals manual material.

This could possibly be a subsection of a new "run control", or "source
stepping" or "stepping" or some such a bit more general section, but
we can do that when we have more related content...  Even the "single
stepping" section is presently empty...

gdb/doc/
2013-06-27  Pedro Alves  <palves@redhat.com>

	* gdbint.texinfo (Algorithms) <Stepping over runtime loader
	dynamic symbol resolution code>: New section, based on infrun.c
	comment.

gdb/
2013-06-27  Pedro Alves  <palves@redhat.com>

	* infrun.c: Remove comment describing the 'stepping over runtime
	loader dynamic symbol resolution code' mechanism; moved to
	gdbint.texinfo.
2013-06-27 19:17:27 +00:00
Tom Tromey a8c97a8765 Fix up broken ChangeLog entries.
In some previous commits I forgot to prefix the file names with
"gdb.base".  This fixes the ChangeLog entries to be correct.
2013-06-27 19:04:28 +00:00
Tom Tromey 62cef5152a test suite update - gdb.base/[t-z]
Convert files gdb.base/[t-z]*.exp to use standard_output_file et al.

	* gdb.base/testenv.exp, gdb.base/tui-layout.exp,
	gdb.base/twice.exp, gdb.base/type-opaque.exp, gdb.base/unload.exp,
	gdb.base/unwindonsignal.exp, gdb.base/valgrind-db-attach.exp,
	gdb.base/valgrind-infcall.exp, gdb.base/value-double-free.exp,
	gdb.base/varargs.exp, gdb.base/watch-cond-infcall.exp,
	gdb.base/watch-cond.exp, gdb.base/watch-non-mem.exp,
	gdb.base/watch-read.exp, gdb.base/watch-vfork.exp,
	gdb.base/watch_thread_num.exp, gdb.base/watchpoint-cond-gone.exp,
	gdb.base/watchpoint-delete.exp, gdb.base/watchpoint-hw.exp,
	gdb.base/watchpoint-solib.exp, gdb.base/watchpoint.exp,
	gdb.base/watchpoints.exp, gdb.base/wchar.exp, gdb.base/whatis.exp:
	Use standard_testfile, standard_output_file, prepare_for_testing,
	clean_restart.
2013-06-27 19:00:47 +00:00
Tom Tromey 0ab77f5fa2 test suite update - gdb.base/s*
Convert files gdb.base/s*.exp to use standard_output_file et al.

	* gdb.base/save-bp.exp, gdb.base/savedregs.exp,
	gdb.base/scope.exp, gdb.base/sep.exp, gdb.base/sepsymtab.exp,
	gdb.base/set-lang-auto.exp, gdb.base/setshow.exp,
	gdb.base/setvar.exp, gdb.base/shlib-call.exp,
	gdb.base/shreloc.exp, gdb.base/sigall.exp,
	gdb.base/sigaltstack.exp, gdb.base/sigbpt.exp,
	gdb.base/sigchld.exp, gdb.base/siginfo-addr.exp,
	gdb.base/siginfo-infcall.exp, gdb.base/siginfo-obj.exp,
	gdb.base/siginfo.exp, gdb.base/signals.exp, gdb.base/signest.exp,
	gdb.base/signull.exp, gdb.base/sigrepeat.exp,
	gdb.base/sigstep.exp, gdb.base/sizeof.exp,
	gdb.base/skip-solib.exp, gdb.base/so-impl-ld.exp,
	gdb.base/solib-display.exp, gdb.base/solib-nodir.exp,
	gdb.base/solib-overlap.exp, gdb.base/solib-symbol.exp,
	gdb.base/solib-weak.exp, gdb.base/source.exp,
	gdb.base/stack-checking.exp, gdb.base/stale-infcall.exp,
	gdb.base/stap-probe.exp, gdb.base/start.exp,
	gdb.base/step-break.exp, gdb.base/step-bt.exp,
	gdb.base/step-line.exp, gdb.base/step-resume-infcall.exp,
	gdb.base/step-test.exp, gdb.base/structs.exp,
	gdb.base/structs2.exp, gdb.base/structs3.exp,
	gdb.base/symbol-without-target_section.exp: Use standard_testfile,
	standard_output_file, prepare_for_testing, clean_restart.
2013-06-27 18:58:28 +00:00
Tom Tromey 822bd149bf test suite update - gdb.base/[n-r]
Convert files gdb.base/[n-r]*.exp to use standard_output_file et al.

	* gdb.base/nextoverexit.exp, gdb.base/nextoverexit.exp,
	gdb.base/nodebug.exp, gdb.base/nofield.exp, gdb.base/nostdlib.exp,
	gdb.base/opaque.exp, gdb.base/overlays.exp, gdb.base/pc-fp.exp,
	gdb.base/pending.exp, gdb.base/permissions.exp,
	gdb.base/pie-execl.exp, gdb.base/pointers.exp,
	gdb.base/pr11022.exp, gdb.base/print-file-var.exp,
	gdb.base/printcmds.exp, gdb.base/prologue.exp,
	gdb.base/psymtab.exp, gdb.base/ptr-typedef.exp,
	gdb.base/ptype.exp, gdb.base/randomize.exp,
	gdb.base/readline-ask.exp, gdb.base/recpar.exp,
	gdb.base/recurse.exp, gdb.base/relativedebug.exp,
	gdb.base/relocate.exp, gdb.base/remote.exp, gdb.base/reread.exp,
	gdb.base/return-nodebug.exp, gdb.base/return2.exp: Use
	standard_testfile, standard_output_file, prepare_for_testing,
	clean_restart.
2013-06-27 18:53:49 +00:00
Tom Tromey f8b41b0022 test suite update - gdb.base/[h-m]
Convert files gdb.base/[h-m]*.exp to use standard_output_file et al.

	* hook-stop-continue.exp, hook-stop-frame.exp, huge.exp,
	included.exp, inferior-died.exp, infnan.exp, info-fun.exp,
	info-macros.exp, info-os.exp, info-proc.exp, info-target.exp,
	infoline.exp, interp.exp, interrupt.exp, jit-simple.exp,
	jit-so.exp, jump.exp, kill-after-signal.exp, label.exp, langs.exp,
	lineinc.exp, list.exp, logical.exp, long_long.exp, longjmp.exp,
	macscp.exp, maint.exp, memattr.exp, mips_pro.exp, miscexprs.exp,
	morestack.exp, moribund-step.exp, multi-forks.exp: Use
	standard_testfile, standard_output_file, prepare_for_testing,
	clean_restart.
2013-06-27 18:51:31 +00:00
Tom Tromey 289f9037cb test suite update - gdb.base/[efg]
Convert files gdb.base/[efg]*.exp to use standard_output_file et al.

	* ena-dis-br.exp, enum_cond.exp, enumval.exp, environ.exp,
	eu-strip-infcall.exp, eval-skip.exp, exe-lock.exp,
	expand-psymtabs.exp, exprs.exp, fileio.exp, find.exp,
	fixsection.exp, foll-exec.exp, foll-fork.exp,
	fortran-sym-case.exp, frame-args.exp, freebpcmd.exp, fullname.exp,
	funcargs.exp, gcore-buffer-overflow.exp, gcore.exp, gdb1090.exp,
	gdb11530.exp, gdb11531.exp, gdb1250.exp, gdb1555.exp, gdb1821.exp,
	gdbindex-stabs.exp, gdbvars.exp, gnu-ifunc.exp, gnu_vector.exp:
	Use standard_testfile, standard_output_file, prepare_for_testing,
	clean_restart.
2013-06-27 18:50:30 +00:00
Tom Tromey f76495c88c test suite update - gdb.base/[cd]
Convert files gdb.base/[cd]*.exp to use standard_output_file et al.

	* call-ar-st.exp, call-rt-st.exp, call-sc.exp,
	call-signal-resume.exp, call-strs.exp, callexit.exp,
	callfuncs.exp, catch-load.exp, catch-syscall.exp, charset.exp,
	checkpoint.exp, chng-syms.exp, code-expr.exp, code_elim.exp,
	commands.exp, completion.exp, complex.exp, cond-expr.exp,
	condbreak.exp, consecutive.exp, constvars.exp, corefile.exp,
	ctxobj.exp, cursal.exp, cvexpr.exp, dbx.exp, default.exp,
	define.exp, del.exp, detach.exp, dfp-test.exp, display.exp,
	dmsym.exp, dump.exp, dup-sect.exp: Use standard_testfile,
	standard_output_file, prepare_for_testing, clean_restart.
2013-06-27 18:49:03 +00:00