Commit Graph

18912 Commits

Author SHA1 Message Date
Pedro Alves d5ad6aa5ce 2012-06-11 Pedro Alves <palves@redhat.com>
Remove #if 0'd "connect" command, and unnecessary associated
	refcounting and serial reuse bits.

	* serial.h (struct serial): Remove fields 'next' and 'refcnt'.
	* serial.c (last_serial_opened): Delete.
	(scb_base): Delete.
	(serial_open): Adjust.
	(serial_for_fd): Delete.
	(serial_fdopen_ops, do_serial_close): Adjust.
	(serial_fdopen_ops): Adjust.
2012-06-11 20:33:56 +00:00
Pedro Alves 318aa544a8 2012-06-11 Pedro Alves <palves@redhat.com>
* serial.c (do_serial_close): Remove early return when SCB is
	null.
2012-06-11 20:32:29 +00:00
Tom Tromey 0726159622 * dwarf2read.c (dw2_get_file_names_reader): Ignore partial units. 2012-06-11 20:19:22 +00:00
Jan Kratochvil cc80f26716 gdb/
Fix regression by the "ambiguous linespec" series.
	* breakpoint.c (parse_breakpoint_sals): New variable cursal.  Use
	get_last_displayed_symtab and get_last_displayed_line and depending
	on CURSAL.

gdb/testsuite/
	Fix regression by the "ambiguous linespec" series.
	* gdb.base/break.exp (list marker1, break lineno, delete $bpnum): New
	tests.
2012-06-11 19:16:24 +00:00
Tom Tromey 356d9f9d9e * dwarf2read.c (dw2_get_primary_filename_reader): New function.
(dw2_find_symbol_file): Use it.
2012-06-11 18:45:01 +00:00
Michael Eager 232b87049a *** empty log message *** 2012-06-11 16:08:21 +00:00
Tom Tromey e81a37f7ed * infrun.c (handle_inferior_event)
<BPSTAT_WHAT_SET_LONGJMP_RESUME>: Don't delete the step-resume
	breakpoint.
	<BPSTAT_WHAT_CLEAR_LONGJMP_RESUME>: Remove longjmp logic; use
	exception logic in all cases.  Update comments.
	(insert_longjmp_resume_breakpoint): Set the exception resume
	breakpoint.
testsuite
	* gdb.base/longjmp.c (hidden_longjmp): Move expected catch
	location...
	(main): ...here.
2012-06-11 15:15:06 +00:00
Maciej W. Rozycki 2e81047f91 * mips-tdep.c (mips_push_dummy_code): Handle microMIPS code. 2012-06-11 10:11:14 +00:00
Siva Chandra Reddy 4e32eda7cb 2012-06-09 Siva Chandra Reddy <sivachandra@google.com>
* valarith.c (binop_types_user_defined_p): Fix a typo.
2012-06-09 07:36:43 +00:00
Yao Qi 18648a3749 gdb/
* arch-utils.c (default_return_in_first_hidden_param_p): New.
	* arch-utils.h: Declare.
	* gdbarch.sh: Add return_in_first_hidden_param_p.
	* gdbarch.c, gdbarch.h: Regenerated.
	* infcall.c (call_function_by_hand): Call
	gdbarch_return_in_first_hidden_param_p instead of
	language_pass_by_reference.

	* m68k-tdep.c (m68k_return_in_first_hidden_param_p): New.
	(m68k_gdbarch_init): Install m68k_return_in_first_hidden_param_p.
	* sh-tdep.c (sh_return_in_first_hidden_param_p): New.
	(sh_gdbarch_init): Install sh_return_in_first_hidden_param_p.
	* tic6x-tdep.c (tic6x_push_dummy_call): Remove local variable
	`cplus_return_struct_by_reference'.
	(tic6x_return_value): Handle language cplusplus.
	(tic6x_return_in_first_hidden_param_p): New.
	(tic6x_gdbarch_init): Install tic6x_return_in_first_hidden_param_p.
2012-06-08 14:24:57 +00:00
Doug Evans 034e5797f0 * dwarf2read.c (dwarf2_cu): Add comment. 2012-06-07 17:30:12 +00:00
Maciej W. Rozycki 6a00aa1e22 * mips-tdep.c (mips_pseudo_register_type): Remove tdep local
variable.
	(mips_eabi_push_dummy_call): Likewise.
	(mips_n32n64_push_dummy_call): Likewise.
	(mips_o32_push_dummy_call): Likewise.
	(mips_o64_push_dummy_call): Likewise.
2012-06-06 21:34:12 +00:00
Maciej W. Rozycki eaa05d599e * mips-tdep.c (mips_convert_register_p): Correct coding style. 2012-06-06 21:27:37 +00:00
Maciej W. Rozycki de13fcf2f4 * mips-tdep.c (mips_pseudo_register_type): Use
mips_float_register_p.
2012-06-06 19:34:31 +00:00
Pedro Alves c3a01a2280 2012-06-06 Pedro Alves <palves@redhat.com>
* infrun.c (handle_inferior_event): Remove calls to
	reinit_frame_cache that follow a context_switch call.
2012-06-06 19:27:23 +00:00
Pedro Alves d25f45d93a 2012-06-06 Pedro Alves <palves@redhat.com>
* infrun.c (handle_inferior_event) <deferred_step_ptid>: Use
	context_switch and remove stale comment.
2012-06-06 18:40:06 +00:00
Pedro Alves 359f5fe60e gdb/
2012-06-06  Pedro Alves  <palves@redhat.com>

	* infrun.c (struct execution_control_state): Remove
	`new_thread_event' field.
	(handle_inferior_event): Simplify new threads handling; don't
	resume the inferior if we find a new thread.

