Nick Clifton [Wed, 9 Oct 2013 16:37:44 +0000 (16:37 +0000)]
Fix typo in previous delta.
Nick Clifton [Wed, 9 Oct 2013 16:34:30 +0000 (16:34 +0000)]
PR gprof/16027
* source.c (annotate_source): Close ifp.
* corefile.c (read_function_mappings): Close file.
Nick Clifton [Wed, 9 Oct 2013 16:30:02 +0000 (16:30 +0000)]
PR ld/16028
* ldmain.c (add_keepsyms_file): Close file at end of function.
Nick Clifton [Wed, 9 Oct 2013 16:24:43 +0000 (16:24 +0000)]
PR binutils/16022
* elf32-rx.c (rx_dump_symtab): Add missing break statements.
Nick Clifton [Wed, 9 Oct 2013 16:21:26 +0000 (16:21 +0000)]
PR binutils/16023
* debug.c (debug_type_samep): Add missing break statement.
Nick Clifton [Wed, 9 Oct 2013 16:17:23 +0000 (16:17 +0000)]
PR binutils/16024
* objdump.c (usage): Mark as a no-return function.
(main): Add comment explaining why a break statement is not
needed.
Nick Clifton [Wed, 9 Oct 2013 16:10:11 +0000 (16:10 +0000)]
PR gas/16025
* config/tc-epiphany.c (md_convert_frag): Add missing break
statement.
Jan Kratochvil [Wed, 9 Oct 2013 16:00:54 +0000 (16:00 +0000)]
Minor O_CLOEXEC optimization, "regression" fix
gdb/
2013-10-09 Jan Kratochvil <jan.kratochvil@redhat.com>
* common/filestuff.c (gdb_fopen_cloexec): Remove initialization of
result variable. Rename variable fopen_e_ever_failed to
fopen_e_ever_failed_einval. Retry fopen only for errno EINVAL.
Pedro Alves [Wed, 9 Oct 2013 15:55:17 +0000 (15:55 +0000)]
monitor.c: Don't install a deprecated_xfer_memory method.
This removes another yet instance of a deprecated_xfer_memory user.
Tested by building a --enable-targets=all gdb, on x86-64 Fedora 17.
gdb/
2013-10-09 Pedro Alves <palves@redhat.com>
* monitor.c (monitor_write_memory, monitor_write_memory_bytes)
(monitor_write_memory_longlongs, monitor_write_memory_block):
Constify 'myaddr' parameter.
(monitor_xfer_memory): Adjust interface as monitor_xfer_partial
helper.
(monitor_xfer_partial): New function.
(init_base_monitor_ops): Don't install a deprecated_xfer_memory
hook. Install a to_xfer_partial hook.
Nick Clifton [Wed, 9 Oct 2013 15:52:32 +0000 (15:52 +0000)]
PR gas/16026
* config/tc-mn10200.c (md_convert_frag): Add missing break
statement.
Tom Tromey [Wed, 9 Oct 2013 15:50:39 +0000 (15:50 +0000)]
* opncls.c (get_alt_debug_link_info_shim): Update type of 'len'.
Nick Clifton [Wed, 9 Oct 2013 15:44:27 +0000 (15:44 +0000)]
PR ld/16021
* elf32-rl78.c (rl78_dump_symtab): Delete.
(rl78_get_reloc): Delete.
Pedro Alves [Wed, 9 Oct 2013 14:31:35 +0000 (14:31 +0000)]
Uniquefy gdb.base/catch-syscall.exp test names.
catch-syscall.exp has a series of duplicated output in gdb.sum. This
patch makes sure all test names are unique, using with_test_prefix.
Tested on x86_64 Fedora 17.
gdb/testsuite/
2013-10-09 Pedro Alves <palves@redhat.com>
* gdb.base/catch-syscall.exp (test_catch_syscall_without_args)
(test_catch_syscall_with_args, test_catch_syscall_with_many_args)
(test_catch_syscall_with_wrong_args)
(test_catch_syscall_restarting_inferior)
(test_catch_syscall_fail_nodatadir)
(test_catch_syscall_without_args_noxml)
(test_catch_syscall_with_args_noxml)
(test_catch_syscall_with_wrong_args_noxml): Use with_test_prefix.
Tom Tromey [Wed, 9 Oct 2013 14:26:26 +0000 (14:26 +0000)]
bfd
* bfd-in2.h: Rebuild.
* opncls.c (bfd_get_alt_debug_link_info): Change type of
buildid_len to bfd_size_type.
gdb
* dwarf2read.c (dwarf2_get_dwz_file): Update for type change in
bfd_get_alt_debug_link_info.
Nick Clifton [Wed, 9 Oct 2013 14:06:00 +0000 (14:06 +0000)]
* dwarf.c (add64): New function.
(read_and_display_attr_value): Add CU offset in to the value
displayed for a DW_AT_ref8 attribute.
Jan Kratochvil [Wed, 9 Oct 2013 13:22:36 +0000 (13:22 +0000)]
New flag OBJF_NOT_FILENAME
gdb/
2013-10-09 Jan Kratochvil <jan.kratochvil@redhat.com>
New flag OBJF_NOT_FILENAME.
* auto-load.c (auto_load_objfile_script): Check also OBJF_NOT_FILENAME.
* jit.c (jit_object_close_impl): Use OBJF_NOT_FILENAME for
allocate_objfile.
(jit_bfd_try_read_symtab): Use OBJF_NOT_FILENAME for
symbol_file_add_from_bfd.
* jv-lang.c (get_dynamics_objfile): Use OBJF_NOT_FILENAME for
allocate_objfile.
* objfiles.c (allocate_objfile): Assert OBJF_NOT_FILENAME if NAME is
NULL.
* objfiles.h (OBJF_NOT_FILENAME): New.
Sergio Durigan Junior [Wed, 9 Oct 2013 05:23:23 +0000 (05:23 +0000)]
bfd/ChangeLog
2013-10-09 Sergio Durigan Junior <sergiodj@redhat.com>
PR binutils/15993
* elf32-m32c.c (dump_symtab): Add missing "break;" statement on each
"case". Reindent "switch" statements.
Alan Modra [Tue, 8 Oct 2013 23:00:05 +0000 (23:00 +0000)]
daily update
Tom Tromey [Tue, 8 Oct 2013 19:56:15 +0000 (19:56 +0000)]
fix PR symtab/15597
This patch fixes gdb PR symtab/15597.
The bug is that the .gnu_debugaltlink section includes the build-id of
the alt file, but gdb does not use it.
This patch fixes the problem by changing gdb to do what it ought to
always have done: verify the build id of the file found using the
filename in .gnu_debugaltlink; and if that does not match, try to find
the correct debug file using the build-id and debug-file-directory.
This patch touches BFD. Previously, gdb had its own code for parsing
.gnu_debugaltlink; I changed it to use the BFD functions after those
were introduced. However, the BFD functions are incorrect -- they
assume that .gnu_debugaltlink is formatted like .gnu_debuglink.
However, it it is not. Instead, it consists of a file name followed
by the build-id -- no alignment, and the build-id is not a CRC.
Fixing this properly is a bit of a pain. But, because
separate_alt_debug_file_exists just has a FIXME for the build-id case,
I did not fix it properly. Instead I introduced a hack. This leaves
BFD working just as well as it did before my patch.
I'm willing to do something better here but I could use some guidance
as to what. It seems that the build-id code in BFD is largely punted
on.
FWIW gdb is the only user of bfd_get_alt_debug_link_info outside of
BFD itself.
I moved the build-id logic out of elfread.c and into a new file.
This seemed cleanest to me.
Writing a test case was a bit of a pain. I added a couple new
features to the DWARF assembler to handle this.
Built and regtested on x86-64 Fedora 18.
* bfd-in2.h: Rebuild.
* opncls.c (bfd_get_alt_debug_link_info): Add buildid_len
parameter. Change type of buildid_out. Update.
(get_alt_debug_link_info_shim): New function.
(bfd_follow_gnu_debuglink): Use it.
* Makefile.in (SFILES): Add build-id.c.
(HFILES_NO_SRCDIR): Add build-id.h.
* build-id.c: New file, largely from elfread.c. Modified
most functions.
* build-id.h: New file.
* dwarf2read.c (dwarf2_get_dwz_file): Update for change to
bfd_get_alt_debug_link_info. Verify dwz file's build-id.
Search for dwz file using build-id.
* elfread.c (build_id_bfd_get, build_id_verify)
(build_id_to_debug_filename, find_separate_debug_file): Remove.
* gdb.dwarf2/dwzbuildid.exp: New file.
* lib/dwarf.exp (Dwarf::_section): Add "flags" and "type"
parameters.
(Dwarf::_defer_output): Change "section" parameter to
"section_spec"; update.
(Dwarf::gnu_debugaltlink, Dwarf::_note, Dwarf::build_id): New
procs.
Andreas Schwab [Tue, 8 Oct 2013 15:57:24 +0000 (15:57 +0000)]
* elf32-m68k.c (elf_m68k_size_dynamic_sections): Add DT_DEBUG also
for PIE executables.
Jan Beulich [Tue, 8 Oct 2013 15:21:58 +0000 (15:21 +0000)]
gas/
2013-10-08 Jan Beulich <jbeulich@suse.com>
* tc-i386.c (check_word_reg): Remove misplaced "else".
(check_long_reg): Restore symmetry with check_word_reg.
Jan Beulich [Tue, 8 Oct 2013 15:12:59 +0000 (15:12 +0000)]
opcodes/
2013-10-08 Jan Beulich <jbeulich@suse.com>
* i386-opc.tbl (invlpg): Use Anysize instead of Unspecified.
(clflush): Use Anysize instead of Byte|Unspecified.
(prefetch*): Likewise.
* i386-tbl.h: Re-generate.
Jan-Benedict Glaw [Tue, 8 Oct 2013 14:14:12 +0000 (14:14 +0000)]
2013-10-08 Jan-Benedict Glaw <jbglaw@lug-owl.de>
* configure.ac: Update from GCC.
* configure: Regenerate.
Joel Brobecker [Tue, 8 Oct 2013 11:18:58 +0000 (11:18 +0000)]
[Ada] psymbol search failure due to comparison function discrepancy
Upon trying to print the value of a variant record, a user noticed
the following problem:
(gdb) print rt
warning: Unknown upper bound, using 1.
warning: Unknown upper bound, using 1.
$1 = (a => ((a1 => (4), a2 => (4)), (a1 => (8), a2 => (8))))
The expected output is:
(gdb) print rt
$1 = (a => ((a1 => (4, 4), a2 => (8, 8)), (a1 => (4, 4),
a2 => (8, 8))))
The problems comes from the fact that components "a1" and "a2" are
defined as arrays whose upper bound is dynamic. To determine the value
of that upper bound, GDB relies on the GNAT encoding and searches
for the parallel ___U variable. Unfortunately, the search fails
while doing a binary search inside the partial symtab of the unit
where the array and its bound (and therefore the parallel ___U variable)
are defined.
It fails because partial symbols are sorted using strcmp_iw_ordered,
while Ada symbol lookups are performed using a different comparison
function (ada-lang.c:compare_names). The two functions are supposed
to be compatible, but a change performed in April 2011 modified
strcmp_iw_ordered, introducing case-sensitivity issues. As a result,
the two functions would now disagree when passed the following
two arguments:
string1="common__inner_arr___SIZE_A_UNIT"
string2="common__inner_arr__T4s___U"
The difference starts at "_SIZE_A_UNIT" vs "T4s___U". So, it's mostly
a matter of comparing '_' with 'T'.
On the one hand, strcmp_iw_ordered would return -1, while compare_names
returned 11. The change that made all the difference is that
strcmp_iw_ordered now performs a case-insensitive comparison,
and only resorts to case-sentitive comparison if the first comparison
finds an equality. This changes everything, because while 'T' (84)
and 't' (116) are on opposite sides of '_' (95).
This patch aims at restoring the compatibility between the two
functions, by adding case-sensitivity handling in the Ada comparison
function.
gdb/ChangeLog:
* ada-lang.c (compare_names_with_case): Renamed from
compare_names, adding a new parameter "casing" and its handling.
New function documentation.
(compare_names): New function, implemented using
compare_names_with_case.
Joel Brobecker [Tue, 8 Oct 2013 11:04:21 +0000 (11:04 +0000)]
Add missing ChangeLog entry.
Joel Brobecker [Tue, 8 Oct 2013 10:52:18 +0000 (10:52 +0000)]
[Ada] Remove unnecessary ada_exception_sal advance declaration.
gdb/ChangeLog:
* ada-lang.c (ada_exception_sal): Remove advance declaration.
Joel Brobecker [Tue, 8 Oct 2013 10:25:22 +0000 (10:25 +0000)]
gdb.ada/mi_catch_ex.exp: Make test names unique.
gdb/testsuite/ChangeLog:
* gdb.ada/mi_catch_ex.exp: Make "mi_execute_to" test names unique.
Jan Beulich [Tue, 8 Oct 2013 08:55:41 +0000 (08:55 +0000)]
gas/
2013-10-08 Jan Beulich <jbeulich@suse.com>
* gas/config/tc-arm.c (do_t_push_pop): Honor inst.size_req. Simplify
LR/PC check.
gas/testsuite/
2013-10-08 Jan Beulich <jbeulich@suse.com>
* gas/arm/thumb-w-good.s: Add PUSH.W and POP.W tests.
* gas/arm/thumb-w-good.d: Update accordingly.
Nick Clifton [Tue, 8 Oct 2013 08:06:35 +0000 (08:06 +0000)]
* config/tc-msp430.c (msp430_operands): Accept "<foo>.a" as an alias
for "<foo>a". Issue error messages for unrecognised or corrrupt
size extensions.
* gas/msp430/bad.s: New test: Checks erroneous size extensions.
* gas/msp430/bad.d: New test command file.
* gas/msp430/bad.l: New file: Expected error messages.
* gas/msp430/msp430.exp: Run the new test.
* gas/msp430/msp430x.s: Add "<foo>.a" aliases of "<foo>a"
instructions.
* gas/msp430/msp430x.d: Update expected disassembly.
Alan Modra [Mon, 7 Oct 2013 23:00:04 +0000 (23:00 +0000)]
daily update
Tom Tromey [Mon, 7 Oct 2013 19:40:38 +0000 (19:40 +0000)]
move the demangled_names_hash into the per-BFD
This moves the demangled_names_hash from the objfile into the per-BFD
object. This is part of the objfile splitting project.
The demangled names hash is independent of the program space. And, it
is needed by the symbol tables. Both of these things indicate that it
must be pushed into the per-BFD object, which this patch does.
Built and regtested on x86-64 Fedora 18.
* objfiles.c (free_objfile_per_bfd_storage): Delete the
demangled_names_hash.
(free_objfile): Don't delete the demangled_names_hash.
* objfiles.h (struct objfile_per_bfd_storage)
<demangled_names_hash>: New field.
(struct objfile) <demangled_names_hash>: Move to
objfile_per_bfd_storage.
* symfile.c (reread_symbols): Don't delete the
demangled_names_hash.
* symtab.c (create_demangled_names_hash): Update.
(symbol_set_names): Update.
Tom Tromey [Mon, 7 Oct 2013 19:31:13 +0000 (19:31 +0000)]
don't share per-BFD data if relocations are needed
Right now we always share per-BFD data across objfiles, if there is a
BFD. This works fine. However, we're going to start sharing more
data, and sometimes this data will come directly from sections of the
BFD. If such a section has SEC_RELOC set, then the data coming from
that section will not be truly sharable -- the section will be
program-space-dependent, and re-read by gdb for each objfile.
This patch disallows per-BFD sharing in this case. This is a bit
"heavy" in that we could in theory examine each bit of shared data for
suitability. However, that is more complicated, and SEC_RELOC is rare
enough that I think we needn't bother.
Note that the "no sharing" case is equivalent to "gdb works as it
historically did". That is, the sharing is a new(-ish) optimization.
Built and regtested on x86-64 Fedora 18.
* gdb_bfd.c (struct gdb_bfd_data) <relocation_computed,
needs_relocations>: New fields.
(gdb_bfd_requires_relocations): New function.
* gdb_bfd.h (gdb_bfd_requires_relocations): Declare.
* objfiles.c (get_objfile_bfd_data): Disallow sharing if
the BFD needs relocations applied.
Tom Tromey [Mon, 7 Oct 2013 19:10:45 +0000 (19:10 +0000)]
* lib/mi-support.exp (varobj_tree::walk_tree): Set _root_idx
to 0.
Chao-ying Fu [Mon, 7 Oct 2013 18:03:24 +0000 (18:03 +0000)]
2013-10-07 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
* gas/mips/micromips@virt64.d: Fix dmfgc0 and dmtgc0.
Chao-ying Fu [Mon, 7 Oct 2013 18:02:47 +0000 (18:02 +0000)]
2013-10-07 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
* micromips-opc.c (micromips_opcodes): Fix dmfgc0 and dmtgc0.
Cary Coutant [Mon, 7 Oct 2013 17:08:34 +0000 (17:08 +0000)]
gold/
PR gold/16010
* testsuite/Makefile.am (icf_test): Fix dependencies.
(icf_safe_test): Likewise.
(icf_safe_so_test): Likewise.
(large_symbol_alignment): Add empty _LDADD rule.
* testsuite/Makefile.in: Regenerate.
Pedro Alves [Mon, 7 Oct 2013 11:13:08 +0000 (11:13 +0000)]
[DOC] Mention what happens when the thread of a thread-specific breakpoint disappears.
We recently made GDB auto-delete thread-specific breakpoints when the
corresponding thread is removed from the thread list, but we hadn't
mentioned it in the manual.
gdb/
2013-10-07 Pedro Alves <palves@redhat.com>
PR breakpoints/11568
* gdb.texinfo (Thread-Specific Breakpoints): Mention what happens
when the thread is removed from the thread list.
Pedro Alves [Mon, 7 Oct 2013 11:00:23 +0000 (11:00 +0000)]
Thread-specific breakpoints: say "no longer in the thread list" instead of "gone".
It seems "gone" may confuse people, while that was exactly what it was
trying to avoid. Switch to saying "no longer in the thread list",
which is really the predicate GDB uses.
gdb/
2013-10-07 Pedro Alves <palves@redhat.com>
PR breakpoints/11568
* breakpoint.c (remove_threaded_breakpoints): Say "no longer in
the thread list" instead of "gone".
Sergio Durigan Junior [Mon, 7 Oct 2013 05:34:11 +0000 (05:34 +0000)]
This patch adds a new convenience variable called "$_exitsignal", which
will hold the signal number when the inferior terminates due to the
uncaught signal.
I've made modifications on infrun.c:handle_inferior_event such that
$_exitcode gets cleared when the inferior signalled, and vice-versa.
This assumption was made because the variables are mutually
exclusive, i.e., when the inferior terminates because of an uncaught
signal it is not possible for it to return. I have also made modifications
such that when a corefile is loaded, $_exitsignal gets set to the uncaught
signal that "killed" the inferior, and $_exitcode is cleared.
The patch also adds a NEWS entry, documentation bits, and a testcase. The
documentation entry explains how to use $_exitsignal and $_exitcode in a
GDB script, by making use of the new $_isvoid convenience function.
gdb/
2013-10-06 Sergio Durigan Junior <sergiodj@redhat.com>
* NEWS: Mention new convenience variable $_exitsignal.
* corelow.c (core_open): Reset exit convenience variables. Set
$_exitsignal to the uncaught signal which generated the corefile.
* infrun.c (handle_inferior_event): Reset exit convenience
variables. Set $_exitsignal for TARGET_WAITKIND_SIGNALLED.
(clear_exit_convenience_vars): New function.
* inferior.h (clear_exit_convenience_vars): New prototype.
gdb/testsuite/
2013-10-06 Sergio Durigan Junior <sergiodj@redhat.com>
* gdb.base/corefile.exp: Test whether $_exitsignal is set and
$_exitcode is void when opening a corefile.
* gdb.base/exitsignal.exp: New file.
* gdb.base/segv.c: Likewise.
* gdb.base/normal.c: Likewise.
gdb/doc/
2013-10-06 Sergio Durigan Junior <sergiodj@redhat.com>
* gdb.texinfo (Convenience Variables): Document $_exitsignal.
Update entry for $_exitcode.
Alan Modra [Sun, 6 Oct 2013 23:00:05 +0000 (23:00 +0000)]
daily update
Yao Qi [Sun, 6 Oct 2013 03:28:57 +0000 (03:28 +0000)]
gdb/
* varobj.h: Add comments to enum varobj_languages.
Alan Modra [Sat, 5 Oct 2013 23:00:05 +0000 (23:00 +0000)]
daily update
Doug Evans [Sat, 5 Oct 2013 02:10:29 +0000 (02:10 +0000)]
(dwarf2_section_info): Comment tweaks missed in previous checkin.
Doug Evans [Sat, 5 Oct 2013 01:44:17 +0000 (01:44 +0000)]
Add support for DWP file format version 2.
* NEWS: Mention support for DWP file format version 2.
* dwarf2read.c (dwarf2_section_info): Convert asection field to a
union of asection, containing_section. New fields virtual_offset
and is_virtual. Change type of readin filed from int to char.
(dwo_sections, dwo_file): Tweak comments.
(dwp_v2_section_ids): New enum.
(dwp_sections): New fields abbrev, info, line, loc, macinfo, macro,
str_offsets, types.
(virtual_v1_dwo_sections): Renamed from virtual_dwo_sections.
All uses updated.
(virtual_v2_dwo_sections): New struct.
(dwp_hash_table): New fields version, nr_columns. Change type of
section_pool field to a union.
(dwp_file): New field version.
(dwarf2_has_info): Check for virtual sections.
(get_containing_section): New function.
(get_section_bfd_owner, get_section_bfd_section): Call it.
(dwarf2_locate_sections): Update.
(dwarf2_section_empty_p): Update.
(dwarf2_read_section): Handle virtual sections.
(locate_dwz_sections): Update.
(create_dwp_hash_table): Document and handle V2 format.
(locate_v1_virtual_dwo_sections): Renamed from
locate_virtual_dwo_sections and update. All callers updated.
(create_dwo_unit_in_dwp_v1): Renamed from create_dwo_in_dwp.
Delete arg htab. Rename arg section_index to unit_index.
All callers updated.
(MAX_NR_V1_DWO_SECTIONS): Renamed from MAX_NR_DWO_SECTIONS.
All uses updated.
(create_dwp_v2_section, create_dwo_unit_in_dwp_v2): New functions.
(lookup_dwo_unit_in_dwp): Add V2 support.
(dwarf2_locate_dwo_sections): Update.
(dwarf2_locate_common_dwp_sections): Renamed from
dwarf2_locate_dwp_sections and update. All callers updated.
(dwarf2_locate_v2_dwp_sections): New function.
(open_and_init_dwp_file): Add V2 support.
(read_str_index): New locals str_section, str_offsets_section.
Alan Modra [Sat, 5 Oct 2013 00:00:05 +0000 (00:00 +0000)]
daily update
Kyrylo Tkachov [Fri, 4 Oct 2013 15:26:18 +0000 (15:26 +0000)]
[gas/]
2013-10-04 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/tc-arm.c (do_t_mvn_tst): Use narrow form for tst when
possible.
[gas/testsuite/]
2013-10-04 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gas/arm/thumb2_it.s: Add test for narrow tst.
* gas/arm/thumb2_it.d: Update expected output.
* gas/arm/thumb2_it_auto.d: Likewise.
Pedro Alves [Fri, 4 Oct 2013 10:04:14 +0000 (10:04 +0000)]
Clean up ptid.h/ptid.c.
The ptid_t contructors, accessors and predicates are documented in
_three_ places, and each place uses a different wording.
E.g, the descriptions in the .c file of the new ptid_lwp_p, ptid_tid_p
weren't updated in the final revision like the descriptions in the .h
file were. Clearly, switching to a style that has a single central
description avoids such issues.
Worse, some of the existing descriptions are plain wrong, such as:
/* Attempt to find and return an existing ptid with the given PID, LWP,
and TID components. If none exists, create a new one and return
that. */
ptid_t ptid_build (int pid, long lwp, long tid);
The function does nothing that complicated. It's just a simple
constructor.
So this gets rid of all the unnecessary descriptions, leaving only the
ones near the function declarations in the header file, and
fixes/clarifies those that remain.
gdb/
2013-10-04 Pedro Alves <palves@redhat.com>
* common/ptid.c (null_ptid, minus_one_ptid, ptid_build)
(pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid)
(ptid_equal, ptid_is_pid, ptid_lwp_p, ptid_tid_p): Replace
describing comments with references to ptid.h.
* common/ptid.h: Remove intro description of constructors,
accessors and predicates.
(struct ptid): Reformat.
(minus_one_ptid, ptid_build, pid_to_ptid, ptid_get_pid)
(ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid): Change
describing comments.
Joel Brobecker [Fri, 4 Oct 2013 08:56:09 +0000 (08:56 +0000)]
Fix syntax error in aix-thread.c:sync_threadlists
This patch fixes a small typo after the BUILD_THREAD -> ptid_build
conversion.
gdb/ChangeLog:
* aix-thread.c (sync_threadlists): Add missing ')' in call
to ptid_build.
Joel Brobecker [Fri, 4 Oct 2013 08:53:27 +0000 (08:53 +0000)]
Fix build failure in procfs.c after MERGEPID -> ptid_build conversion.
gdb/ChangeLog:
* procfs.c (procfs_init_inferior): Fix typo causing the build
to fail.
Joel Brobecker [Fri, 4 Oct 2013 08:52:24 +0000 (08:52 +0000)]
Remove unnecessary cast in aix-thread.c:ptrace32.
We're casting "addr" into "addr_ptr", but this variable is actually
a parameter with that very same type...
gdb/ChangeLog:
* aix-thread.c (ptrace32): Remove cast to addr_ptr.
Joel Brobecker [Fri, 4 Oct 2013 08:35:31 +0000 (08:35 +0000)]
Add support for --start option in -exec-run GDB/MI command.
gdb/ChangeLog:
* mi/mi-main.c (run_one_inferior): Add function description.
Make ARG a pointer to an integer whose value determines whether
we should "run" or "start" the program.
(mi_cmd_exec_run): Add handling of the "--start" option.
Reject all other command-line options.
* NEWS: Add entry for "-exec-run"'s new "--start" option.
gdb/doc/ChangeLog:
* gdb.texinfo (GDB/MI Program Execution): Document "-exec-run"'s
new "--start" option.
gdb/testsuite/ChangeLog:
* gdb.mi/mi-start.c, gdb.mi/mi-start.exp: New files.
Yao Qi [Fri, 4 Oct 2013 07:42:06 +0000 (07:42 +0000)]
Move pending_event to remote_notif_state.
This patch moves pending_event to remote_notif_state. All pending
events are destroyed in remote_notif_state_xfree. However,
discard_pending_stop_replies release pending event too, so the pending
event of stop notification is released twice, we need some refactor
here. We add a new function discard_pending_stop_replies_in_queue
which only discard events in stop_reply_queue, and let
remote_notif_state_xfree release pending event for all notif_client.
After this change, discard_pending_stop_replies is only attached to
ifnerior_exit observer, so the INF can't be NULL any more. The
NULL checking is removed too.
gdb:
2013-10-04 Yao Qi <yao@codesourcery.com>
* remote-notif.h (REMOTE_NOTIF_ID): New enum.
(struct notif_client) <pending_event>: Moved
to struct remote_notif_state.
<id>: New field.
(struct remote_notif_state) <pending_event>: New field.
(notif_event_xfree): Declare.
* remote-notif.c (handle_notification): Adjust.
(notif_event_xfree): New function.
(do_notif_event_xfree): Call notif_event_xfree.
(remote_notif_state_xfree): Call notif_event_xfree to free
each element in field pending_event.
* remote.c (discard_pending_stop_replies): Remove declaration.
(discard_pending_stop_replies_in_queue): Declare.
(remote_close): Call discard_pending_stop_replies_in_queue
instead of discard_pending_stop_replies.
(remote_start_remote): Adjust.
(stop_reply_xfree): Call notif_event_xfree.
(notif_client_stop): Adjust initialization.
(remote_notif_remove_all): Rename it to ...
(remove_stop_reply_for_inferior): ... this. Update comments.
Don't check INF is NULL.
(discard_pending_stop_replies): Return early if notif_state is
NULL. Adjust. Don't check INF is NULL.
(remote_notif_get_pending_events): Adjust.
(discard_pending_stop_replies_in_queue): New function.
(remote_wait_ns): Likewise.
Yao Qi [Fri, 4 Oct 2013 07:32:56 +0000 (07:32 +0000)]
Move notif_queue and remote_async_get_pending_events_token to remote_state
This patch also removes notif_xfree, and don't pass it QUEUE_alloc, because
we don't have to free notif_client when the remote_notif_state is freed.
gdb:
2013-10-04 Yao Qi <yao@codesourcery.com>
* remote-notif.c (DECLARE_QUEUE_P): Remove.
(notif_queue): Remove.
(remote_notif_process): Add one parameter 'notif_queue'.
Update comments. Callers update.
(remote_async_get_pending_events_token): Remove.
(remote_notif_register_async_event_handler): Remove.
(remote_notif_unregister_async_event_handler): Remove.
(handle_notification): Add parameter 'notif_queue'. Update
comments. Callers update.
(notif_xfree): Remove.
(remote_notif_state_allocate): New function.
(remote_notif_state_xfree): New function.
(_initialize_notif): Remove code to allocate queue.
* remote-notif.h (DECLARE_QUEUE_P): Moved from remote-notif.c.
(struct remote_notif_state): New.
(handle_notification): Update declaration.
(remote_notif_process): Likewise.
(remote_notif_register_async_event_handler): Remove.
(remote_notif_unregister_async_event_handler): Remove.
(remote_notif_state_allocate): Declare.
(remote_notif_state_xfree): Declare.
* remote.c (struct remote_state) <notif_state>: New field.
(remote_close): Don't call
remote_notif_unregister_async_event_handler. Call
remote_notif_state_xfree.
(remote_open_1): Don't call
remote_notif_register_async_event_handler. Call
remote_notif_state_allocate.
Yao Qi [Fri, 4 Oct 2013 07:16:44 +0000 (07:16 +0000)]
Fix FIXME: xstrdup should not be here
Hi,
This FIXME goes into my eyes, when I am about to modify something here,
/* Name is allocated by name_of_child. */
/* FIXME: xstrdup should not be here. */
This FIXME was introduced in the python pretty-pretter patches.
Python pretty-printing [6/6]
https://sourceware.org/ml/gdb-patches/2009-05/msg00467.html
create_child_with_value is called in two paths,
1. varobj_list_children -> create_child -> create_child_with_value,
2. install_dynamic_child -> install_dynamic_child -> varobj_add_child
-> create_child_with_value
In path #1, 'name' is allocated by name_of_child, as the original
comment said, we don't have to duplicate NAME in
create_child_with_value. In path #2, 'name' is got from
PyArg_ParseTuple, and we have to duplicate NAME.
This patch removes the call to xstrdup in create_child_with_value
and call xstrudp in update_dynamic_varobj_children (path #2).
gdb:
2013-10-04 Yao Qi <yao@codesourcery.com>
* varobj.c (create_child_with_value): Remove 'const' from the
type of parameter 'name'.
(varobj_add_child): Likewise.
(install_dynamic_child): Remove 'const' from the type of
parameter 'name'.
(varobj_add_child): Likewise.
(create_child_with_value): Likewise. Update comments. Don't
duplicate 'name'.
(update_dynamic_varobj_children): Duplicate 'name'
and pass it to install_dynamic_child.
Alan Modra [Fri, 4 Oct 2013 00:00:04 +0000 (00:00 +0000)]
daily update
Jan-Benedict Glaw [Thu, 3 Oct 2013 22:02:45 +0000 (22:02 +0000)]
2013-10-04 Jan-Benedict Glaw <jbglaw@lug-owl.de>
* configure: Regenerate.
Will Newton [Thu, 3 Oct 2013 14:46:09 +0000 (14:46 +0000)]
aarch64: Add support for GNU indirect functions.
Add support for STT_GNU_IFUNC symbols to the AArch64 bfd backend. The tests
are ported from the ld-ifunc tests but are enabled for cross builds so can
be run easily without hardware or a simulator.
bfd/ChangeLog:
2013-10-03 Will Newton <will.newton@linaro.org>
* configure: Regenerate.
* configure.in: Build elf-ifunc.o for AArch64.
* elfnn-aarch64.c: Include objalloc.h.
(elfNN_aarch64_local_htab_hash): New function.
(elfNN_aarch64_local_htab_eq): New function.
(elfNN_aarch64_get_local_sym_hash): New function.
(elfNN_aarch64_link_hash_table_create): Initialize local STT_GNU_IFUNC
symbol hash.
(elfNN_aarch64_hash_table_free): Free local STT_GNU_IFUNC symbol hash.
(elfNN_aarch64_final_link_relocate): Add sym argument. Add support
for handling STT_GNU_IFUNC symbols.
(elfNN_aarch64_gc_sweep_hook): Add support for garbage collecting
references to STT_GNU_IFUNC symbols.
(elfNN_aarch64_adjust_dynamic_symbol): Add support for handling
STT_GNU_IFUNC symbols.
(elfNN_aarch64_check_relocs): Add support for handling STT_GNU_IFUNC
symbols. Ensure we don't increase plt.refcount from -1 to 0.
(elfNN_aarch64_post_process_headers): Call _bfd_elf_set_osabi.
(elfNN_aarch64_is_function_type): Remove function.
(elfNN_aarch64_allocate_dynrelocs): Handle STT_GNU_IFUNC symbols.
(elfNN_aarch64_allocate_ifunc_dynrelocs): New function.
(elfNN_aarch64_allocate_local_dynrelocs): New function.
(elfNN_aarch64_allocate_local_ifunc_dynrelocs): New function.
(elfNN_aarch64_size_dynamic_sections): Call
elfNN_aarch64_allocate_local_dynrelocs.
(elfNN_aarch64_create_small_pltn_entry): Add info argument.
Add support for creating .iplt entries for STT_GNU_IFUNC symbols.
(elfNN_aarch64_finish_dynamic_symbol): Add support for handling
STT_GNU_IFUNC symbols and .iplt.
(elfNN_aarch64_finish_local_dynamic_symbol): New function.
(elfNN_aarch64_finish_dynamic_sections): Call
elfNN_aarch64_finish_local_dynamic_symbol.
ld/ChangeLog:
2013-10-03 Will Newton <will.newton@linaro.org>
* emulparams/aarch64elf.sh: Add IREL_IN_PLT.
* emulparams/aarch64elf32.sh: Likewise.
ld/testsuite/ChangeLog:
2013-10-03 Will Newton <will.newton@linaro.org>
* ld-ifunc/ifunc.exp: Enable ifunc tests for AArch64.
* ld-aarch64/aarch64-elf.exp: Run ifunc tests.
* ld-aarch64/ifunc-1-local.d: New file.
* ld-aarch64/ifunc-1-local.s: Likewise.
* ld-aarch64/ifunc-1.d: Likewise.
* ld-aarch64/ifunc-1.s: Likewise.
* ld-aarch64/ifunc-10.d: Likewise.
* ld-aarch64/ifunc-10.s: Likewise.
* ld-aarch64/ifunc-11.d: Likewise.
* ld-aarch64/ifunc-11.s: Likewise.
* ld-aarch64/ifunc-12.d: Likewise.
* ld-aarch64/ifunc-12.s: Likewise.
* ld-aarch64/ifunc-13.d: Likewise.
* ld-aarch64/ifunc-13a.s: Likewise.
* ld-aarch64/ifunc-13b.s: Likewise.
* ld-aarch64/ifunc-14a.d: Likewise.
* ld-aarch64/ifunc-14a.s: Likewise.
* ld-aarch64/ifunc-14b.d: Likewise.
* ld-aarch64/ifunc-14b.s: Likewise.
* ld-aarch64/ifunc-14c.d: Likewise.
* ld-aarch64/ifunc-14c.s: Likewise.
* ld-aarch64/ifunc-14d.d: Likewise.
* ld-aarch64/ifunc-14e.d: Likewise.
* ld-aarch64/ifunc-14f.d: Likewise.
* ld-aarch64/ifunc-15.d: Likewise.
* ld-aarch64/ifunc-15.s: Likewise.
* ld-aarch64/ifunc-16.d: Likewise.
* ld-aarch64/ifunc-16.s: Likewise.
* ld-aarch64/ifunc-17a.d: Likewise.
* ld-aarch64/ifunc-17a.s: Likewise.
* ld-aarch64/ifunc-17b.d: Likewise.
* ld-aarch64/ifunc-17b.s: Likewise.
* ld-aarch64/ifunc-18a.d: Likewise.
* ld-aarch64/ifunc-18a.s: Likewise.
* ld-aarch64/ifunc-18b.d: Likewise.
* ld-aarch64/ifunc-18b.s: Likewise.
* ld-aarch64/ifunc-19a.d: Likewise.
* ld-aarch64/ifunc-19a.s: Likewise.
* ld-aarch64/ifunc-19b.d: Likewise.
* ld-aarch64/ifunc-19b.s: Likewise.
* ld-aarch64/ifunc-2-local.d: Likewise.
* ld-aarch64/ifunc-2-local.s: Likewise.
* ld-aarch64/ifunc-2.d: Likewise.
* ld-aarch64/ifunc-2.s: Likewise.
* ld-aarch64/ifunc-20.d: Likewise.
* ld-aarch64/ifunc-20.s: Likewise.
* ld-aarch64/ifunc-3.s: Likewise.
* ld-aarch64/ifunc-3a.d: Likewise.
* ld-aarch64/ifunc-3b.d: Likewise.
* ld-aarch64/ifunc-4.d: Likewise.
* ld-aarch64/ifunc-4.s: Likewise.
* ld-aarch64/ifunc-4a.d: Likewise.
* ld-aarch64/ifunc-5-local.s: Likewise.
* ld-aarch64/ifunc-5.s: Likewise.
* ld-aarch64/ifunc-5a-local.d: Likewise.
* ld-aarch64/ifunc-5a.d: Likewise.
* ld-aarch64/ifunc-5b-local.d: Likewise.
* ld-aarch64/ifunc-5b.d: Likewise.
* ld-aarch64/ifunc-5r-local.d: Likewise.
* ld-aarch64/ifunc-6.s: Likewise.
* ld-aarch64/ifunc-6a.d: Likewise.
* ld-aarch64/ifunc-6b.d: Likewise.
* ld-aarch64/ifunc-7.s: Likewise.
* ld-aarch64/ifunc-7a.d: Likewise.
* ld-aarch64/ifunc-7b.d: Likewise.
* ld-aarch64/ifunc-7c.d: Likewise.
* ld-aarch64/ifunc-8.d: Likewise.
* ld-aarch64/ifunc-8a.s: Likewise.
* ld-aarch64/ifunc-8b.s: Likewise.
* ld-aarch64/ifunc-9.d: Likewise.
* ld-aarch64/ifunc-9.s: Likewise.
Phil Muldoon [Thu, 3 Oct 2013 14:43:32 +0000 (14:43 +0000)]
2013-10-03 Phil Muldoon <pmuldoon@redhat.com>
* python/py-value.c (convert_value_from_python): Move PyInt_Check
conversion logic to occur after PyLong_Check. Comment on order
change significance.
* python/py-arch.c (archpy_disassemble): Comment on order of
conversion for integers and longs.
Pedro Alves [Thu, 3 Oct 2013 10:13:34 +0000 (10:13 +0000)]
Always run the PTRACE_O_TRACESYSGOOD tests even if PTRACE_O_TRACEFORK is not supported.
If enabling PTRACE_O_TRACEFORK fails, we never test for
PTRACE_O_TRACESYSGOOD support. Before PTRACE_O_TRACESYSGOOD is checked,
we have:
/* First, set the PTRACE_O_TRACEFORK option. If this fails, we
know for sure that it is not supported. */
ret = ptrace (PTRACE_SETOPTIONS, child_pid, (PTRACE_TYPE_ARG3) 0,
(PTRACE_TYPE_ARG4) PTRACE_O_TRACEFORK);
if (ret != 0)
{
ret = ptrace (PTRACE_KILL, child_pid, (PTRACE_TYPE_ARG3) 0,
(PTRACE_TYPE_ARG4) 0);
if (ret != 0)
{
warning (_("linux_check_ptrace_features: failed to kill child"));
return;
}
ret = my_waitpid (child_pid, &status, 0);
if (ret != child_pid)
warning (_("linux_check_ptrace_features: failed "
"to wait for killed child"));
else if (!WIFSIGNALED (status))
warning (_("linux_check_ptrace_features: unexpected "
"wait status 0x%x from killed child"), status);
return; <<<<<<<<<<<<<<<<<
}
Note that early return. If PTRACE_O_TRACEFORK isn't supported, we're
not checking PTRACE_O_TRACESYSGOOD. This didn't use to be a problem
before the unification of this whole detection business in
linux-ptrace.c. Before, the sysgood detection was completely
separate:
static void
linux_test_for_tracesysgood (int original_pid)
{
int ret;
sigset_t prev_mask;
/* We don't want those ptrace calls to be interrupted. */
block_child_signals (&prev_mask);
linux_supports_tracesysgood_flag = 0;
ret = ptrace (PTRACE_SETOPTIONS, original_pid, 0, PTRACE_O_TRACESYSGOOD);
if (ret != 0)
goto out;
linux_supports_tracesysgood_flag = 1;
out:
restore_child_signals_mask (&prev_mask);
}
So we need to get back the decoupling somehow. I think it's cleaner
to split the seperate feature detections to separate functions. This
patch does that. The new functions are named for their counterparts
that existed before this code was moved to linux-ptrace.c.
Note I've used forward declarations for the new functions to make the
patch clearer, as otherwise the patch would look like I'd be adding a
bunch of new code. A reorder can be done in a follow up patch.
Tested on x86_64 Fedora 17.
gdb/
2013-10-03 Pedro Alves <palves@redhat.com>
* common/linux-ptrace.c (linux_check_ptrace_features): Factor out
the PTRACE_O_TRACESYSGOOD and PTRACE_O_TRACEFORK to separate
functions. Always test for PTRACE_O_TRACESYSGOOD even if
PTRACE_O_TRACEFORK is not supported.
(linux_test_for_tracesysgood): New function.
(linux_test_for_tracefork): New function, factored out from
linux_check_ptrace_features, and also don't kill child_pid here.
Tristan Gingold [Thu, 3 Oct 2013 09:46:36 +0000 (09:46 +0000)]
2013-10-03 Tristan Gingold <gingold@adacore.com>
* i386-darwin-nat.c (i386_darwin_dr_set): Fix argument type.
Remove verbose error reporting. Use detected state to
thread_set_state call.
(i386_darwin_dr_get): Fix return type. Remove verbose error
report.
Remove trailing spaces.
Alan Modra [Thu, 3 Oct 2013 00:00:04 +0000 (00:00 +0000)]
daily update
Yufeng Zhang [Wed, 2 Oct 2013 18:09:26 +0000 (18:09 +0000)]
gdb/testsuite/
* gdb.trace/entry-values.exp: Modify regular expression to scan for
'bl' instruction instead of 'call' for ARM and AArch64 targets.
Pedro Alves [Wed, 2 Oct 2013 16:15:46 +0000 (16:15 +0000)]
Print registers not saved in the frame as "<not saved>" instead of "<optimized out>".
Currently, in some scenarios, GDB prints <optimized out> when printing
outer frame registers. An <optimized out> register is a confusing
concept. What this really means is that the register is
call-clobbered, or IOW, not saved by the callee. This patch makes GDB
say that instead.
Before patch:
(gdb) p/x $rax $1 = <optimized out>
(gdb) info registers rax
rax <optimized out>
After patch:
(gdb) p/x $rax
$1 = <not saved>
(gdb) info registers rax
rax <not saved>
However, if for some reason the debug info describes a variable as
being in such a register (**), we still want to print <optimized out>
when printing the variable. IOW, <not saved> is reserved for
inspecting registers at the machine level. The patch uses
lval_register+optimized_out to encode the not saved registers, and
makes it so that optimized out variables always end up in
!lval_register values.
** See <https://sourceware.org/ml/gdb-patches/2012-08/msg00787.html>.
Current/recent enough GCC doesn't mark variables/arguments as being in
call-clobbered registers in the ranges corresponding to function
calls, while older GCCs did. Newer GCCs will just not say where the
variable is, so GDB will end up realizing the variable is optimized
out.
frame_unwind_got_optimized creates not_lval optimized out registers,
so by default, in most cases, we'll see <optimized out>.
value_of_register is the function eval.c uses for evaluating
OP_REGISTER (again, $pc, etc.), and related bits. It isn't used for
anything else. This function makes sure to return lval_register
values. The patch makes "info registers" and the MI equivalent use it
too. I think it just makes a lot of sense, as this makes it so that
when printing machine registers ($pc, etc.), we go through a central
function.
We're likely to need a different encoding at some point, if/when we
support partially saved registers. Even then, I think
value_of_register will still be the spot to tag the intention to print
machine register values differently.
value_from_register however may also return optimized out
lval_register values, so at a couple places where we're computing a
variable's location from a dwarf expression, we convert the resulting
value away from lval_register to a regular optimized out value.
Tested on x86_64 Fedora 17
gdb/
2013-10-02 Pedro Alves <palves@redhat.com>
* cp-valprint.c (cp_print_value_fields): Adjust calls to
val_print_optimized_out.
* jv-valprint.c (java_print_value_fields): Likewise.
* p-valprint.c (pascal_object_print_value_fields): Likewise.
* dwarf2loc.c (dwarf2_evaluate_loc_desc_full)
<DWARF_VALUE_REGISTER>: If the register was not saved, return a
new optimized out value.
* findvar.c (address_from_register): Likewise.
* frame.c (put_frame_register): Tweak error string to say the
register was not saved, rather than optimized out.
* infcmd.c (default_print_one_register_info): Adjust call to
val_print_optimized_out. Use value_of_register instead of
get_frame_register_value.
* mi/mi-main.c (output_register): Use value_of_register instead of
get_frame_register_value.
* valprint.c (valprint_check_validity): Likewise.
(val_print_optimized_out): New value parameter. If the value is
lval_register, print <not saved> instead.
(value_check_printable, val_print_scalar_formatted): Adjust calls
to val_print_optimized_out.
* valprint.h (val_print_optimized_out): New value parameter.
* value.c (struct value) <optimized_out>: Extend comment.
(error_value_optimized_out): New function.
(require_not_optimized_out): Use it. Use a different string for
lval_register values.
* value.h (error_value_optimized_out): New declaration.
* NEWS: Mention <not saved>.
gdb/testsuite/
2013-10-02 Pedro Alves <palves@redhat.com>
* gdb.dwarf2/dw2-reg-undefined.exp <pattern_rax_rbx_rcx_print,
pattern_rax_rbx_rcx_info>: Set to "<not saved>".
* gdb.mi/mi-reg-undefined.exp (opt_out_pattern): Delete.
(not_saved_pattern): New.
Replace use of the former with the latter.
gdb/doc/
2013-10-02 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Registers): Expand description of saved registers
in frames. Explain <not saved>.
Pedro Alves [Wed, 2 Oct 2013 11:44:20 +0000 (11:44 +0000)]
Teach the testsuite that GDBserver reliably reports program exits.
Running catch-syscall.exp against a gdbserver that actually supports
it, we get:
FAIL: gdb.base/catch-syscall.exp: continue until exit (the program exited)
FAIL: gdb.base/catch-syscall.exp: continue until exit (the program exited)
FAIL: gdb.base/catch-syscall.exp: continue until exit (the program exited)
FAIL: gdb.base/catch-syscall.exp: continue until exit at catch syscall with unused syscall (mlock) (the program exited)
FAIL: gdb.base/catch-syscall.exp: continue until exit (the program exited)
The fail pattern is:
Catchpoint 2 (call to syscall exit_group), 0x000000323d4baa29 in _exit () from /lib64/libc.so.6
(gdb) PASS: gdb.base/catch-syscall.exp: program has called exit_group
delete breakpoints
Delete all breakpoints? (y or n) y
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break exit
Breakpoint 3 at 0x323d438bf0
(gdb) continue
Continuing.
[Inferior 1 (process 21081) exited normally]
That "break exit" + "continue" comes from:
> # gdb_continue_to_end:
> # The case where the target uses stubs has to be handled specially. If a
> # stub is used, we set a breakpoint at exit because we cannot rely on
> # exit() behavior of a remote target.
> #
The native-gdbserver.exp board, used to test against gdbserver in
"target remote" mode, triggers that case ($use_gdb_stub is true). So
gdb_continue_to_end doesn't work for catch-syscall.exp as here we
catch the exit_group and continue from that, expecting to see a real
program exit. I was about to post a patch that changes
catch-syscall.exp to call a new function that just always does what
gdb_continue_to_end does in the !$use_gdb_stub case. But, since
GDBserver doesn't really need this, in the end I thought it better to
teach the testsuite that there are stubs that know how to report
program exits, by adding a new "exit_is_reliable" board variable that
then gdb_continue_to_end checks.
Tested on x86_64 Fedora 17, native and gdbserver.
gdb/testsuite/
2013-10-02 Pedro Alves <palves@redhat.com>
* README (Board Settings): Document "exit_is_reliable".
* lib/gdb.exp (gdb_continue_to_end): Check whether the board says
running to exit reliably reports program exits.
* boards/native-gdbserver.exp: Set exit_is_reliable in the board
info.
* boards/native-stdio-gdbserver.exp: Likewise.
Pedro Alves [Wed, 2 Oct 2013 11:42:35 +0000 (11:42 +0000)]
[GDBserver]: Silence exits if GDB is connected through stdio.
If we make gdbserver gdb_continue_to_end actually expect a process
exit with GDBserver, we get many testsuite failures with the remote
stdio board:
-PASS: gdb.arch/amd64-disp-step.exp: continue until exit at amd64-disp-step
+FAIL: gdb.arch/amd64-disp-step.exp: continue until exit at amd64-disp-step (the program exited)
-PASS: gdb.base/break.exp: continue until exit at recursive next test
+FAIL: gdb.base/break.exp: continue until exit at recursive next test (the program exited)
-PASS: gdb.base/chng-syms.exp: continue until exit at breakpoint first time through
+FAIL: gdb.base/chng-syms.exp: continue until exit at breakpoint first time through (the program exited)
... etc. ...
This is what the log shows for all of them:
(gdb) continue
Continuing.
Child exited with status 0
GDBserver exiting
[Inferior 1 (process 22721) exited normally]
(gdb) FAIL: gdb.arch/amd64-disp-step.exp: continue until exit (the program exited)
The problem is the whole "Child exited ... GDBserver exiting" output,
that comes out of GDBserver, and that the testsuite is not expecting.
I pondered somehow making the testsuite adjust to this. But,
testsuite aside, I think GDBserver should not be outputting this at
all when GDB is connected through stdio. GDBserver will be printing
this in GDB's console, but the user can already tell from the regular
output that the inferior is gone.
Again, manually:
(gdb) tar remote | ./gdbserver/gdbserver - program
Remote debugging using | ./gdbserver/gdbserver - program
Process program created; pid = 22486
stdin/stdout redirected
Remote debugging using stdio
done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
0x000000323d001530 in _start () from /lib64/ld-linux-x86-64.so.2
(gdb) c
Continuing.
Child exited with status 1
^^^^^^^^^^^^^^^^^^^^^^^^^^
GDBserver exiting
^^^^^^^^^^^^^^^^^
[Inferior 1 (process 22486) exited with code 01]
(gdb)
Suppressing those two lines makes the output be exactly like when
debugging against a remote tcp gdbserver:
(gdb) c
Continuing.
[Inferior 1 (process 22914) exited with code 01]
(gdb)
2013-10-02 Pedro Alves <palves@redhat.com>
* server.c (process_serial_event): Don't output "GDBserver
exiting" if GDB is connected through stdio.
* target.c (mywait): Likewise, be silent if GDB is connected
through stdio.
Joel Brobecker [Wed, 2 Oct 2013 09:22:43 +0000 (09:22 +0000)]
Use FILENAME_CMP to compare filenames in compare_search_syms.
gdb/ChangeLog:
* symtab.c (compare_search_syms): Use FILENAME_CMP instead of
strcmp to compare two symtab filenames.
Joel Brobecker [Wed, 2 Oct 2013 09:22:32 +0000 (09:22 +0000)]
Delete search_symbols_equal (use compare_search_syms instead).
This avoids duplicating the logic comparing two symbol_search
objects (in search_symbols_equal and compare_search_syms).
gdb/ChangeLog:
* symtab.c (search_symbols_equal): Delete.
(sort_search_symbols_remove_dups): Replace call to
search_symbols_equal by call to compare_search_syms,
adjusting as necessary.
Phil Muldoon [Wed, 2 Oct 2013 08:44:03 +0000 (08:44 +0000)]
2013-10-02 Phil Muldoon <pmuldoon@redhat.com>
PR python/15579
* python/python.c: Document gdb.execute command in Python help.
Phil Muldoon [Wed, 2 Oct 2013 08:37:11 +0000 (08:37 +0000)]
2013-10-02 Phil Muldoon <pmuldoon@redhat.com>
* python/py-frame.c (frame_info_to_frame_object): Use
gdbpy_convert_exception. Clean up Python object on failure.
Phil Muldoon [Wed, 2 Oct 2013 08:33:27 +0000 (08:33 +0000)]
2013-10-02 Phil Muldoon <pmuldoon@redhat.com>
* python/lib/gdb/command/frame_filters.py
(InfoFrameFilter.list_frame_filters): Retrieve exception manually.
(ShowFrameFilterPriority.invoke): Ditto.
Keith Seitz [Wed, 2 Oct 2013 00:46:07 +0000 (00:46 +0000)]
Constification of parse_linespec and fallout:
https://sourceware.org/ml/gdb-patches/2013-09/msg01017.html
https://sourceware.org/ml/gdb-patches/2013-09/msg01018.html
https://sourceware.org/ml/gdb-patches/2013-09/msg01019.html
https://sourceware.org/ml/gdb-patches/2013-09/msg01020.html
Alan Modra [Wed, 2 Oct 2013 00:00:04 +0000 (00:00 +0000)]
daily update
Doug Evans [Tue, 1 Oct 2013 23:52:45 +0000 (23:52 +0000)]
* cli/cli-decode.c: Remove unnecessary inclusion of tui/tui.h.
Doug Evans [Tue, 1 Oct 2013 20:36:01 +0000 (20:36 +0000)]
* gdb.python/python.exp: Remove redundant print-stack tests.
Make all print-stack test names unique. Fix spelling of print-stack.
Jeff Johnston [Tue, 1 Oct 2013 18:14:04 +0000 (18:14 +0000)]
2013-10-01 Jeff Johnston <jjohnstn@redhat.com>
* COPYING.NEWLIB: Update with new copyright.
Yao Qi [Tue, 1 Oct 2013 13:52:14 +0000 (13:52 +0000)]
gdb/
* varobj.c (c_value_of_root): Remove declaration.
(cplus_value_of_root, java_value_of_root): Likewise.
(ada_value_of_root): Likewise.
(struct language_specific) <value_of_root>: Remove.
(languages): Update initialization.
(check_scope): Move earlier.
(c_value_of_root): Move earlier and rename to ...
(value_of_root_1): ... this.
(value_of_root): Caller update.
(cplus_value_of_root, java_value_of_root): Remove.
(ada_value_of_root): Remove.
Nick Clifton [Tue, 1 Oct 2013 13:44:37 +0000 (13:44 +0000)]
* arsup.c (ar_save): Respect the deterministic setting when
reading from an mri script.
* ar.c (main): Set the default deterministic mode when reading
from an mri script.
Yao Qi [Tue, 1 Oct 2013 13:40:27 +0000 (13:40 +0000)]
gdb/
* varobj.c (varobj_format_string): Remove "unknown".
(languages): Remove the first element.
* varobj.h (enum varobj_languages): Remove vlang_c.
Yao Qi [Tue, 1 Oct 2013 13:28:59 +0000 (13:28 +0000)]
gdb/
* varobj.c (struct language_specific) <language>: Remove.
(languages): Update the initialization.
Yao Qi [Tue, 1 Oct 2013 13:21:17 +0000 (13:21 +0000)]
gdb/
* arm-wince-tdep.c: Remove inclusion of "solib.h" and
"solib-target.h". Include "windows-tdep.h".
(arm_wince_init_abi): Call windows_init_abi. Remove call to
set_solib_ops and set_gdbarch_has_dos_based_file_system.
* configure.tgt (arm*-wince-pe | arm*-*-mingw32ce*): Append
windows-tdep.o to gdb_target_obs.
Yao Qi [Tue, 1 Oct 2013 13:17:57 +0000 (13:17 +0000)]
gdb/
* amd64-windows-tdep.c: Remove inclusion of "solib.h" and
"solib-target.h".
(amd64_windows_init_abi): Don't call set_solib_ops and
set_gdbarch_iterate_over_objfiles_in_search_order. Call
windows_init_abi instead.
* i386-cygwin-tdep.c: Remove inclusion of "solib.h" and
"solib-target.h".
(i386_cygwin_init_abi): Don't call set_solib_ops,
set_gdbarch_has_dos_based_file_system and
set_gdbarch_iterate_over_objfiles_in_search_order. Call
windows_init_abi instead.
* windows-tdep.c: Include "solib.h" and "solib-target.h".
(windows_init_abi): New function.
(windows_iterate_over_objfiles_in_search_order): Make it
static.
* windows-tdep.h (windows_init_abi): Declare.
(windows_iterate_over_objfiles_in_search_order): Remove
declaration.
Joel Brobecker [Tue, 1 Oct 2013 10:56:51 +0000 (10:56 +0000)]
[gdbserver/LynxOS]: Incomplete thread list after --attach
The current implementation is forgetting to populate the thread list
when attaching to the process. This results in an incomplete list of
threads when debugging a threaded program.
Unfortunately, as the added comments hints, there appears to be
no way of getting the list of threads via ptrace, other than by
spawning the "ps" command, and parsing its output. Not great,
but it appears to be the best we can do.
gdb/gdbserver/ChangeLog:
* lynx-low.c (lynx_add_threads_after_attach): New function.
(lynx_attach): Remove call to add_thread. Add call to
lynx_add_threads_after_attach instead.
Jan-Benedict Glaw [Tue, 1 Oct 2013 10:32:54 +0000 (10:32 +0000)]
2013-10-01 Jan-Benedict Glaw <jbglaw@lug-owl.de>
* dwarf.c (SAFE_BYTE_GET): Fix argument check.
Joel Brobecker [Tue, 1 Oct 2013 09:21:52 +0000 (09:21 +0000)]
[ELinOS] Best effort to load system libraries in case of incomplete env
So far elinos.py was assuming that the whole ELinOS environment was
around to find the system libraries; if some environment variables
were missing, the script would just abort.
This was a bit extreme. It is possible to do better than that: to get
the core system libraries, one doesn't need to have a full environment
but just the path to the CDK. The path to kernel project is only
needed for the optional Xenomai libs.
gdb/ChangeLog:
* system-gdbinit/elinos.py (get_elinos_environment): Return an
incomplete dictionnary instead of None in case of missing
environment variables.
(elinos_init): in case of an incomplete environment, best
effort to load system libraries instead of abort.
Joel Brobecker [Tue, 1 Oct 2013 09:21:41 +0000 (09:21 +0000)]
wrong "catch exception" error message when finding trampoline msym.
When building the program with the shared GNAT runtime, the debugger
is unable to insert Ada exception catchpoints until that runtime
has been mapped to memory. In other words, we expect the user to start
the program first, before attempting to insert that catchpoint.
The detection mechanism that tries to provide some useful tips to
the user fails when the program itself contains a trampoline symbol
matching the symbol that the catchpoint is trying to use. This
results in the following error message:
(gdb) catch exception
Your Ada runtime appears to be missing some debugging information.
Cannot insert Ada exception catchpoint in this configuration.
Instead, we expected the following error message:
(gdb) catch exception
Unable to insert catchpoint. Try to start the program first.
gdb/ChangeLog:
* ada-lang.c (ada_has_this_exception_support): Ignore
mst_solib_trampoline minimal symbols.
Alan Modra [Tue, 1 Oct 2013 00:00:04 +0000 (00:00 +0000)]
daily update
H.J. Lu [Mon, 30 Sep 2013 17:48:11 +0000 (17:48 +0000)]
Add Size64 to movq/vmovq with Reg64 operand
* i386-opc.tbl: Add Size64 to movq/vmovq with Reg64 operand.
* i386-init.h: Regenerated.
Saravanan Ekanathan [Mon, 30 Sep 2013 17:02:07 +0000 (17:02 +0000)]
Add AMD bdver4 support.
gas/
* config/tc-i386.c (cpu_arch): Add CPU_BDVER4_FLAGS.
* doc/c-i386.texi: Add -march=bdver4 option.
gas/testsuite/
* gas/i386/i386.exp: Run bdver4 test cases.
* gas/i386/nops-1-bdver4.d: New.
* gas/i386/arch-10-bdver4.d: New.
* gas/i386/x86-64-nops-1-bdver4.d: New.
* gas/i386/x86-64-arch-2-bdver4.d: New.
opcodes/
* i386-gen.c (cpu_flag_init): Add CPU_BDVER4_FLAGS.
* i386-init.h: Regenerated.
Tristan Gingold [Mon, 30 Sep 2013 14:06:24 +0000 (14:06 +0000)]
2013-09-30 Tristan Gingold <gingold@adacore.com>
* i386-darwin-nat.c (darwin_complete_target): Install methods for
hardware watchpoint.
(i386_darwin_dr_set): Support 32 and 64 bit states.
(i386_darwin_dr_get): Likewise.
(i386_darwin_dr_set_control): Make static.
(i386_darwin_dr_set_addr, i386_darwin_dr_get_addr)
(i386_darwin_dr_get_status, i386_darwin_dr_get_control): Likewise.
Luis Machado [Mon, 30 Sep 2013 11:50:12 +0000 (11:50 +0000)]
* aarch64-linux-nat.c: Replace PIDGET with ptid_get_pid.
Replace TIDGET with ptid_get_lwp.
Replace GET_LWP with ptid_get_lwp.
* aix-thread.c (BUILD_THREAD, BUILD_LWP): Remove.
Replace BUILD_THREAD with ptid_build.
Replace BUILD_LWP with ptid_build.
Replace PIDGET with ptid_get_pid.
Replace TIDGET with ptid_get_lwp.
* alphabsd-nat.c: Replace PIDGET with ptid_get_pid.
* amd64-linux-nat.c: Replace PIDGET with ptid_get_pid.
Replace TIDGET with ptid_get_lwp.
* amd64bsd-nat.c: Replace PIDGET with ptid_get_pid.
* arm-linux-nat.c: Replace PIDGET with ptid_get_pid.
Replace TIDGET with ptid_get_lwp.
Replace GET_LWP with ptid_get_lwp.
* armnbsd-nat.c: Replace PIDGET with ptid_get_pid.
* auxv.c: Likewise.
* breakpoint.c: Likewise.
* common/ptid.c (ptid_is_pid): Condense check for
null_ptid and minus_one_ptid.
(ptid_lwp_p): New function.
(ptid_tid_p): New function.
* common/ptid.h: Update comments for accessors.
(ptid_lwp_p): New prototype.
(ptid_tid_p): New prototype.
* defs.h (PIDGET, TIDGET, MERGEPID): Do not define.
* gcore.c: Replace PIDGET with ptid_get_pid.
* gdbthread.h: Likewise.
* gnu-nat.c: Likewise.
* hppa-linux-nat.c: Replace PIDGET with ptid_get_pid.
Replace TIDGET with ptid_get_lwp.
* hppabsd-nat.c: Replace PIDGET with ptid_get_pid.
* hppanbsd-nat.c: Likewise.
* i386-linux-nat.c: Replace PIDGET with ptid_get_pid.
Replace TIDGET with ptid_get_lwp.
* i386bsd-nat.c: Replace PIDGET with ptid_get_pid.
* ia64-linux-nat.c: Replace PIDGET with ptid_get_pid.
* infcmd.c: Likewise.
* inferior.h: Likewise.
* inflow.c: Likewise.
* infrun.c: Likewise.
* linux-fork.c: Likewise.
* linux-nat.c: Replace PIDGET with ptid_get_pid.
Replace GET_PID with ptid_get_pid.
Replace is_lwp with ptid_lwp_p.
Replace GET_LWP with ptid_get_lwp.
Replace BUILD_LWP with ptid_build.
Nick Clifton [Mon, 30 Sep 2013 09:03:59 +0000 (09:03 +0000)]
* emulparams/msp430all.sh: Update ARCH names.
* cpu-msp430.c: Use printable names that match the values
displayed by readelf.
Alan Modra [Mon, 30 Sep 2013 00:00:04 +0000 (00:00 +0000)]
daily update
Yao Qi [Sun, 29 Sep 2013 14:05:36 +0000 (14:05 +0000)]
gdb/testsuite/
* gdb.base/shreloc.exp: Set $msymfile to 'shreloc.txt' if host
is remote.
Mike Frysinger [Sun, 29 Sep 2013 03:57:34 +0000 (03:57 +0000)]
gdb: btrace: fix build errors on older glibc builds
It is possible to have a build of glibc where SYS_perf_event_open is not
defined (because when the glibc was compiled, the syscall did not exist),
but have newer kernel headers installed so that linux/perf_event.h is
available. In this setup, you get a build failure:
./common/linux-btrace.c: In function 'kernel_supports_btrace':
./common/linux-btrace.c:316:23: error: 'SYS_perf_event_open' undeclared (first use in this function)
Update the ifdef check to also see if the syscall is available.
URL: https://bugs.gentoo.org/473522
Reported-by: William Throwe <wtt6@cornell.edu>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Alan Modra [Sun, 29 Sep 2013 00:00:04 +0000 (00:00 +0000)]
daily update
Alan Modra [Sat, 28 Sep 2013 00:00:04 +0000 (00:00 +0000)]
daily update
Doug Evans [Fri, 27 Sep 2013 21:34:04 +0000 (21:34 +0000)]
* dwarf2read.c (dwarf2_section_info): Add comment.
(dwp_file): Split loaded_cutus into loaded_cus, loaded_tus.
All uses updated.
(dwarf2_section_empty_p): Rename arg from "info" to "section".
(dwarf2_read_section): Delete unused local "header". Add section
name to error message.
(create_dwo_in_dwp): Tweak comment.
(MAX_NR_DWO_SECTIONS): Combine count of .debug_macro + .debug_macinfo.
Doug Evans [Fri, 27 Sep 2013 20:33:20 +0000 (20:33 +0000)]
* dwarf2read.c (die_reader_specs): Tweak comment.
(get_section_bfd_owner, get_section_bfd_section): New functions.
(get_section_name, get_section_file_name): New functions.
(get_section_id, get_section_flags): New functions.
(*): Use new functions to access section fields.
Doug Evans [Fri, 27 Sep 2013 18:48:41 +0000 (18:48 +0000)]
* dwarf2read.c (struct dwo_file): Add/tweak comments.
(lookup_dwo_unit_in_dwp): Renamed from lookup_dwo_in_dwp. Remove
arg "htab". All callers updated.
(create_debug_types_hash_table): Remove redundant copy of
abbrev_section.
(create_dwo_in_dwp): Tweak comments.
(read_str_index): Tweak comment. Record dwarf form name in static
local.
H.J. Lu [Fri, 27 Sep 2013 18:05:03 +0000 (18:05 +0000)]
Pass offset_size to print_dwarf_vma for cie_id
binutils/
* dwarf.c (display_debug_frames): Pass offset_size to
print_dwarf_vma for cie_id.
binutils/testsuite/
* binutils-all/x86-64/compressed-1a.d: Updated for 64-bit addresses.