Andrew Bennett [Thu, 12 Mar 2015 16:27:46 +0000 (16:27 +0000)]
Add i6400 entry to the MIPS CPU table.
gas/
* config/tc-mips.c (mips_cpu_info_table): Add i6400 entry.
* doc/c-mips.texi: Document i6400 -march option.
Nick Clifton [Thu, 12 Mar 2015 15:58:37 +0000 (15:58 +0000)]
Fixes a problem generating relocs for thumb function calls to local symbols defined in other sections.
PR gas/17444
* config/tc-arm.h (MD_APPLY_SYM_VALUE): Pass the current segment
to arm_apply_sym_value. Update prototype.
* config/tc-arm.c (arm_apply_sym_value): Add segment argument.
Do not apply the value if the symbol is in a different segment to
the current segment.
Gary Benson [Thu, 12 Mar 2015 11:44:16 +0000 (11:44 +0000)]
Allow "set sysroot" with no argument to restore sysroot to empty
This commit creates the "set/show sysroot" commands using
add_setshow_optional_filename_cmd to allow the sysroot to
be restored to empty after being set.
gdb/ChangeLog:
* solib.c (_initialize_solib): Make "set/show sysroot" use
add_setshow_optional_filename_cmd so it can be restored to
empty after being set.
Cary Coutant [Thu, 12 Mar 2015 05:07:51 +0000 (22:07 -0700)]
Fix gold incremental test failures.
Newer version of GCC pass -z relro to the linker, but incremental linking
does not support relro. This patch adds a check to complain about the
conflict, and changes the testsuite to pass -z norelro to the incremental
tests.
2015-03-11 Cary Coutant <ccoutant@google.com>
gold/
* options.cc (General_options::finalize): Don't allow -z relro
with incremental linking.
* testsuite/Makefile.am (incremental_test): Add -z norelro.
(incremental_test_2): Likewise.
(incremental_test_3): Likewise.
(incremental_test_4): Likewise.
(incremental_test_5): Likewise.
(incremental_test_6): Likewise.
(incremental_copy_test): Likewise.
(incremental_common_test_1): Likewise.
(incremental_comdat_test_1): Likewise.
* testsuite/Makefile.in: Regenerate.
GDB Administrator [Thu, 12 Mar 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in
Sergio Durigan Junior [Wed, 11 Mar 2015 18:12:07 +0000 (14:12 -0400)]
Create gdb/break-catch-syscall.c
This commits cleans up the gdb/breakpoint.c file and moves everything
that is related to the 'catch syscall' command to the new file
gdb/break-catch-syscall.c. This is just code movement, and the only
new part is the adjustment needed on 'catching_syscall_number' to use
the new 'breakpoint_find_if' function insted of relying on the
ALL_BREAKPOINTS macro.
Tested by running the 'gdb.base/catch-syscall.exp' testcase.
gdb/ChangeLog:
2015-03-11 Sergio Durigan Junior <sergiodj@redhat.com>
* Makefile.in (SFILES): New source break-catch-syscall.c.
(COMMON_OBS): New object break-catch-syscall.o.
* break-catch-syscall.c: New file.
* breakpoint.c: Remove inclusion of "xml-syscall.h".
(syscall_catchpoint_p): Move declaration to break-catch-syscall.c
(struct syscall_catchpoint): Likewise.
(dtor_catch_syscall): Likewise.
(catch_syscall_inferior_data): Likewise.
(struct catch_syscall_inferior_data): Likewise.
(get_catch_syscall_inferior_data): Likewise.
(catch_syscall_inferior_data_cleanup): Likewise.
(insert_catch_syscall): Likewise.
(remove_catch_syscall): Likewise.
(breakpoint_hit_catch_syscall): Likewise.
(print_it_catch_syscall): Likewise.
(print_one_catch_syscall): Likewise.
(print_mention_catch_syscall): Likewise.
(print_recreate_catch_syscall): Likewise.
(catch_syscall_breakpoint_ops): Likewise.
(syscall_catchpoint_p): Likewise.
(create_syscall_event_catchpoint): Likewise.
(catch_syscall_split_args): Likewise.
(catch_syscall_command_1): Likewise.
(is_syscall_catchpoint_enabled): Likewise.
(catch_syscall_enabled): Likewise.
(catching_syscall_number): Likewise.
(catch_syscall_completer): Likewise.
(clear_syscall_counts): Likewise.
(initialize_breakpoint_ops): Move initialization of syscall
catchpoints to break-catch-syscall.c.
(_initialize_breakpoint): Move code related to syscall catchpoints
to break-catch-syscall.c.
Sergio Durigan Junior [Wed, 11 Mar 2015 18:09:51 +0000 (14:09 -0400)]
Implement breakpoint_find_if
This commit implements the 'breakpoint_find_if' function, which allows
code external to gdb/breakpoint.c to iterate through the list of
'struct breakpoint *'. This is needed in order to create the
'gdb/break-catch-syscall.c' file, because one of its functions
(catching_syscall_number) needs to do this iteration.
My first thought was to share the ALL_BREAKPOINTS* macros on
gdb/breakpoint.h, but they use a global variable local to
gdb/breakpoint.c, and I did not want to share that variable. So, in
order to keep the minimal separation, I decided to implement this
way of iterating through the existing 'struct breakpoint *'.
This function was based on BFD's bfd_sections_find_if. If the
user-provided function returns 0, the iteration proceeds. Otherwise,
the iteration stops and the function returns the 'struct breakpoint *'
that is being processed. This means that the return value of this
function can be either NULL or a pointer to a 'struct breakpoint'.
gdb/ChangeLog:
2015-03-11 Sergio Durigan Junior <sergiodj@redhat.com>
* breakpoint.c (breakpoint_find_if): New function.
* breakpoint.h (breakpoint_find_if): New prototype.
Gary Benson [Wed, 11 Mar 2015 17:53:57 +0000 (17:53 +0000)]
Implement vFile:fstat: in gdbserver
This commit implements the "vFile:fstat:" packet in gdbserver.
gdb/gdbserver/ChangeLog:
* hostio.c (sys/types.h): New include.
(sys/stat.h): Likewise.
(common-remote-fileio.h): Likewise.
(handle_fstat): New function.
(handle_vFile): Handle vFile:fstat packets.
* server.c (handle_query): Report vFile:fstat as supported.
Gary Benson [Wed, 11 Mar 2015 17:53:57 +0000 (17:53 +0000)]
Implement remote_bfd_iovec_stat
This commit adds a new packet "vFile:fstat:" to the remote protocol
that can be used by to retrieve information about files that have
been previously opened using vFile:open. vFile:fstat: support is
added to GDB, and remote_bfd_iovec_stat is implemented using it. If
vFile:fstat: is not supported by the remote GDB creates a dummy result
by zeroing the supplied stat structure and setting its st_size field
to INT_MAX. This mimics GDB's previous behaviour, with the exception
that GDB did not previously zero the structure so all other fields
would have been returned unchanged, which is to say very likely
populated with random values from the stack.
gdb/ChangeLog:
* remote-fileio.h (remote_fileio_to_host_stat): New declaration.
* remote-fileio.c (remote_fileio_to_host_uint): New function.
(remote_fileio_to_host_ulong): Likewise.
(remote_fileio_to_host_mode): Likewise.
(remote_fileio_to_host_time): Likewise.
(remote_fileio_to_host_stat): Likewise.
* remote.c (PACKET_vFile_fstat): New enum value.
(remote_protocol_features): Register the "vFile:fstat" feature.
(remote_hostio_fstat): New function.
(remote_bfd_iovec_stat): Use the above.
(_initialize_remote): Register new "set/show remote
hostio-fstat-packet" command.
* symfile.c (separate_debug_file_exists): Update comment.
* NEWS: Announce new vFile:fstat packet.
gdb/doc/ChangeLog:
* gdb.texinfo (Remote Configuration): Document the
"set/show remote hostio-fstat-packet" command.
(General Query Packets): Document the vFile:fstat
qSupported features.
(Host I/O Packets): Document the vFile:fstat packet.
Gary Benson [Wed, 11 Mar 2015 17:53:57 +0000 (17:53 +0000)]
Move remote_fileio_to_fio_stat to gdb/common
This commit moves remote_fileio_to_fio_stat and its supporting
functions into new files common/common-remote-fileio.[ch].
gdb/ChangeLog:
* common/common-remote-fileio.h: New file.
* common/common-remote-fileio.c: Likewise.
* Makefile.in (SFILES): Add common/common-remote-fileio.c.
(HFILES_NO_SRCDIR): Add common/common-remote-fileio.h.
(COMMON_OBS): Add common-remote-fileio.o.
(common-remote-fileio.o): New rule.
* remote-fileio.h (common-remote-fileio.h): New include.
* remote-fileio.c (gdb/fileio.h): Do not include.
(remote_fileio_to_be): Moved to common-remote-fileio.h.
(remote_fileio_to_fio_uint): Likewise.
(remote_fileio_to_fio_time): Likewise.
(remote_fileio_mode_to_target): Moved to common-remote-fileio.c.
(remote_fileio_to_fio_mode): Likewise.
(remote_fileio_to_fio_ulong): Likewise.
(remote_fileio_to_fio_stat): Likewise.
gdb/gdbserver/ChangeLog:
* configure.ac (AC_CHECK_MEMBERS): Add checks for
struct stat.st_blocks and struct stat.st_blksize.
* configure: Regenerate.
* config.in: Likewise.
* Makefile.in (SFILES): Add common/common-remote-fileio.c.
(OBS): Add common-remote-fileio.o.
(common-remote-fileio.o): New rule.
Andy Wingo [Wed, 11 Mar 2015 13:32:23 +0000 (14:32 +0100)]
Fix typo in value-dynamic-type
gdb/ChangeLog:
* guile/scm-value.c (gdbscm_value_dynamic_type): Fix typo in which
we were checking the cached type, not the cached dynamic type.
Andy Wingo [Wed, 11 Mar 2015 13:25:29 +0000 (14:25 +0100)]
Fix memory corruption in Guile command interface
Re-registering a command will delete previous commands of the same name,
running the destroyer for the command object. The Guile destroyer
incorrectly tried to xfree the name and other strings, which is invalid
as they are on the GC heap.
gdb/ChangeLog:
* guile/scm-cmd.c (cmdscm_destroyer): Don't xfree the name and
other strings, as these are on the GC'd heap, and will be
collected along with the smob.
Andy Wingo [Wed, 11 Mar 2015 13:20:06 +0000 (14:20 +0100)]
Add objfile-progspace to Guile interface
This commit adds an objfile-progspace accessor to the (gdb) Guile
module.
gdb/testsuite/ChangeLog:
* gdb.guile/scm-objfile.exp: Add objfile-progspace test.
gdb/doc/ChangeLog:
* guile.texi (Objfiles In Guile): Document objfile-progspace.
gdb/ChangeLog:
* guile/scm-objfile.c (gdbscm_objfile_progspace): New function.
(objfile_functions): Bind gdbscm_objfile_progspace to
objfile-progspace.
* guile/lib/gdb.scm: Add objfile-progspace to exports.
Andy Wingo [Wed, 11 Mar 2015 12:07:53 +0000 (13:07 +0100)]
[guile] Run finalizers from GDB thread
gdb/ChangeLog:
* guile/guile.c (_initialize_guile): Disable automatic
finalization, if Guile offers us that possibility.
* guile/guile.c (call_initialize_gdb_module):
* guile/scm-safe-call.c (gdbscm_with_catch): Arrange to run
finalizers in appropriate places.
* config.in (HAVE_GUILE_MANUAL_FINALIZATION): New definition.
* configure.ac (AC_TRY_LIBGUILE): Add a check for
scm_set_automatic_finalization_enabled.
* configure: Regenerated.
Yao Qi [Wed, 11 Mar 2015 11:50:12 +0000 (11:50 +0000)]
Typo fix
Fix typo "inferiorr".
gdb/testsuite:
2015-03-11 Yao Qi <yao.qi@linaro.org>
* gdb.base/catch-syscall.exp: Fix typo in comments.
Yao Qi [Wed, 11 Mar 2015 11:43:07 +0000 (11:43 +0000)]
Skip catch-syscall.exp on HP-UX target
"catch syscall" doesn't work on HP-UX.
gdb/testsuite:
2015-03-11 Yao Qi <yao.qi@linaro.org>
* gdb.base/catch-syscall.exp: Skip it on HP-UX target.
Andreas Arnez [Wed, 11 Mar 2015 10:11:45 +0000 (11:11 +0100)]
S390: Skip prologue using SAL information, if possible
Instead of analyzing the prologue and possibly coming to a wrong
conclusion, this change tries to skip the prologue with the use of
skip_prologue_using_sal. Only if that fails, the prologue analyzer is
invoked as before.
gdb/ChangeLog:
* s390-linux-tdep.c (s390_skip_prologue): Skip the prologue using
SAL, if possible.
Andreas Arnez [Wed, 11 Mar 2015 10:11:44 +0000 (11:11 +0100)]
S390: Defer PER info update until resume
For multi-threaded inferiors on S390 GNU/Linux targets, GDB tried to
update the PER info via ptrace() in a newly attached thread before
assuring that the thread is stopped. Depending on the timing, this
could lead to a GDB internal error. The patch defers the PER info
update until just before resuming the thread.
gdb/ChangeLog:
* s390-linux-nat.c (struct arch_lwp_info): New.
(s390_fix_watch_points): Rename to...
(s390_prepare_to_resume): ...this. Skip the PER info update
unless the watch points have changed.
(s390_refresh_per_info, s390_new_thread): New functions.
(s390_insert_watchpoint): Call s390_refresh_per_info instead of
s390_fix_watch_points.
(s390_remove_watchpoint): Likewise.
(_initialize_s390_nat): Reflect renaming of s390_fix_watch_points.
Register s390_prepare_to_resume.
Alan Modra [Wed, 11 Mar 2015 07:23:50 +0000 (17:53 +1030)]
Fix powerpc gas abort on invalid instruction fixups
* config/tc-ppc.c (md_assemble): Don't abort on 8 byte insn fixups.
(md_apply_fix): Report an error on data-only fixups used with insns.
Alan Modra [Wed, 11 Mar 2015 07:15:37 +0000 (17:45 +1030)]
Fix ppc32 synthetic symbols when __tls_get_addr_opt stub is generated
Also update the 32-bit tls testcases to be secure plt.
bfd/
* elf32-ppc.c (ppc_elf_get_synthetic_symtab): Examine stubs in
reverse order. Account for larger size of __tls_get_addr_opt stub.
ld/testsuite/
* ld-powerpc/tls32.s: Add GOT pointer setup.
* ld-powerpc/tls32.d: Update.
* ld-powerpc/tls32.g: Update.
* ld-powerpc/tls32.t: Update.
* ld-powerpc/tlsexe.d: Update.
* ld-powerpc/tlsexe32.d: Update.
* ld-powerpc/tlsexe32.g: Update.
* ld-powerpc/tlsexe32.r: Update.
* ld-powerpc/tlsexetoc.d: Update.
* ld-powerpc/tlsso32.d: Update.
* ld-powerpc/tlsso32.g: Update.
* ld-powerpc/tlsso32.r: Update.
Alan Modra [Wed, 11 Mar 2015 07:19:42 +0000 (17:49 +1030)]
Run objcopy --update-section test only on ELF targets
* binutils-all/update-section.exp: Only run on ELF targets.
GDB Administrator [Wed, 11 Mar 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in
H.J. Lu [Tue, 10 Mar 2015 13:57:14 +0000 (06:57 -0700)]
Move nothing to do warning to main
PR binutils/18101
* readelf.c (parse_args): Move nothing to do warning to ...
(main): Here.
Nick Clifton [Tue, 10 Mar 2015 13:44:51 +0000 (13:44 +0000)]
Fixes "readelf -s --wide" not returning an error status or help message.
PR binutils/18101
* readelf.c (parse_args): Enhance check for nothing to do by
accounting for the --wide option.
Nick Clifton [Tue, 10 Mar 2015 13:38:24 +0000 (13:38 +0000)]
Fixes a problem with objcopy leaving temporary files and directories around if it encounters a problem during a copy.
PR binutils/17636
* objcopy.c (copy_object): Avoid calling fatal as that does not
allow the parent to clean up temporary files.
Andreas Krebbel [Tue, 10 Mar 2015 11:44:54 +0000 (12:44 +0100)]
S/390: Add more IBM z13 instructions
opcodes/
2015-03-10 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* s390-opc.c: Add new IBM z13 instructions.
* s390-opc.txt: Likewise.
gas/testsuite/
2015-03-10 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* gas/s390/zarch-z13.d: Add more z13 instructions.
* gas/s390/zarch-z13.s: Likewise.
Andreas Krebbel [Tue, 10 Mar 2015 11:41:57 +0000 (12:41 +0100)]
S/390: Add check for length field operand
gas/
2015-03-10 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* gas/config/tc-s390.c (md_gather_operands): Check for valid
length field operands.
Michael Perkins [Tue, 10 Mar 2015 11:47:46 +0000 (11:47 +0000)]
Fixes a bug in the ARM port of GAS when parsing inverted register lists.
* config/tc-arm.c (parse_operands): Fix bug setting writeback
values for '^' on OP_REGLSTs.
(do_push_pop): Add new writeback constraint.
Sterling Augustine [Tue, 10 Mar 2015 11:34:50 +0000 (11:34 +0000)]
[ARM]Fix "align directive causes MAP_DATA symbol to be lost"
gas/
2015-03-10 Renlin Li <renlin.li@arm.com>
* config/tc-arm.c (mapping_state): Remove first MAP_DATA emitting code.
(mapping_state_2): Emit first MAP_DATA symbol here.
gas/testsuite/
2015-03-05 Renlin Li <renlin.li@arm.com>
* gas/arm/dis-data.d: Adjust the desired output.
* gas/arm/dis-data2.d: Ditto.
Jiong Wang [Tue, 10 Mar 2015 11:27:56 +0000 (11:27 +0000)]
[AARCH64] Remove Load/Store register (unscaled immediate) alias.
opcodes/ChangeLog:
2015-03-10 Renlin Li <renlin.li@arm.com>
* aarch64-tbl.h (aarch64_opcode_table): Remove strub, ldurb, ldursb,
stur, ldur, sturh, ldurh, ldursh, ldursw, prfum F_HAS_ALIAS flag and
related alias.
* aarch64-asm-2.c: Regenerate.
* aarch64-dis-2.c: Likewise.
* aarch64-opc-2.c: Likewise.
gas/testsuite/ChangeLog:
2015-03-10 Renlin Li <renlin.li@arm.com>
* gas/aarch64/ldst-reg-uns-imm.d: Adjust expected output.
* gas/aarch64/ldst-reg-unscaled-imm.d: Likewise.
* gas/aarch64/reloc-insn.d: Likewise.
Jiong Wang [Tue, 10 Mar 2015 11:20:57 +0000 (11:20 +0000)]
[AArch64] Set the minimum alignment on code segments
gas/
2015-03-10 Matthew Wahab <matthew.wahab@arm.com>
* config/tc-aarch64.c (mapping_state): Set minimum alignment for
code sections.
gas/testsuite
2015-03-10 Matthew Wahab <matthew.wahab@arm.com>
* gas/aarch64/codealign.d: Add test for code section alignment.
* gas/aarch64/codealign.s: New file.
Jiong Wang [Tue, 10 Mar 2015 11:15:13 +0000 (11:15 +0000)]
[ARM] PR ld/16572: Remove EF_ARM_HASENTRY flag
bfd/
2015-03-10 Yuri Gribov <y.gribov@samsung.arm>
PR ld/16572
* elf32-arm.c (elf32_arm_final_link_relocate): Remove
support for ELF_ARM_HASENTRY.
(elf32_arm_print_private_bfd_data): Likewise.
binutils/
2015-03-10 Yuri Gribov <y.gribov@samsung.arm>
PR ld/16572
* readelf.c: Remove support for ELF_ARM_HASENTRY.
include/
2015-03-10 Matthew Wahab <matthew.wahab@arm.com>
PR ld/16572
* elf/arm.h (EF_ARM_HASENTRY): Remove.
Nick Clifton [Tue, 10 Mar 2015 10:01:45 +0000 (10:01 +0000)]
Fixes a bug building the ARM Linux kernel with a toolchain compiled with CPU_DEFAULT set.
PR gas/17852
* config/tc-arm.c (md_begin): Ensure that selected_cpu is
initialised when CPU_DEFAULT is defined.
Mike Frysinger [Tue, 10 Mar 2015 05:41:48 +0000 (01:41 -0400)]
sim: bfin: fix up linux-fixed-code.h generation more [PR sim/13160]
Add a trailing semi-colon to the sed print command as the BSD sed
implementation wants it. It's a nop otherwise and works fine on
GNU/etc... implementations too.
GDB Administrator [Tue, 10 Mar 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
Pedro Alves [Mon, 9 Mar 2015 17:47:18 +0000 (17:47 +0000)]
Delete gdb/testsuite/dg-extract-results.py
Unfortunately, the Python version of the dg-extract-results.sh script
doesn't produce stable-enough results for GDB. The test messages
appear to end up alpha sorted (losing the original sequence) and also
sorting changes between runs for some reason. That may be tolerable
for GCC, but for GDB, it often renders test results diffing between
different revisions unworkable.
Until that is fixed upstream, delete the script from the GDB tree.
testsuite/ChangeLog:
2015-03-09 Pedro Alves <palves@redhat.com>
* dg-extract-results.py: Delete.
Pedro Alves [Mon, 9 Mar 2015 17:47:17 +0000 (17:47 +0000)]
Make dg-extract-results.sh explicitly treat .{sum,log} files as text
This merges Sergio's fix from GCC:
https://gcc.gnu.org/ml/gcc-patches/2014-12/msg01293.html
gdb/testsuite/ChangeLog:
2015-03-09 Pedro Alves <palves@redhat.com>
Merge dg-extract-results.sh from GCC upstream (r218843).
2014-12-17 Sergio Durigan Junior <sergiodj@redhat.com>
* dg-extract-results.sh: Use --text with grep to avoid issues with
binary files. Fall back to cat -v, if that doesn't work.
Mike Frysinger [Mon, 9 Mar 2015 17:26:51 +0000 (13:26 -0400)]
sim: bfin: fix bug reference
Cary Coutant [Mon, 9 Mar 2015 17:10:29 +0000 (10:10 -0700)]
Fix failure in exception_static_test.
Because the __EH_FRAME_BEGIN__ symbol is provided in an empty .eh_frame
section in crtbeginT.o, if crt1.o has a non-empty .eh_frame section,
we place all optimized .eh_frame sections into the output section ahead
of the __EH_FRAME_BEGIN__ symbol, which breaks EH for statically-linked
binaries.
This patch fixes the problem by delaying the attachment of the optimized
.eh_frame sections to the output section until we see the end marker
section (or to the end of pass 1 if we never see an end marker).
gold/
PR gold/14675
* ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
return enum indicating whether .eh_frame section is empty, optimizable,
unrecognized, or an end marker. Adjust explicit instantiations.
* ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
(Eh_frame::add_ehframe_input_section): Change return type.
* gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
* layout.cc (Layout::layout_eh_frame): Don't add optimized sections
to the .eh_frame output section until we see the end marker.
(Layout::finalize_eh_frame_section): New.
* layout.h: (Layout::finalize_eh_frame_section): New.
Pedro Alves [Mon, 9 Mar 2015 11:29:56 +0000 (11:29 +0000)]
gdbserver/tracepoint: Add 'struct sockaddr_un *' -> 'struct sockaddr *' cast
Fixes this in C++ mode:
gdb/gdbserver/tracepoint.c: In function ‘void* gdb_agent_helper_thread(void*)’:
gdb/gdbserver/tracepoint.c:7190:47: error: cannot convert ‘sockaddr_un*’ to ‘sockaddr*’ for argument ‘2’ to ‘int accept(int, sockaddr*, socklen_t*)’
fd = accept (listen_fd, &sockaddr, &tmp);
gdb/gdbserver/ChangeLog:
2015-03-09 Pedro Alves <palves@redhat.com>
* tracepoint.c (gdb_agent_helper_thread): Cast '&sockaddr' to
'struct sockaddr' pointer in 'accept' call.
Pedro Alves [Mon, 9 Mar 2015 11:27:05 +0000 (11:27 +0000)]
Revert union gdb_sockaddr_u
This reverts
366c75fc.
We don't actually need to access the object through
"struct sockaddr *", so we don't need the union:
https://sourceware.org/ml/gdb-patches/2015-03/msg00213.html
gdb/ChangeLog:
2015-03-09 Pedro Alves <palves@redhat.com>
Revert:
2015-03-07 Pedro Alves <palves@redhat.com>
* common/gdb_socket.h: New file.
* ser-tcp.c: Include gdb_socket.h. Don't include netinet/in.h nor
sys/socket.h.
(net_open): Use union gdb_sockaddr_u.
gdb/gdbserver/ChangeLog:
2015-03-09 Pedro Alves <palves@redhat.com>
Revert:
2015-03-07 Pedro Alves <palves@redhat.com>
* gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
or <winsock2.h> here. Instead include "gdb_socket.h".
(remote_open): Use union gdb_sockaddr_u.
* remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
or <winsock2.h> here. Instead include "gdb_socket.h".
(handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
* tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
or <sys/un.h>.
(init_named_socket, gdb_agent_helper_thread): Use union
gdb_sockaddr_u.
Mike Frysinger [Mon, 9 Mar 2015 03:53:48 +0000 (23:53 -0400)]
sim: bfin: fix up linux-fixed-code.h generation [PR sim/10143]
The use of $< ends up picking the wrong object out of the depend
list. Specify the input name directly to avoid fragility.
On BSD systems, we need to make sure all options come before the
non-options (i.e. the files).
Reported-by: Chris Johns <chrisj@rtems.org>
URL: https://sourceware.org/bugzilla/show_bug.cgi?id=13160
GDB Administrator [Mon, 9 Mar 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
Mike Frysinger [Sun, 8 Mar 2015 07:24:03 +0000 (03:24 -0400)]
sim: microblaze: fix printf string
Since sizeof returns a size_t, use %zu to display it.
GDB Administrator [Sun, 8 Mar 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
Pedro Alves [Sat, 28 Feb 2015 19:11:10 +0000 (19:11 +0000)]
Remove C-specific warnings from common warning set
Whoops, these are C specific, but I somehow missed the warnings before:
cc1plus: warning: command line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option ‘-Wdeclaration-after-statement’ is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option ‘-Wmissing-parameter-type’ is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option ‘-Wold-style-declaration’ is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option ‘-Wold-style-definition’ is valid for C/ObjC but not for C++ [enabled by default]
gdb/ChangeLog:
2015-03-07 Pedro Alves <palves@redhat.com>
* configure.ac (build_warnings): Move -Wmissing-prototypes
-Wdeclaration-after-statement -Wmissing-parameter-type
-Wold-style-declaration -Wold-style-definition to the C-specific
set.
* configure: Regenerate.
gdb/gdbserver/ChangeLog:
2015-03-07 Pedro Alves <palves@redhat.com>
* configure.ac (build_warnings): Move
-Wdeclaration-after-statement to the C-specific set.
* configure: Regenerate.
Pedro Alves [Sat, 7 Mar 2015 17:30:46 +0000 (17:30 +0000)]
Fix struct sockaddr/sockaddr_in/sockaddr_un strict aliasing violations
Building gdbserver in C++ mode shows:
gdb/gdbserver/tracepoint.c: In function ‘void* gdb_agent_helper_thread(void*)’:
gdb/gdbserver/tracepoint.c:7190:47: error: cannot convert ‘sockaddr_un*’ to ‘sockaddr*’ for argument ‘2’ to ‘int accept(int, sockaddr*, socklen_t*)’
fd = accept (listen_fd, &sockaddr, &tmp);
A few places in the tree already have an explicit cast to struct
sockaddr *, but that's a strict aliasing violation. Instead of
propagating invalid code, fix this by using a union instead.
gdb/ChangeLog:
2015-03-07 Pedro Alves <palves@redhat.com>
* common/gdb_socket.h: New file.
* ser-tcp.c: Include gdb_socket.h. Don't include netinet/in.h nor
sys/socket.h.
(net_open): Use union gdb_sockaddr_u.
gdb/gdbserver/ChangeLog:
2015-03-07 Pedro Alves <palves@redhat.com>
* gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
or <winsock2.h> here. Instead include "gdb_socket.h".
(remote_open): Use union gdb_sockaddr_u.
* remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
or <winsock2.h> here. Instead include "gdb_socket.h".
(handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
* tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
or <sys/un.h>.
(init_named_socket, gdb_agent_helper_thread): Use union
gdb_sockaddr_u.
Pedro Alves [Sat, 7 Mar 2015 14:50:03 +0000 (14:50 +0000)]
Make TRY/CATCH use real C++ try/catch in C++ mode
Although the current TRY/CATCH implementation works in C++ mode too,
it relies on setjmp/longjmp, and longjmp bypasses calling the
destructors of objects on the stack, which is obviously bad for C++.
This patch fixes this by makes TRY/CATCH use real try/catch in C++
mode behind the scenes. The way this is done allows RAII and cleanups
to coexist while we phase out cleanups, instead of requiring a flag
day.
This patch is not strictly necessary until we require a C++ compiler
and start actually using RAII, though I'm all for baby steps, and it
shows my proposed way forward. Putting it in now, allows for easier
experimentation and exposure of potential problems with real C++
exceptions.
gdb/ChangeLog:
2015-03-07 Pedro Alves <palves@redhat.com>
* common/common-exceptions.c [!__cplusplus] (enum catcher_state)
(exceptions_state_mc_action_iter)
(exceptions_state_mc_action_iter_1, exceptions_state_mc_catch):
Don't define.
[__cplusplus] (try_scope_depth): New global.
[__cplusplus] (exception_try_scope_entry)
(exception_try_scope_exit, gdb_exception_sliced_copy)
(exception_rethrow): New functions.
(throw_exception): In C++ mode, throw
gdb_exception_RETURN_MASK_QUIT for RETURN_QUIT and
gdb_exception_RETURN_MASK_ERROR for RETURN_ERROR.
(throw_it): In C++ mode, use try_scope_depth.
* common/common-exceptions.h [!__cplusplus]
(exceptions_state_mc_action_iter)
(exceptions_state_mc_action_iter_1, exceptions_state_mc_catch):
Don't declare.
[__cplusplus] (exception_try_scope_entry)
(exception_try_scope_exit, exception_rethrow): Declare.
[__cplusplus] (struct exception_try_scope): New struct.
[__cplusplus] (TRY, CATCH, END_CATCH): Reimplement on top of real
C++ exceptions.
(struct gdb_exception_RETURN_MASK_ALL)
(struct gdb_exception_RETURN_MASK_ERROR)
(struct gdb_exception_RETURN_MASK_QUIT): New types.
Pedro Alves [Sat, 7 Mar 2015 14:50:03 +0000 (14:50 +0000)]
kill volatile struct gdb_exception
After the previous patch, this is the last remaining use of a volatile
struct gdb_exception. Kill it, as it's troublesome for C++: we can't
assign volatile <-> non-volatile without copy constructors /
assignment operators that do that, which I'd rather avoid.
gdb/ChangeLog:
2015-03-07 Pedro Alves <palves@redhat.com>
* main.c (handle_command_errors): Remove volatile qualifier from
parameter.
Pedro Alves [Sat, 7 Mar 2015 14:50:05 +0000 (14:50 +0000)]
more making TRY/CATCH callers look more like real C++ try/catch blocks
All these were caught by actually making TRY/CATCH use try/catch
behind the scenes, which then resulted in the build failing (on x86_64
Fedora 20) because there was code between the try and catch blocks.
gdb/ChangeLog:
2015-03-07 Pedro Alves <palves@redhat.com>
* breakpoint.c (save_breakpoints): Adjust to avoid code between
TRY and CATCH.
* gdbtypes.c (safe_parse_type): Remove empty line.
(types_deeply_equal):
* guile/scm-frame.c (gdbscm_frame_name):
* linux-thread-db.c (find_new_threads_once):
* python/py-breakpoint.c (bppy_get_commands):
* record-btrace.c (record_btrace_insert_breakpoint)
(record_btrace_remove_breakpoint, record_btrace_start_replaying)
(record_btrace_start_replaying): Adjust to avoid code between TRY
and CATCH.
Pedro Alves [Sat, 7 Mar 2015 15:14:14 +0000 (15:14 +0000)]
Split TRY_CATCH into TRY + CATCH
This patch splits the TRY_CATCH macro into three, so that we go from
this:
~~~
volatile gdb_exception ex;
TRY_CATCH (ex, RETURN_MASK_ERROR)
{
}
if (ex.reason < 0)
{
}
~~~
to this:
~~~
TRY
{
}
CATCH (ex, RETURN_MASK_ERROR)
{
}
END_CATCH
~~~
Thus, we'll be getting rid of the local volatile exception object, and
declaring the caught exception in the catch block.
This allows reimplementing TRY/CATCH in terms of C++ exceptions when
building in C++ mode, while still allowing to build GDB in C mode
(using setjmp/longjmp), as a transition step.
TBC, after this patch, is it _not_ valid to have code between the TRY
and the CATCH blocks, like:
TRY
{
}
// some code here.
CATCH (ex, RETURN_MASK_ERROR)
{
}
END_CATCH
Just like it isn't valid to do that with C++'s native try/catch.
By switching to creating the exception object inside the CATCH block
scope, we can get rid of all the explicitly allocated volatile
exception objects all over the tree, and map the CATCH block more
directly to C++'s catch blocks.
The majority of the TRY_CATCH -> TRY+CATCH+END_CATCH conversion was
done with a script, rerun from scratch at every rebase, no manual
editing involved. After the mechanical conversion, a few places
needed manual intervention, to fix preexisting cases where we were
using the exception object outside of the TRY_CATCH block, and cases
where we were using "else" after a 'if (ex.reason) < 0)' [a CATCH
after this patch]. The result was folded into this patch so that GDB
still builds at each incremental step.
END_CATCH is necessary for two reasons:
First, because we name the exception object in the CATCH block, which
requires creating a scope, which in turn must be closed somewhere.
Declaring the exception variable in the initializer field of a for
block, like:
#define CATCH(EXCEPTION, mask) \
for (struct gdb_exception EXCEPTION; \
exceptions_state_mc_catch (&EXCEPTION, MASK); \
EXCEPTION = exception_none)
would avoid needing END_CATCH, but alas, in C mode, we build with C90,
which doesn't allow mixed declarations and code.
Second, because when TRY/CATCH are wired to real C++ try/catch, as
long as we need to handle cleanup chains, even if there's no CATCH
block that wants to catch the exception, we need for stop at every
frame in the unwind chain and run cleanups, then rethrow. That will
be done in END_CATCH.
After we require C++, we'll still need TRY/CATCH/END_CATCH until
cleanups are completely phased out -- TRY/CATCH in C++ mode will
save/restore the current cleanup chain, like in C mode, and END_CATCH
catches otherwise uncaugh exceptions, runs cleanups and rethrows, so
that C++ cleanups and exceptions can coexist.
IMO, this still makes the TRY/CATCH code look a bit more like a
newcomer would expect, so IMO worth it even if we weren't considering
C++.
gdb/ChangeLog.
2015-03-07 Pedro Alves <palves@redhat.com>
* common/common-exceptions.c (struct catcher) <exception>: No
longer a pointer to volatile exception. Now an exception value.
<mask>: Delete field.
(exceptions_state_mc_init): Remove all parameters. Adjust.
(exceptions_state_mc): No longer pop the catcher here.
(exceptions_state_mc_catch): New function.
(throw_exception): Adjust.
* common/common-exceptions.h (exceptions_state_mc_init): Remove
all parameters.
(exceptions_state_mc_catch): Declare.
(TRY_CATCH): Rename to ...
(TRY): ... this. Remove EXCEPTION and MASK parameters.
(CATCH, END_CATCH): New.
All callers adjusted.
gdb/gdbserver/ChangeLog:
2015-03-07 Pedro Alves <palves@redhat.com>
Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH
instead.
Tom Tromey [Sat, 7 Mar 2015 14:50:04 +0000 (14:50 +0000)]
quit_force: Replace TRY_CATCH wrapper macros
More preparation for running the TRY_CATCH->TRY/CATCH conversion
script.
gdb/ChangeLog:
2015-03-07 Tom Tromey <tromey@redhat.com>
* top.c (quit_force): Inline and delete DO_TRY, DO_PRINT_EX.
Pedro Alves [Sat, 7 Mar 2015 14:50:04 +0000 (14:50 +0000)]
Normalize TRY_CATCH exception handling block
This normalizes some exception catch blocks that check for ex.reason
to look like this:
~~~
volatile gdb_exception ex;
TRY_CATCH (ex, RETURN_MASK_ALL)
{
...
}
if (ex.reason < 0)
{
...
}
~~~
This is a preparation step for running a script that converts all
TRY_CATCH uses to look like this instead:
~~~
TRY
{
...
}
CATCH (ex, RETURN_MASK_ALL)
{
...
}
END_CATCH
~~~
The motivation for that change is being able to reimplent TRY/CATCH in
terms of C++ try/catch.
This commit makes it so that:
- no condition other than ex.reason < 0 is checked in the if
predicate
- there's no "else" block to check whether no exception was caught
- there's no code between the TRY_CATCH (TRY) block and the
'if (ex.reason < 0)' block (CATCH).
- the exception object is no longer referred to outside the if/catch
block. Note the local volatile exception objects that are
currently defined inside functions that use TRY_CATCH will
disappear. In cases it's more convenient to still refer to the
exception outside the catch block, a new non-volatile local is
added and copy to that object is made within the catch block.
The following patches should make this all clearer.
gdb/ChangeLog:
2015-03-07 Pedro Alves <palves@redhat.com>
* amd64-tdep.c (amd64_frame_cache, amd64_sigtramp_frame_cache)
(amd64_epilogue_frame_cache): Normal exception handling code.
* break-catch-throw.c (check_status_exception_catchpoint)
(re_set_exception_catchpoint): Ditto.
* cli/cli-interp.c (safe_execute_command):
* cli/cli-script.c (script_from_file): Ditto.
* compile/compile-c-symbols.c (generate_c_for_for_one_variable):
Ditto.
* compile/compile-object-run.c (compile_object_run): Ditto.
* cp-abi.c (baseclass_offset): Ditto.
* cp-valprint.c (cp_print_value): Ditto.
* exceptions.c (catch_exceptions_with_msg):
* frame-unwind.c (frame_unwind_try_unwinder): Ditto.
* frame.c (get_frame_address_in_block_if_available): Ditto.
* i386-tdep.c (i386_frame_cache, i386_epilogue_frame_cache)
(i386_sigtramp_frame_cache): Ditto.
* infcmd.c (post_create_inferior): Ditto.
* linespec.c (parse_linespec, find_linespec_symbols):
* p-valprint.c (pascal_object_print_value): Ditto.
* parse.c (parse_expression_for_completion): Ditto.
* python/py-finishbreakpoint.c (bpfinishpy_init): Ditto.
* remote.c (remote_get_noisy_reply): Ditto.
* s390-linux-tdep.c (s390_frame_unwind_cache): Ditto.
* solib-svr4.c (solib_svr4_r_map): Ditto.
Pedro Alves [Sat, 7 Mar 2015 14:52:22 +0000 (14:52 +0000)]
Fix mail address format of a couple recent ChangeLog entries
GDB Administrator [Sat, 7 Mar 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
Yao Qi [Fri, 6 Mar 2015 14:14:27 +0000 (14:14 +0000)]
Use show_debug_regs as a boolean
I happen to see that show_debug_regs is used as an arithmetic type,
but it should be a boolean,
if (show_debug_regs > 1)
On the other hand, GDB RSP only allows setting it to either 0 or 1,
so it makes no sense to check whether it is greater than 1. This
patch fixes it.
gdb/gdbserver:
2015-03-06 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_insert_point): Use
show_debug_regs as a boolean.
(aarch64_remove_point): Likewise.
Nick Clifton [Fri, 6 Mar 2015 09:46:15 +0000 (09:46 +0000)]
Fix an undefined 32-bit right shift by replacing it with two 16-bit right shifts.
PR binutils/17765
* elflink.c (put_value): Like previous delta, but for the 32-bit
case.
Gary Benson [Fri, 6 Mar 2015 09:42:06 +0000 (09:42 +0000)]
New common function "startswith"
This commit introduces a new inline common function "startswith"
which takes two string arguments and returns nonzero if the first
string starts with the second. It also updates the 295 places
where this logic was written out longhand to use the new function.
gdb/ChangeLog:
* common/common-utils.h (startswith): New inline function.
All places where this logic was used updated to use the above.
GDB Administrator [Fri, 6 Mar 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
Pedro Alves [Thu, 5 Mar 2015 23:39:46 +0000 (23:39 +0000)]
gdb.base/bp-permanent.exp: Tighten regex
Trying to fix a permanent breakpoints bug, I broke "next" over a
regular breakpoint. "next" would immediately hit the breakpoint the
program was already stopped at. But, the "next over setup" test
failed to notice this and still issued a pass. That's because the
regex matches "testsuite" in:
Breakpoint 2 at 0x400687: file src/gdb/testsuite/gdb.base/bp-permanent.c, line 46.
gdb/testsuite/ChangeLog:
2015-03-05 Pedro Alves <palves@redhat.com>
* gdb.base/bp-permanent.exp: Tighten "next over setup" regex.
Pedro Alves [Thu, 5 Mar 2015 23:39:45 +0000 (23:39 +0000)]
PR gdb/18002: Fix reinsert of a permanent breakpoints
When we find out that a breakpoint is set on top of a program
breakpoint, we mark it as "permanent". E.g.,:
...
if (bp_loc_is_permanent (loc))
{
loc->inserted = 1;
loc->permanent = 1;
}
...
Note we didn't fill in the breakpoint's shadow (shadow_len remains 0).
In case the target claims support for evaluating breakpoint
conditions, GDB sometimes reinserts breakpoints that are already
inserted (to update the conditions on the target side). Since GDB
doesn't know whether the target supports evaluating conditions _of_
software breakpoints (vs hardware breakpoints, etc.) until it actually
tries it, if the target doesn't actually support z0 breakpoints, GDB
ends up reinserting a GDB-managed software/memory breakpoint
(mem-break.c).
And that is the case that is buggy: breakpoints that are marked
inserted contribute their shadows (if any) to the memory returned by
target_read_memory, to mask out breakpoints. Permanent breakpoints
are always marked as inserted. So if the permanent breakpoint doesn't
have a shadow yet in its shadow buffer, but we set shadow_len before
calling target_read_memory, then the still clear shadow_contents
buffer will be used by the breakpoint masking code... And then from
there on, the permanent breakpoint has a broken shadow buffer, and
thus any memory read out of that address will read bogus code, and
many random bad things fall out from that.
The fix is just to set shadow_len at the same time shadow_contents is
set, not one before and another after...
Fixes all gdb.base/bp-permanent.exp FAILs on PPC64 GNU/Linux gdbserver
and probably any other gdbserver port that doesn't do z0 breakpoints.
gdb/ChangeLog:
2015-03-05 Pedro Alves <palves@redhat.com>
PR gdb/18002
* mem-break.c (default_memory_insert_breakpoint): Set shadow_len
after reading the breakpoint's shadow memory.
Nick Clifton [Thu, 5 Mar 2015 17:26:10 +0000 (17:26 +0000)]
Fix a potentially undefined right shift by replacing it with two smaller right shifts.
PR binutils/17765
* elflink.c (put_value): Avoid using an undefined shift
operation.
Nick Clifton [Thu, 5 Mar 2015 16:45:15 +0000 (16:45 +0000)]
Extend description of --add-gnu-debuglink option to explain why the file must exist.
PR binutils/18064
* doc/binutils.texi (objcopy): Extend description of
--add-gnu-debuglink option to explain that the separate debug info
file must exist. Add a description of what to do if the debug
info file is built in one place but then installed into a separate
location.
Mark Kettenis [Thu, 5 Mar 2015 16:12:42 +0000 (17:12 +0100)]
Enable rthreads support on OpenBSD/hppa
gdb/
2015-03-05 Mark Kettenis <kettenis@gnu.org>
* hppabsd-nat.c: Remove file.
* hppaobsd-nat.c: New file.
* Makefile.in (ALLDEPFILES): Remove hppabsd-nat.c. Add
hppaobsd-nat.c.
* config/pa/obsd.mh (NATDEPFILES): Replace hppabsd-nat.o with
hppaobsd-nat.o.
H.J. Lu [Thu, 5 Mar 2015 15:52:41 +0000 (07:52 -0800)]
Remove typename on elfcpp::Elf_types<size>::Elf_Addr
GCC 4.2 complains:
binutils/gold/object.cc:3261: error: using ‘typename’ outside of template
This patch removes typename. It works with both GCC 4.2 and 4.8.
* output.cc (Relobj::initialize_input_to_output_map<size>):
Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
Nick Clifton [Thu, 5 Mar 2015 15:13:08 +0000 (15:13 +0000)]
Fixes PR 17994 - which reported that dlltool was not deleting temporary files if it encounters a fatal error.
PR binutils/17994
* dlltool.c (temp_file_to_remove): New local array.
(unlink_temp_files): New functions - unlinks any file in the
temp_file_to_remove array, unless dotdeltemps is set.
(gen_exp_file): Add temp files to array.
(make_head): Likewise.
(make_delay_head): Likewise.
(make_tail): Likewise.
(gen_lib_file): Call unlink_temp_files.
H.J. Lu [Thu, 5 Mar 2015 14:34:39 +0000 (06:34 -0800)]
Add extern_protected_data and set it for x86
With copy relocation, address of protected data defined in the shared
library may be external. This patch adds extern_protected_data and
changes _bfd_elf_symbol_refs_local_p to return false for protected data
if extern_protected_data is true.
bfd/
PR ld/pr15228
PR ld/pr17709
* elf-bfd.h (elf_backend_data): Add extern_protected_data.
* elf32-i386.c (elf_backend_extern_protected_data): New.
Defined to 1.
* elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
* elflink.c (_bfd_elf_adjust_dynamic_copy): Don't error on
copy relocs against protected symbols if extern_protected_data
is true.
(_bfd_elf_symbol_refs_local_p): Don't return true on protected
non-function symbols if extern_protected_data is true.
* elfxx-target.h (elf_backend_extern_protected_data): New.
Default to 0.
(elfNN_bed): Initialize extern_protected_data with
elf_backend_extern_protected_data.
ld/testsuite/
PR ld/pr15228
PR ld/pr17709
* ld-i386/i386.exp (i386tests): Add a test for PR ld/17709.
* ld-i386/pr17709-nacl.rd: New file.
* ld-i386/pr17709.rd: Likewise.
* ld-i386/pr17709a.s: Likewise.
* ld-i386/pr17709b.s: Likewise.
* ld-i386/protected3.d: Updated.
* ld-i386/protected3.s: Likewise.
* ld-x86-64/pr17709-nacl.rd: New file.
* ld-x86-64/pr17709.rd: Likewise.
* ld-x86-64/pr17709a.s: Likewise.
* ld-x86-64/pr17709b.s: Likewise.
* ld-x86-64/protected3.d: Updated.
* ld-x86-64/protected3.s: Likewise.
* ld-x86-64/x86-64.exp (x86_64tests): Add a test for PR ld/17709.
Nick Clifton [Thu, 5 Mar 2015 13:04:33 +0000 (13:04 +0000)]
Fixes a thinko in the implementation of the V850 -m8byte-align and -m4byte-align command line options.
* config/tc-v850.c (md_parse_option): Fix code to set or clear
EF_RH850_DATA_ALIGN8 bit in ELF header, based upon the use of the
-m8byte-align and -m4byte-align command line options.
Nick Clifton [Thu, 5 Mar 2015 12:14:26 +0000 (12:14 +0000)]
Allows the binutils to cope with PE binaries where the section addresses have been changed, but the DWARF debug info has not been altered.
PR binutils/18025
* coffgen.c (coff_find_nearest_line_with_names): If the dwarf2
lookup fails, check for an address bias in the dwarf info, and if
one exists, retry the lookup with the biased value.
* dwarf2.c (_bfd_dwarf2_find_symbol_bias): New function.
Determines if a bias exists bewteen the addresses of functions
based on DWARF information vs symbol table information.
* libbfd-in.h (_bfd_dwarf2_find_symbol_bias): Prototype.
* libbfd.h: Regenerate.
Pedro Alves [Thu, 5 Mar 2015 10:24:58 +0000 (10:24 +0000)]
Fix Windows/SPU/NTO/Lynx gdbserver builds
I forgot to update these target_ops instances when I added these new
hooks.
I confirmed mingw32-w64 builds again at least.
gdb/gdbserver/ChangeLog:
2015-03-05 Pedro Alves <palves@redhat.com>
* lynx-low.c (lynx_target_ops): Install NULL hooks for
stopped_by_sw_breakpoint, supports_stopped_by_sw_breakpoint,
stopped_by_hw_breakpoint, supports_stopped_by_hw_breakpoint.
* nto-low.c (nto_target_ops): Likewise.
* spu-low.c (spu_target_ops): Likewise.
* win32-low.c (win32_target_ops): Likewise.
GDB Administrator [Thu, 5 Mar 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
Cary Coutant [Wed, 4 Mar 2015 23:17:09 +0000 (15:17 -0800)]
Fix a race condition when setting default target for ARM targets.
gold/
* parameters.cc (Parameters::set_target_once): Call
Target::select_as_default_target just once from here...
(set_parameters_target): ...instead of from here.
Rafael Ávila de Espíndola [Wed, 4 Mar 2015 23:10:18 +0000 (15:10 -0800)]
Remove empty class Merge_map.
2015-03-02 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
* ehframe.cc (Cie::set_output_offset): Pass in and use a
Output_section_data instead of a Merge_map.
(Eh_frame::Eh_frame): Don't initialize merge_map_.
(Eh_frame::read_cie): Use add_merge_mapping instead of
Merge_map::add_mapping.
(Eh_frame::read_fde): Ditto.
(Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
(Eh_frame::do_output_offset): Use merge_output_offset istead of
merge_map_->get_output_offset.
(Eh_frame::do_is_merge_section_for): Delete.
* ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
instead of a Merge_map.
(Cie::set_output_offset): Pass in a Output_section_data instead of a
Merge_map.
(Eh_frame::do_is_merge_section_for): Delete.
(Eh_frame::merge_map_): Delete.
* merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
and use a Output_section_data instead of a Merge_map.
(Object_merge_map::add_mapping): Ditto.
(Object_merge_map::get_output_offset): Remove the merge_map argument.
(Object_merge_map::is_merge_section_for): Pass in and use a
Output_section_data instead of a Merge_map.
(Merge_map): Delete.
(Output_merge_base::do_output_offset): Use merge_output_offset instead
of merge_map_.get_output_offset.
(Output_merge_base::do_is_merge_section_for): Delete.
(Output_merge_data::do_add_input_section): Use
object->add_merge_mapping instead of add_mapping.
(Output_merge_string<Char_type>::finalize_merged_data): Ditto.
* merge.h (Merge_map): Delete forward declaration.
(Object_merge_map::add_mapping): Pass in and use a Output_section_data
instead of a Merge_map.
(Object_merge_map::get_output_offset): Remove the merge_map argument.
(Object_merge_map::is_merge_section_for): Pass in and use a
Output_section_data instead of a Merge_map.
(Input_merge_map::Object_merge_map::merge_map): Replace with
output_data.
(Object_merge_map::get_or_make_input_merge_map): Pass in and use a
Output_section_data instead of a Merge_map.
(Merge_map): Delete.
(Output_merge_base::Output_merge_base): Don't initialize merge_map_.
(Output_merge_base::do_is_merge_section_for): Delete.
(Output_merge_base::add_mapping): Delete.
(Output_merge_base::merge_map_): Delete.
* object.cc (Relobj::initialize_input_to_output_map): New.
(Relobj::initialize_input_to_output_map): New.
(Relobj::merge_output_offset): New.
(Relobj::is_merge_section_for): New.
(Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
bits.
* object.h (Relobj::merge_map): Delete.
(initialize_input_to_output_map): New.
(set_merge_map): Delete.
(add_merge_mapping): New.
(merge_output_offset): New.
(is_merge_section_for): New.
* output.cc (Output_section::Input_section::is_merge_section_for):
Use object->is_merge_section_for.
* output.h (Output_section_data::is_merge_section_for): Delete.
(Output_section_data::do_is_merge_section_for): Delete.
* reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
Use object->initialize_input_to_output_map.
(Merged_symbol_value<size>::value_from_output_section): Use
object->merge_output_offset.
Simon Marchi [Wed, 4 Mar 2015 16:37:31 +0000 (11:37 -0500)]
Accept all-stop alternative in mi_expect_interrupt
When interrupting a thread in non-stop vs all-stop, the signal given in
the MI *stopped event is not the same. Currently, mi_expect_interrupt only
accepts the case for non-stop, so this adds the alternative for all-stop.
gdb/testsuite/ChangeLog:
* lib/mi-support.exp (mi_expect_interrupt): Accept
alternative event for when in all-stop mode.
Pedro Alves [Wed, 4 Mar 2015 20:41:17 +0000 (20:41 +0000)]
garbage collect target_decr_pc_after_break
record-btrace was the only target making use of this, and it no longer
uses it.
gdb/ChangeLog:
2015-03-04 Pedro Alves <palves@redhat.com>
* target.h (struct target_ops) <to_decr_pc_after_break>: Delete.
(target_decr_pc_after_break): Delete declaration.
* target.c (default_target_decr_pc_after_break)
(target_decr_pc_after_break): Delete.
* linux-nat.c (check_stopped_by_breakpoint, linux_nat_wait_1): Use
gdbarch_decr_pc_after_break instead of target_decr_pc_after_break.
* linux-thread-db.c (check_event): Likewise.
* infrun.c (adjust_pc_after_break): Likewise.
* darwin-nat.c (cancel_breakpoint): Likewise.
* aix-thread.c (aix_thread_wait): Likewise.
* target-delegates.c: Regenerate.
Pedro Alves [Wed, 4 Mar 2015 20:41:17 +0000 (20:41 +0000)]
gdbserver/Linux: Use TRAP_BRKPT/TRAP_HWBPT
This patch adjusts gdbserver's Linux backend to tell gdbserver core
(and ultimately GDB) whether a trap was caused by a breakpoint.
It teaches the backend to get that information out of the si_code of
the SIGTRAP siginfo.
gdb/gdbserver/ChangeLog:
2015-03-04 Pedro Alves <palves@redhat.com>
* linux-low.c (check_stopped_by_breakpoint) [USE_SIGTRAP_SIGINFO]:
Decide whether a breakpoint triggered based on the SIGTRAP's
siginfo.si_code.
(thread_still_has_status_pending_p) [USE_SIGTRAP_SIGINFO]: Don't check whether a
breakpoint is inserted if relying on SIGTRAP's siginfo.si_code.
(linux_low_filter_event): Check for breakpoints before checking
watchpoints.
(linux_wait_1): Don't re-increment the PC if relying on SIGTRAP's
siginfo.si_code.
(linux_stopped_by_sw_breakpoint)
(linux_supports_stopped_by_sw_breakpoint)
(linux_stopped_by_hw_breakpoint)
(linux_supports_stopped_by_hw_breakpoint): New functions.
(linux_target_ops): Install new target methods.
Pedro Alves [Wed, 4 Mar 2015 20:41:16 +0000 (20:41 +0000)]
gdbserver: Support the "swbreak"/"hwbreak" stop reasons
This patch teaches the core of gdbserver about the new "swbreak" and
"hwbreak" stop reasons, and adds the necessary hooks a backend needs
to implement to support the feature.
gdb/gdbserver/ChangeLog:
2015-03-04 Pedro Alves <palves@redhat.com>
* remote-utils.c (prepare_resume_reply): Report swbreak/hbreak.
* server.c (swbreak_feature, hwbreak_feature): New globals.
(handle_query) <qSupported>: Handle "swbreak+" and "hwbreak+".
(captured_main): Clear swbreak_feature and hwbreak_feature.
* server.h (swbreak_feature, hwbreak_feature): Declare.
* target.h (struct target_ops) <stopped_by_sw_breakpoint,
supports_stopped_by_sw_breakpoint, stopped_by_hw_breakpoint,
supports_stopped_by_hw_breakpoint>: New fields.
(target_supports_stopped_by_sw_breakpoint)
(target_stopped_by_sw_breakpoint)
(target_supports_stopped_by_hw_breakpoint)
(target_stopped_by_hw_breakpoint): Declare.
Pedro Alves [Wed, 4 Mar 2015 20:41:16 +0000 (20:41 +0000)]
Linux native: Use TRAP_BRKPT/TRAP_HWBPT
This patch adjusts the native Linux target backend to tell the core
whether a trap was caused by a breakpoint.
It teaches the target to get that information out of the si_code of
the SIGTRAP siginfo.
Tested on x86-64 Fedora 20, s390 RHEL 7, and PPC64 Fedora 18. An
earlier version was tested on ARM Fedora 21.
gdb/ChangeLog:
2015-03-04 Pedro Alves <palves@redhat.com>
* linux-nat.c (save_sigtrap): Check for breakpoints before
checking watchpoints.
(status_callback) [USE_SIGTRAP_SIGINFO]: Don't check whether a
breakpoint is inserted if relying on SIGTRAP's siginfo.si_code.
(check_stopped_by_breakpoint) [USE_SIGTRAP_SIGINFO]: Decide whether
a breakpoint triggered based on the SIGTRAP's siginfo.si_code.
(linux_nat_stopped_by_sw_breakpoint)
(linux_nat_supports_stopped_by_sw_breakpoint)
(linux_nat_stopped_by_hw_breakpoint)
(linux_nat_supports_stopped_by_hw_breakpoint): New functions.
(linux_nat_wait_1): Don't re-increment the PC if relying on
SIGTRAP's siginfo->si_code.
(linux_nat_add_target): Install new target methods.
* linux-thread-db.c (check_event): Don't account for breakpoint PC
offset if the target already adjusted the PC.
* nat/linux-ptrace.h (USE_SIGTRAP_SIGINFO): New.
(GDB_ARCH_TRAP_BRKPT): New.
(TRAP_HWBKPT): Define if not already defined.
Pedro Alves [Wed, 4 Mar 2015 20:41:16 +0000 (20:41 +0000)]
remote+docs: software/hardware breakpoint traps
This adjusts target remote to tell the core whether a trap was caused
by a breakpoint.
To that end, the patch teaches GDB about new RSP stop reasons "T05
swbreak" and "T05 hwbreak", that remote targets report back to GDB,
similarly to how "T05 watch" indicates a stop caused by a watchpoint.
Because targets that can report these events are expected to
themselves adjust the PC after a software breakpoint, these new stop
reasons must only be reported if the stub is talking to a GDB that
understands them. Because of that, the use of the new stop reasons
needs to be handshaked on initial connection, using the qSupported
mechanism. GDB simply sends "swbreak+" in its qSupports query, and
the stub reports back "swbreak+" too.
Because these new stop reasons are required to fix a fundamental
non-stop mode problem, this commit extends the remote non-stop intro
section in the manual, documenting the events as required.
To be clear, GDB will still cope with remote targets that don't
support these new stop reasons; it will behave just like today.
Tested on x86-64 Fedora 20, native and gdbserver.
gdb/ChangeLog:
2015-03-04 Pedro Alves <palves@redhat.com>
* NEWS: Mention the new "swbreak" and "hwbreak" stop reasons.
* remote.c (struct remote_state) <remote_stopped_by_watchpoint_p>:
Delete field.
<stop_reason>: New field.
(PACKET_swbreak_feature, PACKET_hwbreak_feature): New enum values.
(packet_set_cmd_state): New function.
(remote_protocol_features): Register the "swbreak" and "hwbreak"
features.
(remote_query_supported): If not disabled with the corresponding
"set remote foo-packet" command, report support for the swbreak
and hwbreak features.
(struct stop_reply) <remote_stopped_by_watchpoint_p>: Delete
field.
<stop_reason>: New field.
(remote_parse_stop_reply): Handle "swbreak" and "hwbreak".
(remote_wait_as): Adjust.
(remote_stopped_by_sw_breakpoint)
(remote_supports_stopped_by_sw_breakpoint)
(remote_stopped_by_hw_breakpoint)
(remote_supports_stopped_by_hw_breakpoint): New functions.
(remote_stopped_by_watchpoint): New function.
(init_remote_ops): Install them.
(_initialize_remote): Register new "set/show remote
swbreak-feature-packet" and "set/show remote
swbreak-feature-packet" commands.
gdb/doc/ChangeLog:
2015-03-04 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Remote Configuration): Document the "set/show
remote swbreak-feature-packet" and "set/show remote
hwbreak-feature-packet" commands.
(Packets) <Z0>: Add cross link to the "swbreak" stop reason's
decription.
(Stop Reply Packets): Document the swbreak and hwbreak stop
reasons.
(General Query Packets): Document the swbreak and hwbreak
qSupported features.
(Remote Non-Stop): Explain that swbreak and hwbreak are required.
Pedro Alves [Wed, 4 Mar 2015 20:41:15 +0000 (20:41 +0000)]
record-full/record-btrace: software/hardware breakpoint trap
This adjusts the record targets to tell the core whether a trap was
caused by a breakpoint. Targets that can do this should report
breakpoint traps with the PC already adjusted, so this removes the
re-incrementing record-full was doing.
These targets need to be adjusted before process_stratum targets
beneath are, otherwise target_supports_stopped_by_sw_breakpoint,
etc. would fall through to the target beneath while
recording/replaying, and the core would get confused.
Tested on x86-64 Fedora 20, native and gdbserver.
gdb/ChangeLog:
2015-03-04 Pedro Alves <palves@redhat.com>
* btrace.h: Include target/waitstatus.h.
(struct btrace_thread_info) <stop_reason>: New field.
* record-btrace.c (record_btrace_step_thread): Use
record_check_stopped_by_breakpoint instead of breakpoint_here_p.
(record_btrace_decr_pc_after_break): Delete.
(record_btrace_stopped_by_sw_breakpoint)
(record_btrace_supports_stopped_by_sw_breakpoint)
(record_btrace_stopped_by_hw_breakpoint)
(record_btrace_supports_stopped_by_hw_breakpoint): New functions.
(init_record_btrace_ops): Install them.
* record-full.c (record_full_hw_watchpoint): Delete and replace
with ...
(record_full_stop_reason): ... this throughout.
(record_full_exec_insn): Adjust.
(record_full_wait_1): Adjust. No longer re-increment the PC.
(record_full_wait_1): Adjust. Use
record_check_stopped_by_breakpoint instead of breakpoint_here_p.
(record_full_stopped_by_watchpoint): Adjust.
(record_full_stopped_by_sw_breakpoint)
(record_full_supports_stopped_by_sw_breakpoint)
(record_full_supports_stopped_by_sw_breakpoint)
(record_full_stopped_by_hw_breakpoint)
(record_full_supports_stopped_by_hw_breakpoint): New functions.
(init_record_full_ops, init_record_full_core_ops): Install them.
* record.c (record_check_stopped_by_breakpoint): New function.
* record.h: Include target/waitstatus.h.
(record_check_stopped_by_breakpoint): New declaration.
Pedro Alves [Wed, 4 Mar 2015 20:41:15 +0000 (20:41 +0000)]
enum lwp_stop_reason -> enum target_stop_reason
We're going to need the same enum as enum lwp_stop_reason in more
targets, so this promotes it to common code.
gdb/gdbserver/ChangeLog:
2015-03-04 Pedro Alves <palves@redhat.com>
enum lwp_stop_reason -> enum target_stop_reason
* linux-low.c (check_stopped_by_breakpoint): Adjust.
(thread_still_has_status_pending_p, check_stopped_by_watchpoint)
(linux_wait_1, stuck_in_jump_pad_callback)
(move_out_of_jump_pad_callback, linux_resume_one_lwp)
(linux_stopped_by_watchpoint):
* linux-low.h (enum lwp_stop_reason): Delete.
(struct lwp_info) <stop_reason>: Now an enum target_stop_reason.
* linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
gdb/ChangeLog:
2015-03-04 Pedro Alves <palves@redhat.com>
enum lwp_stop_reason -> enum target_stop_reason
* linux-nat.c (linux_resume_one_lwp, check_stopped_by_watchpoint)
(linux_nat_stopped_by_watchpoint, status_callback)
(linux_nat_wait_1): Adjust.
* linux-nat.h (enum lwp_stop_reason): Delete.
(struct lwp_info) <stop_reason>: Now an enum target_stop_reason.
* x86-linux-nat.c (x86_linux_prepare_to_resume): Adjust.
* target/waitstatus.h (enum target_stop_reason): New.
Pedro Alves [Wed, 4 Mar 2015 20:41:15 +0000 (20:41 +0000)]
Teach GDB about targets that can tell whether a trap is a breakpoint event
The moribund locations heuristics are problematic. This patch teaches
GDB about targets that can reliably tell whether a trap was caused by
a software or hardware breakpoint, and thus don't need moribund
locations, thus bypassing all the problems that mechanism has.
The non-stop-fair-events.exp test is frequently failing currently.
E.g., see https://sourceware.org/ml/gdb-testers/2015-q1/msg03148.html.
The root cause is a fundamental problem with moribund locations. For
example, the stepped_breakpoint logic added by
af48d08f breaks in this
case (which is what happens with that test):
- Step thread A, no breakpoint is set at PC.
- The kernel doesn't schedule thread A yet.
- Insert breakpoint at A's PC, for some reason (e.g., a step-resume
breakpoint for thread B).
- Kernel finally schedules thread A.
- thread A's stepped_breakpoint flag is not set, even though it now
stepped a breakpoint instruction.
- adjust_pc_after_break gets the PC wrong, because PC == PREV_PC, but
stepped_breakpoint is not set.
We needed the stepped_breakpoint logic to workaround moribund
locations, because otherwise adjust_pc_after_break could apply an
adjustment when it shouldn't just because there _used_ to be a
breakpoint at PC (a moribund breakpoint location). For example, on
x86, that's wrong if the thread really hasn't executed an int3, but
instead executed some other 1-byte long instruction. Getting the PC
adjustment wrong of course leads to the inferior executing the wrong
instruction.
Other problems with moribund locations are:
- if a true SIGTRAP happens to be raised when the program is
executing the PC that used to have a breakpoint, GDB will assume
that is a trap for a breakpoint that has recently been removed, and
thus we miss reporting the random signal to the user.
- to minimize that, we get rid of moribund location after a while.
That while is defined as just a certain number of events being
processed. That number of events sometimes passes by before a
delayed breakpoint is processed, and GDB confuses the trap for a
random signal, thus reporting the random trap. Once the user
resumes the thread, the program crashes because the PC was not
adjusted...
The fix for all this is to bite the bullet and get rid of heuristics
and instead rely on the target knowing accurately what caused the
SIGTRAP. The target/kernel/stub is in the best position to know what
that, because it can e.g. consult priviledged CPU flags GDB has no
access to, or by knowing which exception vector entry was called when
the instruction trapped, etc. Most debug APIs I've seen to date
report breakpoint hits as a distinct event in some fashion. For
example, on the Linux kernel, whether a breakpoint was executed is
exposed to userspace in the si_code field of the SIGTRAP's siginfo.
On Windows, the debug API reports a EXCEPTION_BREAKPOINT exception
code.
We needed to keep around deleted breakpoints in an on-the-side list
(the moribund locations) for two main reasons:
- Know that a SIGTRAP actually is a delayed event for a hit of a
breakpoint that was removed before the event was processed, and
thus should not be reported as a random signal.
- So we still do the decr_pc_after_break adjustment in that case, so
that the thread is resumed at the correct address.
In the new model, if GDB processes an event the target tells is a
breakpoint trap, and GDB doesn't find the corresponding breakpoint in
its breakpoint tables, it means that event is a delayed event for a
breakpoint that has since been removed, and thus the event should be
ignored.
For the decr_pc_after_after issue, it ends up being much simpler that
on targets that can reliably tell whether a breakpoint trapped, for
the breakpoint trap to present the PC already adjusted. Proper
multi-threading support already implies that targets needs to be doing
decr_pc_after_break adjustment themselves, otherwise for example, in
all-stop if two threads hit a breakpoint simultaneously, and the user
does "info threads", he'll see the non-event thread that hit the
breakpoint stopped at the wrong PC.
This way (target adjusts) also ends up eliminating the need for some
awkward re-incrementing of the PC in the record-full and Linux targets
that we do today, and the need for the target_decr_pc_after_break
hook.
If the target always adjusts, then there's a case where GDB needs to
re-increment the PC. Say, on x86, an "int3" instruction that was
explicitly written in the program traps. In this case, GDB should
report a random SIGTRAP signal to the user, with the PC pointing at
the instruction past the int3, just like if GDB was not debugging the
program. The user may well decide to pass the SIGTRAP to the program
because the program being debugged has a SIGTRAP handler that handles
its own breakpoints, and expects the PC to be unadjusted.
Tested on x86-64 Fedora 20.
gdb/ChangeLog:
2015-03-04 Pedro Alves <palves@redhat.com>
* breakpoint.c (need_moribund_for_location_type): New function.
(bpstat_stop_status): Don't skipping checking moribund locations
of breakpoint types which the target tell caused a stop.
(program_breakpoint_here_p): New function, factored out from ...
(bp_loc_is_permanent): ... this.
(update_global_location_list): Don't create a moribund location if
the target supports reporting stops of the type of the removed
breakpoint.
* breakpoint.h (program_breakpoint_here_p): New declaration.
* infrun.c (adjust_pc_after_break): Return early if the target has
already adjusted the PC. Add comments.
(handle_signal_stop): If nothing explains a signal, and the target
tells us the stop was caused by a software breakpoint, check if
there's a breakpoint instruction in the memory. If so, adjust the
PC before presenting the stop to the user. Otherwise, ignore the
trap. If nothing explains a signal, and the target tells us the
stop was caused by a hardware breakpoint, ignore the trap.
* target.h (struct target_ops) <to_stopped_by_sw_breakpoint,
to_supports_stopped_by_sw_breakpoint, to_stopped_by_hw_breakpoint,
to_supports_stopped_by_hw_breakpoint>: New fields.
(target_stopped_by_sw_breakpoint)
(target_supports_stopped_by_sw_breakpoint)
(target_stopped_by_hw_breakpoint)
(target_supports_stopped_by_hw_breakpoint): Define.
* target-delegates.c: Regenerate.
Pedro Alves [Wed, 4 Mar 2015 17:23:55 +0000 (17:23 +0000)]
Fix gdb.threads/thread-specific-bp.exp race
Gary stumbled on this:
(gdb) PASS: gdb.threads/thread-specific-bp.exp: all-stop: continue to end
info threads
Id Target Id Frame
* 1 Thread 0x7ffff7fdb700 (LWP 13717) "thread-specific" end () at /home/gary/work/archer/startswith/src/gdb/testsuite/gdb.threads/thread-specific-bp.c:29
(gdb) FAIL: gdb.threads/thread-specific-bp.exp: all-stop: thread start is gone
info breakpoint
The problem is that "...archer/startswith/src..." has a "start" in it,
which matches the too-lax regex in the test.
Rather than tweaking the regex, we can just remove the whole "info
threads", like we removed similar ones in other files -- GDB nowadays
does this implicitly already, so things should work without it. Thus
removing this even improves testing here a bit.
gdb/testsuite/ChangeLog:
2015-03-04 Pedro Alves <palves@redhat.com>
* gdb.threads/thread-specific-bp.exp: Delete "info threads" test.
Pedro Alves [Wed, 4 Mar 2015 15:03:33 +0000 (15:03 +0000)]
follow-fork: don't lose the ptids as set by the target
This Linuxism has made its way into infrun.c, in the follow-fork code:
inferior_ptid = ptid_build (child_pid, child_pid, 0);
The OS-specific code should fill in the LWPID, TID parts with the
appropriate values, if any, and the core code should not be peeking at
the components of the ptids.
gdb/
2015-03-04 Pedro Alves <palves@redhat.com>
* infrun.c (follow_fork_inferior): Use the whole of the
inferior_ptid and pending_follow.related_pid ptids instead of
building ptids from the process components. Adjust verbose output
to use target_pid_to_str.
* linux-nat.c (linux_child_follow_fork): Use the whole of the
inferior_ptid and pending_follow.related_pid ptids instead of
building ptids from the process components.
Mark Kettenis [Wed, 4 Mar 2015 14:36:03 +0000 (15:36 +0100)]
Stupid git!
Apparently fixing a typo while you're editing the commit message doesn't work.
Yao Qi [Tue, 3 Mar 2015 16:10:27 +0000 (16:10 +0000)]
Add linux-aarch64-low.c in SFILE
gdb/gdbserver:
2015-03-04 Yao Qi <yao.qi@linaro.org>
* Makefile.in (SFILES): Add linux-aarch64-low.c.
Mark Kettenis [Wed, 4 Mar 2015 13:53:14 +0000 (14:53 +0100)]
Enable gdb.base/foll-fork.exp on OpenBSD
gdb/testsuite/
2015-03-04 Mark Kettenis <kettenis@gnu.org>
* gdb.base/foll-fork.exp: Enable on *-*-openbsd*.
Mark Kettenis [Wed, 4 Mar 2015 13:22:42 +0000 (14:22 +0100)]
Make "catch fork" work on systems with PT_GET_PROCESS_STATE
These systems (OpenBSD and HP-UX 10.x) already support follow-fork
including the events needed to for "catch fork". This just makes
the upper layers realize this.
gdb/
2015-03-04 Mark Kettenis <kettenis@gnu.org>
* inf-ptrace.c [PT_GET_PROCESS_STATE]
(inf_ptrace_insert_fork_catchpoint): New function.
(inf_ptrace_remove_fork_catchpoint): New function.
(inf_ptrace_target) [PT_GET_PROCESS_STATE]: Install them.
Marcus Shawcroft [Wed, 4 Mar 2015 12:21:02 +0000 (12:21 +0000)]
[AArch64] Removing unused functions.
Removing a group of unused functions from the AArch64 BFD backend.
Marcus Shawcroft [Mon, 2 Mar 2015 12:12:37 +0000 (12:12 +0000)]
[AArch64] Call abort() consistently in unhandled stub switch statements.
Ensure we hard stop via abort() for unhandled stub types rather than
continuing either silently (or noisly with a BFD_FAIL()).
Call abort() giving a hard stop rather than BFD_FAIL () for unhandled
stub types.
Andreas Arnez [Wed, 4 Mar 2015 09:40:41 +0000 (10:40 +0100)]
S390: Name "invisible" registers with the empty string instead of NULL
When adding vector register support to GDB, s390_register_name() was
added to suppress the right halves of the first 16 vector registers.
However, that function returned NULL instead of an empty string in such
a case. This leads to an incomplete list of registers returned by
"complete info registers ", because completion stops at the first NULL
return value from user_reg_map_regnum_to_name().
gdb/ChangeLog:
* s390-linux-tdep.c (s390_register_name): Return empty string
instead of NULL for registers that shouldn't be visible.
Andreas Arnez [Wed, 4 Mar 2015 09:40:40 +0000 (10:40 +0100)]
breakpoint-in-ro-region.exp: Support targets stopping in mid-line after "si"
On some targets each of the assignments "i = 0" in the C source for
"breakpoint-in-ro-region.exp" are compiled to a single instruction.
Then each "si" stops at the beginning of the next source line. But on
some other targets (like s390) such an assignment compiles to multiple
instructions. Then "si" may stop in mid-line, and GDB displays the PC
address in addition to the source line number. This was not considered
by the regexp for this case.
gdb/testsuite/ChangeLog:
* gdb.base/breakpoint-in-ro-region.exp (test_single_step): In the
regexps for GDB's current line display, accept a hex address
preceding the line number.
Andreas Arnez [Wed, 4 Mar 2015 09:40:40 +0000 (10:40 +0100)]
catch-syscall.exp: Fix missing architecture name for s390:31-bit
For the "multiple targets" test in catch-syscall.exp, set the 'arch1'
variable to a valid string.
gdb/testsuite/ChangeLog:
* gdb.base/catch-syscall.exp (test_catch_syscall_multi_arch): Set
the 'arch1' variable for "s390*-linux*" targets.
Andreas Arnez [Wed, 4 Mar 2015 09:40:40 +0000 (10:40 +0100)]
S390: Fix syscall list for s390x
This patch fixes a typo that caused the wrong syscall XML file to be
used for s390x targets.
gdb/ChangeLog:
* s390-linux-tdep.c (s390_gdbarch_init): Use the correct syscall
XML file for 64-bit targets.
Andreas Arnez [Wed, 4 Mar 2015 09:40:39 +0000 (10:40 +0100)]
S390: Place "s390:31-bit" after default arch in 64-bit arch list
On 64-bit platforms GDB did not include "s390:31-bit" in its list of
architecture names. This patch fixes that.
To determine the list of architecture names for S390,
gdbarch_printable_names() walks through the linked list of BFD arches
starting with the default S390 arch, which is "s390:64-bit" on 64-bit
platforms. But since "s390:64-bit" was at the end of that list, the
31-bit architecture was not reached. The patch swaps the elements of
that list on 64-bit platforms.
bfd/ChangeLog:
* cpu-s390.c (N): New macro.
(bfd_s390_31_arch): New. Define only if default target word size
is 64 bits. Otherwise define...
(bfd_390_64_arch): ...this. Make static.
(bfd_s390_arch): Define according to the default target word size.
Let the 'next' field point to the alternate arch.
Pedro Alves [Wed, 4 Mar 2015 09:13:49 +0000 (09:13 +0000)]
gdb.threads/clone-thread_db.c: Add missing includes and fix pthread_join call
This fixes:
> gdb compile failed, /gdb/testsuite/gdb.threads/clone-thread_db.c: In function 'main':
> /gdb/testsuite/gdb.threads/clone-thread_db.c:67:3: warning: implicit declaration of function 'alarm' [-Wimplicit-function-declaration]
> alarm (300);
> ^
> /gdb/testsuite/gdb.threads/clone-thread_db.c:69:3: warning: implicit declaration of function 'pthread_create' [-Wimplicit-function-declaration]
> pthread_create (&child, NULL, thread_fn, NULL);
> ^
> /gdb/testsuite/gdb.threads/clone-thread_db.c:70:3: warning: implicit declaration of function 'pthread_join' [-Wimplicit-function-declaration]
> pthread_join (child);
> ^
And then adding the missing headers revealed the pthread_join call was
incorrect. This probably fixes the crash we see on ppc64be, e.g., at
https://sourceware.org/ml/gdb-testers/2015-q1/msg04415.html
the logs there show:
...
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x3fffb7ff54a0 (LWP 9275)]
0x00003fffb7f3ce74 in .pthread_join () from /lib64/libpthread.so.0
(gdb) FAIL: gdb.threads/clone-thread_db.exp: continue to end
...
Tested on x86_64 Fedora 20.
gdb/testsuite/
2015-03-04 Pedro Alves <palves@redhat.com>
* gdb.threads/clone-thread_db.c: Include unistd.h and pthread.h.
(main): Pass missing retval argument to pthread_join call.
Richard Sandiford [Wed, 4 Mar 2015 09:08:49 +0000 (09:08 +0000)]
Allow MOVK for R_AARCH64_TLSLE_MOVW_TPREL_G{0,1}NC
bfd/
PR gas/17843
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Expect
R_AARCH64_TLSLE_MOVW_TPREL_G0_NC and R_AARCH64_TLSLE_MOVW_TPREL_G1_NC
to be used with MOVK rather than MOVZ.
gas/
PR gas/17843
* config/tc-aarch64.c (process_movw_reloc_info): Allow
R_AARCH64_TLSLE_MOVW_TPREL_G0_NC and R_AARCH64_TLSLE_MOVW_TPREL_G1_NC
for MOVK.
gas/testsuite/
PR gas/17843
* gas/aarch64/tls.s, gas/aarch64/tls.d: Add test for
R_AARCH64_TLSLE_MOVW_TPREL_G0/R_AARCH64_TLSLE_MOVW_TPREL_G1_NC
sequence.
ld/testsuite/
PR gas/17843
* ld-aarch64/tlsle.s, ld-aarch64/tlsle.d: New test.
* ld-aarch64/aarch64-elf.exp: Run it.
GDB Administrator [Wed, 4 Mar 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
DJ Delorie [Tue, 3 Mar 2015 22:49:44 +0000 (17:49 -0500)]
RL78 - fix ADDR16 relax
* elf32-rl78.c (rl78_elf_relax_section): Only relax ADDR16's if
there's a symbol.
Simon Marchi [Tue, 3 Mar 2015 17:45:11 +0000 (12:45 -0500)]
Remove unused function declarations in target.h
find_default_create_inferior and find_default_attach were removed in
b3ccfe11.
gdb/ChangeLog:
* target.h (find_default_create_inferior): Remove declaration.
(find_default_attach): Likewise.