Commit Graph

30583 Commits

Author SHA1 Message Date
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 c56e7c4390 Make ctxobj.exp and print-file-var.exp work on all platforms.
This patch adjusts the testing strategy used in a couple of testcases
where we are trying to print the value of a global variable defined
at multiple locations.  The problem is that the actual value depends
on the platform.  So instead of hard-coding the expected value in
the testcase script, we use local variables (in the inferior) holding
the correct value, and we compare the global variable's value with
the local variable's value.

gdb/testsuite/ChangeLog:

        * gdb.base/ctxobj-f.c (GET_VERSION): Introduce local variable
        and add comment.
        * gdb.base/ctxobj-m.c (main): Rewrite, and add comment.
        * gdb.base/ctxobj.exp: Insert breakpoint in ctxobj-f.c using
        "STOP" marker.  Adjust testing strategy to make it work on
        all targets.

        * gdb.base/print-file-var-main.c (main): Rewrite using local
        variables and adjust get_version_2's return value check.
        Add small comment.
        * gdb.base/print-file-var.exp: Insert breakpoint using "STOP"
        marker.  Adjust testing strategy to make it work on all targets.
2012-06-05 13:50:31 +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 118b858c0a stubs/ia64vms-stub.c: Fix copyright header.
There is an extra coma after the copyright year which tricks
gnulib's update-copyright script.

gdb/stubs/ChangeLog:

        * ia64vms-stub.c: Adjust copyright header to follow convention
        expected by gnulib's update-copyright script.
2012-06-05 13:29:14 +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
gdbadmin b741167bcb *** empty log message *** 2012-06-05 00:00:33 +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
gdbadmin d2869f81cc *** empty log message *** 2012-06-04 00:00:02 +00:00
Jan Kratochvil 952cf74c00 gdb/testsuite/
* gdb.base/code_elim.exp
	(add-symbol-file ${testfile1} 0x100000)
	(add-symbol-file ${testfile2} 0x200000): Wrap them to 'order1' and
	'order2'.
	(order1: add-symbol-file ${testfile1} 0x100000)
	(order1: add-symbol-file ${testfile2} 0x200000)
	(order2: add-symbol-file ${testfile2} 0x200000)
	(order2: add-symbol-file ${testfile1} 0x100000): Add -s .data and -s
	.bss as appropriate.
2012-06-03 17:10:28 +00:00
Jan Kratochvil d0d8615806 gdb/testsuite/
* gdb.base/code_elim.exp (add-symbol-file ${testfile1} 0x100000):
	Simplify it to ...
	(symbol-file ${testfile1}): ... here.
	(test eliminated var my_global_symbol)
	(test eliminated var my_static_symbol)
	(test eliminated var my_global_func, get address of main): Wrap them to
	'single psymtabs' and 'single symtabs'
	(get address of my_global_symbol, get address of my_static_symbol)
	(get address of my_global_func, get address of main): Wrap them to
	'order1' and 'order2'.
2012-06-03 17:06:04 +00:00
gdbadmin 94bf648691 *** empty log message *** 2012-06-03 00:00:33 +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
gdbadmin 124d95f6ca *** empty log message *** 2012-06-02 00:00:32 +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 89dc0afdc9 gdb/gdbserver/
Fix gcc -flto compilation warning.
	* server.c (main): Make variable multi_mode and attach volatile.
2012-06-01 16:50:11 +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
gdbadmin cb66d1c018 *** empty log message *** 2012-06-01 00:00:04 +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
gdbadmin f715a0fb03 *** empty log message *** 2012-05-31 00:00:33 +00:00
Thiago Jung Bauermann 75f62ce7b7 * linux-low.c (get_r_debug): Disable code using DT_MIPS_RLD_MAP
if the platform doesn't know about it.
2012-05-30 19:51:38 +00:00
Pedro Alves 65f479b6ef 2012-05-30 Jeff Kenton <jkenton@tilera.com>
* Makefile.in (SFILES): Add linux-tile-low.c.
	(linux-tile-low.o, reg-tilegx.o, reg-tilegx.c): New rules.
	* configure.srv: Handle tilegx-*-linux*.
	* linux-tile-low.c: New file.