gdb/testsuite/
2012-06-06  Pedro Alves  <palves@redhat.com>

	* gdb.threads/clone-new-thread-event.c: New file.
	* gdb.threads/clone-new-thread-event.exp: New file.
2012-06-06 18:10:17 +00:00
Thomas Schwinge 2d4c29c5e6 gdb/
* NEWS: Document the deprecation of SH's 'regs' command.
	* inferior.h (all_registers_info): Add function declaration.
	* sh-tdep.c (sh_show_regs): Remove variable.
	(sh_generic_show_regs, sh3_show_regs, sh2e_show_regs, sh2a_show_regs)
	(sh2a_nofpu_show_regs, sh3e_show_regs, sh3_dsp_show_regs)
	(sh4_show_regs, sh4_nofpu_show_regs, sh_dsp_show_regs)
	(sh_show_regs_command): Remove functions.
	(sh_gdbarch_init): Don't set sh_show_regs.
	(_initialize_sh_tdep): Make the 'regs' command an deprecated alias to
	'info all-registers'.
	* sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs)
	(sh64_show_regs): Remove functions.
	* sh64-tdep.h (sh64_show_regs): Remove function declaration.

gdb/doc/
	* gdb.texinfo: Document the deprecation of SH's 'regs' command.
2012-06-06 18:03:54 +00:00
Jan Kratochvil f5f1cdb612 gdb/
* configure.ac: Move development=true below AC_INIT.
	* configure: Regenerate.
2012-06-06 16:57:38 +00:00
Stan Shebs bf6309af86 * mi/mi-interp.c (mi_interpreter_init): Set raw_stdout from
gdb_stdout.
2012-06-06 06:04:46 +00:00
Jan Kratochvil 45aa465930 gdb/
* corefile.c (read_memory, read_stack, write_memory): Accept LEN
	argument as ssize_t.
	* gdbcore.h (read_memory, read_stack, write_memory): Likewise.
	* remote.c (remote_write_bytes_aux, remote_write_bytes): Likewise.
	* target.c (target_read_stack, target_write_memory)
	(target_write_raw_memory): Likewise.
	* target.h (target_read_stack, target_write_memory)
	(target_write_raw_memory): Likewise.
2012-06-05 21:22:31 +00:00
Jan Kratochvil 1b162304d1 gdb/
* symfile-mem.c: Change gdb_static_assert to ssize_t.
	(target_read_memory_bfd): Cast gdb_assert LEN to ssize_t.
	* target.c (target_read_memory): Change LEN to ssize_t.
	* target.h (target_read_memory): Change LEN to ssize_t.
2012-06-05 21:18:05 +00:00
Pedro Alves 8556afb4f5 2012-06-05 Pedro Alves <palves@redhat.com>
PR backtrace/13866

	* breakpoint.c (until_break_command): Only fetch the selected
	frame after decode_line_1.
2012-06-05 19:50:50 +00:00
Pedro Alves fb139f3251 2012-06-05 Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
* solib-svr4.c (enable_break): Don't fallback to setting the solib
	event breakpoint at _start, __start or main if a program
	interpreter is not found.
