Commit Graph

73426 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
Alan Modra 436ab6fd1b daily update 2012-06-05 00:00:04 +00:00
Cary Coutant fad072ac13 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
has_dynsym_index.
2012-06-04 20:00:31 +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
Alan Modra bb3a4c1019 daily update 2012-06-04 00:00:03 +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
Alan Modra aef36ac1fc PR binutils/13897
* elf.c (elf_find_function): Cache last function sym info.
	(_bfd_elf_maybe_function_sym): Return function size, pass in
	section of interest.
	* elf-bfd.h (struct elf_backend_data <maybe_function_sym>): Likewise.
	(_bfd_elf_maybe_function_sym): Likewise.
	* elf64-ppc.c (ppc64_elf_maybe_function_sym): Likewise.
	(opd_entry_value): Add in_code_sec param.  Revert caching code.
	Return -1 if in_code_sec and function found in wrong section.
	Update all calls.
2012-06-03 04:08:07 +00:00
gdbadmin 94bf648691 *** empty log message *** 2012-06-03 00:00:33 +00:00
Alan Modra e8403b7398 daily update 2012-06-03 00:00:02 +00:00
Andreas Schwab 959a202ebc gprof/
* Makefile.am (TEXINFO_TEX): Remove $(top_srcdir) prefix.
	* Makefile.in: Regenerate.

ld/
	* Makefile.am (TEXINFO_TEX): Remove $(top_srcdir) prefix.
	* Makefile.in: Regenerate.
2012-06-02 10:19:24 +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
Alan Modra 8c937023fb daily update 2012-06-02 00:00:02 +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
Alan Modra ee1e4edefe PR binutils/13897
* elf64-ppc.c (opd_entry_value): Rewrite cache code.
2012-06-01 12:26:55 +00:00
H.J. Lu 145fa769e6 Revert the last change 2012-06-01 02:28:32 +00:00
Alan Modra 670b0bad30 * addr2line.c (translate_addresses): Truncate input addresses to
arch_size bits.  Avoid undefined shift.  Print '?' for zero line.
2012-06-01 01:04:29 +00:00
gdbadmin cb66d1c018 *** empty log message *** 2012-06-01 00:00:04 +00:00
Alan Modra 0acc1ee90a daily update 2012-06-01 00:00:03 +00:00
Sean Keys 19f55fe4ff gas/
* tc-xgate.c (md_begin): Refactored code.
2012-05-31 22:10:53 +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
H.J. Lu 2d376810dc Move linker test entry to ld/testsuite/ChangeLog 2012-05-31 18:21:37 +00:00
H.J. Lu 653c23d819 Add missing "foo" after ".global"
2012-05-31  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-ifunc/ifunc-13a-x86-64.s: Add missing "foo" after ".global".
	* ld-ifunc/ifunc-15-x86-64.s: Likewise.
2012-05-31 17:16:54 +00:00
H.J. Lu 65db8fa586 Fix ChangeLog entry 2012-05-31 17:03:18 +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
Nick Clifton ea52a08872 * readelf.c (process_section_headers): Correct bug in previous
delta - display full section type in wide mode.

	* ld-tic6x/shlib-1b.rd: Revert previous delta.
	* ld-tic6x/shlib-1rb.rd: Likewise.
	* ld-tic6x/shlib-1.rd: Likewise.
	* ld-tic6x/shlib-1r.rd: Likewise.
	* ld-tic6x/shlib-app-1b.rd: Likewise.
	* ld-tic6x/shlib-app-1rb.rd: Likewise.
	* ld-tic6x/shlib-app-1.rd: Likewise.
	* ld-tic6x/shlib-app-1r.rd: Likewise.
	* ld-tic6x/shlib-noindex.rd: Likewise.
	* ld-tic6x/static-app-1b.rd: Likewise.
	* ld-tic6x/static-app-1rb.rd: Likewise.
	* ld-tic6x/static-app-1.rd: Likewise.
	* ld-tic6x/static-app-1r.rd: Likewise.
2012-05-30 14:33:12 +00:00