2012-05-30 19:43:15 +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
gdbadmin b887615911 *** empty log message *** 2012-05-30 00:00:33 +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
Doug Evans 0a0edcd5c2 * stabsread.h (cleanup_undefined_stabs_types): Renamed from
cleanup_undefined_types.
	* stabsread.c (cleanup_undefined_stabs_types): Ditto.
	All callers updated.
2012-05-29 18:54:50 +00:00
Tom Tromey 6f0c7050fc bfd/
* opncls.c (bfd_fopen): Always close fd on failure.
	(bfd_fdopenr): Likewise.
gdb/
	* symfile.c (symfile_bfd_open): Don't close desc if bfd_fopen
	fails.
	* solib.c (solib_bfd_fopen): Don't close fd if bfd_fopen fails.
	* exec.c (exec_file_attach): Don't close scratch_chan if bfd_fopen
	fails.
	* dwarf2read.c (try_open_dwo_file): Don't close fd if bfd_fopen
	fails.
2012-05-29 14:23:40 +00:00
Tristan Gingold ec95993ca4 2012-05-29 Tristan Gingold <gingold@adacore.com>
* solib-darwin.c (dyld_all_image_addr, dyld_all_image): Move into...
	(struct darwin_info): ... New struct.
	(solib_darwin_pspace_data): New variable.
	(darwin_pspace_data_cleanup): New function.
	(get_darwin_info): Likewise.
	(darwin_dyld_version_ok, darwin_load_image_infos)
	(darwin_solib_get_all_image_info_addr_at_init)
	(darwin_solib_read_all_image_info_addr): Add info argument.
	Adjust code.
	(darwin_current_sos): Use per pspace structure.
	(darwin_solib_create_inferior_hook): Likewise.
	(darwin_clear_solib): Likewise.
	(_initialize_darwin_solib): Initialize solib_darwin_pspace_data.
2012-05-29 12:59:53 +00:00
gdbadmin 8bb3cf8bac *** empty log message *** 2012-05-29 00:00:04 +00:00
Pedro Alves ae25568b69 2012-05-28 Pedro Alves <palves@redhat.com>
* infrun.c (wait_for_inferior): Move ecss and ecs locals to the
	block that uses them.  Clear ecss before handling each event.
2012-05-28 20:43:26 +00:00
Jan Kratochvil 0c5bf5a97d gdb/
* solib-svr4.c (svr4_current_sos): New comment on
	svr4_current_sos_via_xfer_libraries fall back.

gdb/gdbserver/
	* linux-low.c (linux_qxfer_libraries_svr4): Return -1 if R_DEBUG is -1.

gdb/testsuite/
	* gdb.server/solib-list-lib.c: New file.
	* gdb.server/solib-list-main.c: New file.
	* gdb.server/solib-list.exp: New file.
2012-05-28 20:37:29 +00:00
gdbadmin d55f95fab0 *** empty log message *** 2012-05-28 00:00:32 +00:00
gdbadmin 39dc1b2e6a *** empty log message *** 2012-05-27 00:00:32 +00:00
gdbadmin 6af28bcef9 *** empty log message *** 2012-05-26 00:00:02 +00:00
Maciej W. Rozycki 4196f32530 * gdb.trace/unavailable.exp (gdb_collect_globals_test): Update
for 'set print symbol' change.
2012-05-25 21:54:16 +00:00
gdbadmin 696bec38c6 *** empty log message *** 2012-05-25 00:00:02 +00:00
Jan Kratochvil bfb05775e6 gdb/
* psymtab.c (lookup_symbol_aux_psymtabs): New variable stab_best.  Use
	it as a fallback for TYPE_IS_OPAQUE.
	* symfile.h (struct quick_symbol_functions): Mention TYPE_OPAQUE
	symbols for lookup_symbol.

gdb/testsuite/
	* gdb.dwarf2/dw2-icc-opaque.S: Add debug_info_seg3 and
	.debug_abbrev_seg3.
2012-05-24 22:14:36 +00:00