2012-06-05 15:44:03 +00:00
Joel Brobecker a8e1bb344d Windows-specific iterate_over_objfiles_in_search_order
This patch sets the windows target to use their own version of
the iterate_over_objfiles_in_search_order gdbarch method, in
order to make global symbol searches sensitive to the current
objfile.

gdb/ChangeLog:

        * windows-tdep.h (windows_iterate_over_objfiles_in_search_order):
        Add declaration.
        * windows-tdep.c: #include "objfiles.h".
        (windows_iterate_over_objfiles_in_search_order): New function.
        * amd64-windows-tdep.c (amd64_windows_init_abi): Set
        iterate_over_objfiles_in_search_order gdbarch method to
        windows_iterate_over_objfiles_in_search_order.
        * i386-cygwin-tdep.c (i386_cygwin_init_abi): Likewise.
2012-06-05 13:50:57 +00:00
Joel Brobecker 19630284f5 New "iterate_over_objfiles_in_search_order" gdbarch method.
This patch introduces the "iterate_over_objfiles_in_search_order"
gdbarch method, as well as its default implementation, and converts
the areas where it will matter to using this gdbarch method.

The default method implementation is the only one installed, and
the changes should have no functional impact in terms of behavior.
This only paves the way for the architectures that will need their
own version.

gdb/ChangeLog:

        * gdbarch.sh: Add generation of
        "iterate_over_objfiles_in_search_order_cb_ftype" typedef in
        gdbarch.h.  Add include of "objfiles.h" in gdbarch.c.
        (iterate_over_objfiles_in_search_order): New gdbarch method.
        * gdbarch.h, gdbarch.c: Regenerate.
        * objfiles.h (default_iterate_over_objfiles_in_search_order):
        Add declaration.
        * objfiles.c (default_iterate_over_objfiles_in_search_order):
        New function.
        * symtab.c (lookup_symbol_aux_objfile): New function, extracted
        out of lookup_symbol_aux_symtabs.
        (lookup_symbol_aux_symtabs): Replace extracted-out code by
        call to lookup_symbol_aux_objfile.
        (struct global_sym_lookup_data): New type.
        (lookup_symbol_global_iterator_cb): New function.
        (lookup_symbol_global): Search for symbol using
        gdbarch_iterate_over_objfiles_in_search_order and
        lookup_symbol_global_iterator_cb.
        * findvar.c (struct minsym_lookup_data): New type.
        (minsym_lookup_iterator_cb): New function.
        (default_read_var_value) [case LOC_UNRESOLVED]: Resolve the
        symbol's address via gdbarch_iterate_over_objfiles_in_search_order
        and minsym_lookup_iterator_cb.
2012-06-05 13:50:50 +00:00
Joel Brobecker 67ff19f7de Revert "Search global symbols from the expression's block objfile first."
The search order used in this patch breaks global symbol lookups
for certain symbols when copy-relocation is used.  A slightly different
search order will be implemented later.

gdb/ChangeLog:

        Revert the following patch:
        * findvar.c (default_read_var_value): For LOC_UNRESOLVED symbols,
        try locating the symbol in the symbol's own objfile first, before
        extending the search to all objfiles.
        * symtab.c (lookup_symbol_aux_objfile): New function, extracted
        out of lookup_symbol_aux_symtabs.
        (lookup_symbol_aux_symtabs): Add new parameter "exclude_objfile".
        Replace extracted-out code by call to lookup_symbol_aux_objfile.
        Do not search EXCLUDE_OBJFILE.
        (lookup_static_symbol_aux): Update call to lookup_symbol_aux_symtabs.
        (lookup_symbol_global): Search for matches in the block's objfile
        first, before searching all other objfiles.
2012-06-05 13:50:40 +00:00
Joel Brobecker ccab2054e9 stop parsing breakpoint command if invalid keyword found
With an Ada program, trying to break on a specific Ada task, but
with the wrong capitalization of the `task' keyword, we currently
get only pieces of the "garbage" that caused the error:

    (gdb) b *rendez_vous'address TASK 2
    Garbage 2 at end of command

Pushing this a little further:

    (gdb) b *rendez_vous'address TASK Task TaSK 2
    Garbage 2 at end of command

Another interesting failure mode:

    (gdb) b *rendez_vous'address TASK if
    Argument required (expression to compute).

The parser skipped `TASK', then found the `if' keyword, and thus
started looking for a condition.

This patch fixes the problem by aborting the parsing as soon as
an invalid keyword is found.  This makes it consistent with the
case where the REST parameter is passed as NULL (where an error
is raised immediately after seeing the first invalid keyword).

It also introduces a new testcase that reproduces all above scenarios.

gdb/ChangeLog:

        * breakpoint.c (find_condition_and_thread): Stop parsing
        as soon as the first invalid keyword is found.

gdb/testsuite/ChangeLog:

        * gdb.ada/bad-task-bp-keyword: New testcase.
2012-06-05 13:50:13 +00:00
Joel Brobecker e23d4a9c47 copyright.py: Add gdb/CONTRIBUTE to EXCLUDE_LIST.
Normally, all files should have a copyright header, but gdb/CONTRIBUTE
currently doesn't, and it adding one at the top of the file would
probably be more pollution than information.  So don't require
a copyright header for now.

gdb/ChangeLog:

        * copyright.py (EXCLUDE_LIST): Add 'gdb/CONTRIBUTE' to list.
2012-06-05 13:29:29 +00:00
Joel Brobecker 70160166c3 Add copyright header to config/djgpp/djcheck.sh.
gdb/ChangeLog:

        * config/djgpp/djcheck.sh: Add copyright header.
2012-06-05 13:29:22 +00:00
Joel Brobecker 399501a53f copyright.py: Update path to gnulib import.
The location where we store the gnulib import has changed.
This patch updates accordingly the path to gnulib's update-copyright
script.

gdb/ChangeLog:

        * copyright.py (update_files, main): Fix path to update-copyright
        script.
2012-06-05 13:29:07 +00:00
Joel Brobecker 3770a1599e copyright.py: Tell user to update gdb.texinfo and refcard.tex by hand.
gdb/ChangeLog:

        * copyright.py (MULTIPLE_COPYRIGHT_HEADERS): New constant.
        (main): Add MULTIPLE_COPYRIGHT_HEADERS to the list of files
        for which a reminder to update by hand is printed.
2012-06-05 13:28:59 +00:00
Doug Evans 4aad0dfce5 * buildsym.c (make_blockvector): Add comment. 2012-06-05 01:17:55 +00:00
Pedro Alves 1f8cf22072 2012-06-04 Pedro Alves <palves@redhat.com>
* arch-utils.c (default_gdb_signal_from_target): Delete.
	* arch-utils.h (default_gdb_signal_from_target): Delete.
	* corelow.c (core_open) <signal mapping>: Extended comment.  Check
	gdbarch_gdb_signal_from_target_p.
	* gdbarch.sh (gdb_signal_from_target): Make it an M method (with
	predicate).
	* gdbarch.h: Regenerate.
	* gdbarch.c: Regenerate.
2012-06-04 16:23:57 +00:00
Pedro Alves 86b4988036 2012-06-04 Pedro Alves <palves@redhat.com>
* gdbarch.sh (gdb_signal_from_target): Mention that the
	implementation of the method must be host independent.
	* gdbarch.h: Regenerate.
2012-06-04 16:23:16 +00:00
Jan Kratochvil fe78531dcf bfd/
* bfd-in.h (bfd_elf_bfd_from_remote_memory): Make LEN argument
	of target_read_memory as bfd_size_type.
	* bfd-in2.h: Regenerate.
	* elf-bfd.h (elf_backend_bfd_from_remote_memory): Make LEN
	argument of target_read_memory as bfd_size_type.
	(_bfd_elf32_bfd_from_remote_memory): Likewise.
	(_bfd_elf64_bfd_from_remote_memory): Likewise.
	* elf.c (bfd_elf_bfd_from_remote_memory): Likewise.
	* elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): Likewise.

gdb/
	* symfile-mem.c: 3 new gdb_static_assert for target_read_memory_bfd
	parameters.
	(target_read_memory_bfd): New function.
	(symbol_file_add_from_memory): Use it.
2012-06-04 14:35:25 +00:00
Doug Evans 78e5175a52 * symtab.c (lookup_global_symbol_from_objfile): Only scan blockvector
of primary symtab.
	(basic_lookup_transparent_type): Ditto.
2012-06-04 03:07:03 +00:00
Doug Evans d790cf0a9c * objfiles.h (ALL_OBJFILE_PRIMARY_SYMTABS): New macro.
(ALL_PRIMARY_SYMTABS): Use it.
	(ALL_PSPACE_PRIMARY_SYMTABS): Ditto.
	* dwarf2read.c (dw2_find_symbol_file): Ditto.
	* linespec.c (iterate_over_all_matching_symtabs): Ditto.
	* symtab.c (lookup_symbol_aux_objfile): Ditto.
	(basic_lookup_transparent_type): Ditto.
2012-06-04 02:57:28 +00:00
Sergio Durigan Junior c6e5ee5efa 2012-06-02 Sergio Durigan Junior <sergiodj@redhat.com>
* symtab.c (symbol_demangled_name): New variable `dem_name'.  Use
	it to optimize resolution of demangled name.
2012-06-02 04:34:23 +00:00
Jan Kratochvil a68ffae9e6 gdb/
* configure.ac (development): Define new variable.
	Call AC_CHECK_LIB for mcheck if $development.
	(ERROR_ON_WARNING): Enable it by default only if $development.
	* config.in: Regenerate.
	* configure: Regenerate.
2012-06-01 18:20:18 +00:00
Jan Kratochvil 5299c1c488 bfd/
* bfd-in.h (bfd_elf_bfd_from_remote_memory): Make LEN argument
	of target_read_memory as size_t.
	* bfd-in2.h: Regenerate.
	* elf-bfd.h (elf_backend_bfd_from_remote_memory): Make LEN
	argument of target_read_memory as size_t.
	(_bfd_elf32_bfd_from_remote_memory): Likewise.
	(_bfd_elf64_bfd_from_remote_memory): Likewise.
	* elf.c (bfd_elf_bfd_from_remote_memory): Likewise.
	* elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): Likewise.

gdb/
	* target.c (target_read_memory): Make LEN argument as size_t.
	* target.h (target_read_memory): Likewise.
2012-06-01 16:37:59 +00:00
Jan Kratochvil 7c71816c64 gdb/
* tilegx-linux-tdep.c (tilegx_l): Use ULL for 64-bit values.
2012-06-01 14:43:30 +00:00
Edjunior Barbosa Machado 0c56f59b40 * ppc-linux-nat.c (have_ptrace_booke_interface): Disable ptrace
BookE interface for PowerPC server processors if not available
in the Linux Kernel.
2012-05-31 22:07:31 +00:00
Keith Seitz 71bdabee21 * linespec.c (decode_objc): Add cleanup to free
INFO.FILE_SYMTABS.
	(find_linespec_symbols): Add cleanup to free CLASSES.
	* symfile.c (find_separate_debug_file_by_debuglink): Add
	cleanup to free DEBUGLINK.
	* ui-out.c (clear_header_list): No need to check if
	HEADER_NEXT.COLHDR is NULL.
	Free HEADER_NEXT.COL_NAME.
2012-05-31 18:44:50 +00:00
Matthew Gretton-Dann acbd605ddd * gdb/ada-lang.c (standard_lookup): Prevent uninitialized variable
warning.
2012-05-31 09:34:40 +00:00
Pedro Alves 65662cdeab 2012-05-30 Jeff Kenton <jkenton@tilera.com>
* configure.host (gdb_host_cpu): Handle tilegx*.
	(gdb_host): Handle tilegx-*-linux*.
	* tilegx-linux-nat.c: New file.
	* config/tilegx/linux.mh: New file.
2012-05-30 19:41:34 +00:00
Pedro Alves ade64f0e04 2012-05-30 Jeff Kenton <jkenton@tilera.com>
* Makefile.in (ALL_TARGET_OBJS): Add tilegx-tdep.o and
	tilegx-linux-tdep.o.
	(ALLDEPFILES): Add tilegx-linux-nat.c, tilegx-tdep.c and
	tilegx-linux-tdep.c.
	* configure.tgt: Handle tilegx-*-linux*.
	* tilegx-tdep.h: New file.
	* tilegx-tdep.c: New file.
	* tilegx-linux-tdep.c: New file.
	* regformats/reg-tilegx.dat: New file.
2012-05-30 19:31:44 +00:00
Edjunior Barbosa Machado bb08bdbd81 * ppc-linux-nat.c (ppc_linux_can_use_hw_breakpoint): fix
accounting of hw watchpoints on ppc.
2012-05-30 13:37:17 +00:00
Thiago Jung Bauermann ebd86fb568 * source.c (openp): Expand tilde in path entries. 2012-05-30 03:42:21 +00:00
Doug Evans 98cc87bdf3 * buildsym.c (block_compar): Fix comment.
(end_symtab): Fix and clarify some comments.
2012-05-29 20:23:17 +00:00