aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-07-21Fix djgpp gdb buildPedro Alves4-7/+35
- A few missing casts required by C++, resulting in: ../../src/gdb/ser-go32.c:795:21: error: invalid conversion from 'const void*' to 'const char*' [-fpermissive] etc. - dos_noop has an incompatible prototype with struct serial_ops's setparity, resulting in: ../../src/gdb/ser-go32.c:874:1: error: invalid conversion from 'int (*)(serial*)' to 'int (*)(serial*, int)' [-fpermissive] (I thought of calling the ser-base.c default methods, but djgpp doesn't include ser-base.c in the build.) gdb/ChangeLog: 2016-07-21 Pedro Alves <palves@redhat.com> * go32-nat.c (go32_create_inferior): Add cast. * ser-go32.c (dos_noop): Delete. (dos_flush_output, dos_setparity, dos_drain_output): New functions. (dos_write): Add cast. (dos_ops): Use dos_flush_output, dos_setparity and dos_drain_output. * top.c (do_chdir_cleanup): Add cast.
2016-07-21Remove unused variable in windows-nat.cPedro Alves2-2/+5
Leave the call for side effects. gdb/ChangeLog: 2016-07-21 Pedro Alves <palves@redhat.com> * windows-nat.c (handle_exception): Remove "th".
2016-07-21Remove unused variable in gdb/varobj.c when built without Python supportPedro Alves2-2/+7
gdb/ChangeLog: 2016-07-21 Pedro Alves <palves@redhat.com> * varobj.c (varobj_value_get_print_value): Move "gdbarch" to block scope that uses it.
2016-07-21Fix cast to 'gdb_breakpoint *'Yao Qi2-1/+6
c-mode buildbot catches a build problem, gcc -g -O2 -I. -I../../../binutils-gdb/gdb/gdbserver -I../../../binutils-gdb/gdb/gdbserver/../common -I../../../binutils-gdb/gdb/gdbserver/../regformats -I../../../binutils-gdb/gdb/gdbserver/.. -I../../../binutils-gdb/gdb/gdbserver/../../include -I../../../binutils-gdb/gdb/gdbserver/../gnulib/import -Ibuild-gnulib-gdbserver/import -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wpointer-sign -Wmissing-prototypes -Wdeclaration-after-statement -Wmissing-parameter-type -Wold-style-declaration -Wold-style-definition -Wformat-nonliteral -Wno-missing-prototypes -Werror -DGDBSERVER -c -o hostio.o -MT hostio.o -MMD -MP -MF .deps/hostio.Tpo ../../../binutils-gdb/gdb/gdbserver/hostio.c ../../../binutils-gdb/gdb/gdbserver/mem-break.c: In function find_gdb_breakpoint: ../../../binutils-gdb/gdb/gdbserver/mem-break.c:996:15: error: gdb_breakpoint undeclared (first use in this function) return (gdb_breakpoint *) bp; we should use 'struct gdb_breakpoint' rather than 'gdb_breakpoint'. Patch below fixes this. gdb/gdbserver: 2016-07-21 Yao Qi <yao.qi@linaro.org> * mem-break.c (find_gdb_breakpoint): Cast bp to 'struct gdb_breakpoint *' rather than 'gdb_breakpoint *'.
2016-07-21Support vCont s and S actions with software single stepYao Qi2-5/+13
GDBserver with software single step should be able to claim supporting vCont s and S actions, so that GDB knows the remote target can do single step. It doesn't matter to GDB that the single step in the remote target is done via hardware or software. gdb/gdbserver: 2016-07-21 Yao Qi <yao.qi@linaro.org> * server.c (handle_v_requests): Support s and S actions if target_supports_software_single_step return true.
2016-07-21Use reinsert_breakpoint for vCont;sYao Qi2-8/+83
This patch is to teach GDBserver using software single step to handle vCont;s. Simply speaking, if the thread's resume request is resume_step, install reinsert breakpoint at the next pcs when GDBserver is about to resume threads. These reinsert breakpoints of a thread are removed, when GDBserver gets an event from that thread and reports it back to GDB. gdb/gdbserver: 2016-07-21 Yao Qi <yao.qi@linaro.org> * linux-low.c (resume_stopped_resumed_lwps): If resume request is resume_step, call maybe_hw_step. (linux_wait_1): Stop all threads, remove reinsert breakpoints, and unstop them. (linux_resume_one_lwp_throw): Don't assert the thread has reinsert breakpoints or not. (proceed_one_lwp): If resume request is resume_step, install reinsert breakpoints and call maybe_hw_step.
2016-07-21Enqueue signal even when resuming threadsYao Qi2-21/+27
Nowadays, we only enqueue signal when we leave thread pending in linux_resume_one_thread. If lwp->resume->sig isn't zero (GDB wants to resume with signal), we pass lwp->resume->sig to linux_resume_one_lwp. In order to reduce the difference between resuming thread with signal and proceeding thread with signal, when we resume thread, we can enqueue signal too, and proceed thread. The signal will be consumed in linux_resume_one_lwp_throw from lwp->pending_signals. gdb/gdbserver: 2016-07-21 Yao Qi <yao.qi@linaro.org> * linux-low.c (proceed_one_lwp): Declare. (linux_resume_one_thread): Remove local variable 'step'. Lift code enqueue signal. Call proceed_one_lwp instead of linux_resume_one_lwp.
2016-07-21Use enqueue_pending_signal in linux_resume_one_threadYao Qi2-11/+14
gdb/gdbserver: 2016-07-21 Yao Qi <yao.qi@linaro.org> * linux-low.c (linux_resume_one_thread): Call enqueue_pending_signal.
2016-07-21Switch current_thread to lwp's thread in ↵Yao Qi4-2/+30
install_software_single_step_breakpoints install_software_single_step_breakpoints has parameter lwp, but still need to switch to current_thread. In order to simplify its caller, we do the current_thread save/restore inside install_software_single_step_breakpoints. gdb/gdbserver: 2016-07-21 Yao Qi <yao.qi@linaro.org> * gdbthread.h (make_cleanup_restore_current_thread): Declare. * inferiors.c (do_restore_current_thread_cleanup): New function. (make_cleanup_restore_current_thread): Likewise. * linux-low.c (install_software_single_step_breakpoints): Call make_cleanup_restore_current_thread. Switch current_thread to thread.
2016-07-21Make reinsert_breakpoint thread specificYao Qi4-55/+92
This patch makes reinsert_breakpoint thread specific, which means we insert and remove reinsert_breakpoint breakpoints for a specific thread. This motivation of this change is that I'll use reinsert_breakpoint for vCont;s on software single step target, so that GDBserver may insert one reinsert_breakpoint for one thread doing step-over, and insert one reinsert_breakpoint for another thread doing vCont;s. After the operation of one thread is finished, GDBserver must remove reinsert_breakpoint for that thread only. On the other hand, reinsert_breakpoint is used for step-over nowadays. GDBserver inserts reinsert_breakpoint, and wait only from the thread doing step-over. After the step-over is done, GDBserver removes the reinsert_breakpoint. If there is still any threads need step-over, do the same again until all threads are finished step-over. In other words, reinsert_breakpoint is globally thread specific, but in an implicit way. It is natural to make it explicitly thread specific. gdb/gdbserver: 2016-07-21 Yao Qi <yao.qi@linaro.org> * mem-break.c (struct reinsert_breakpoint) <ptid>: New field. (set_reinsert_breakpoint): New parameter ptid. Callers updated. (clone_one_breakpoint): Likewise. (delete_reinsert_breakpoints): Change parameter to thread. Callers updated. (has_reinsert_breakpoints): Likewise. (uninsert_reinsert_breakpoints): Likewise. (reinsert_reinsert_breakpoints): Likewise. * mem-break.h (set_reinsert_breakpoint): Update declaration. (delete_reinsert_breakpoints): Likewise. (reinsert_reinsert_breakpoints): Likewise. (uninsert_reinsert_breakpoints): Likewise. (has_reinsert_breakpoints): Likewise.
2016-07-21Refactor clone_all_breakpointsYao Qi6-16/+24
This patch is to change the interface of clone_all_breakpoints, from lists of breakpoints and raw_breakpoints to child thread and parent thread. I choose child thread to pass because we need the ptid of the child thread in the following patch. gdb/gdbserver: 2016-07-21 Yao Qi <yao.qi@linaro.org> * inferiors.c (get_thread_process): Make parameter const. * inferiors.h (get_thread_process): Update declaration. * mem-break.c (clone_all_breakpoints): Remove all parameters. Add new parameters child_thread and parent_thread. Callers updated. * mem-break.h (clone_all_breakpoints): Update declaration.
2016-07-21Create sub classes of 'struct breakpoint'Yao Qi4-67/+188
Nowadays, there are three types of breakpoint in GDBserver, - gdb breakpoints, - reinsert breakpoints, used for software single step, - other breakpoints, used for tracepoint, but we only have one 'struct breakpoint' for all of them. Some fields are only useful to one type of breakpoint. For example, cond_list and command_list are only used by gdb breakpoints, while handler is only used by other breakpoints. This patch changes 'struct breakpoint' to a base class, which has fields needed by all breakpoint types, also add three sub-classes to 'struct breakpoint' to these three types of breakpoints. gdb/gdbserver: 2016-07-21 Yao Qi <yao.qi@linaro.org> * mem-break.c (struct breakpoint) <cond_list>: Remove. <command_list, handler>: Remove. (struct gdb_breakpoint): New. (struct other_breakpoint): New. (struct reinsert_breakpoint): New. (is_gdb_breakpoint): New function. (any_persistent_commands): Update command_list if is_gdb_breakpoint returns true. (set_breakpoint): Create breakpoints according to their types. (find_gdb_breakpoint): Return 'struct gdb_breakpoint *'. (set_gdb_breakpoint_1): Likewise. (set_gdb_breakpoint): Likewise. (clear_breakpoint_conditions): Change parameter type to 'struct gdb_breakpoint *'. (clear_breakpoint_commands): Likewise. (clear_breakpoint_conditions_and_commands): Likewise. (add_condition_to_breakpoint): Likewise. (add_breakpoint_condition): Likewise. (add_commands_to_breakpoint): Likewise. (check_breakpoints): Check other_breakpoint. (clone_one_breakpoint): Clone breakpopint according to its type. * mem-break.h (struct gdb_breakpoint): Declare. (set_gdb_breakpoint): Update declaration. (clear_breakpoint_conditions_and_commands): Likewise. (add_breakpoint_condition): Likewise. (add_breakpoint_commands): Likewise. * server.c (process_point_options): Change parameter type to 'struct gdb_breakpoint *'.
2016-07-21Pass breakpoint type in set_breakpoint_atYao Qi3-7/+24
Nowadays, set_breakpoint_at creates breakpoint of type other_breakpoint, but we also use set_breakpoint_at in set_reinsert_breakpoint to create breakpoint, so that we have to overwrite the breakpoint type like this, bp = set_breakpoint_at (stop_at, NULL); bp->type = reinsert_breakpoint; which looks not very good. This patch changes set_breakpoint_at to receive breakpoint type. Since set_breakpoint_at is used in many places, I rename it to set_breakpoint_type_at, and wrap it with set_breakpoint_at, and pass other_breakpoint. In this way, we can call set_breakpoint_type_at with reinsert_breakpoint in set_reinsert_breakpoint too, and code looks cleaner. gdb/gdbserver: 2016-07-21 Yao Qi <yao.qi@linaro.org> * mem-break.c (set_breakpoint_at): Rename it to ... (set_breakpoint_type_at): ... it. (set_breakpoint_at): Call set_breakpoint_type_at. (set_reinsert_breakpoint): Call set_breakpoint_type_at. * mem-break.h (set_breakpoint_at): Update comments.
2016-07-21Skip gdb.server/ tests if lack of XML supportYao Qi2-0/+19
I recently see some gdb.server/*.exp fails in my native gdb testing, in which libexpat isn't available, so GDB isn't able to parse xml file. It causes gdb.server/ tests fails because GDB can't get registers correctly from GDBserver. (gdb) PASS: gdb.server/connect-without-multi-process.exp: multiprocess=off: break main target remote localhost:2352^M Remote debugging using localhost:2352^M warning: Can not parse XML target description; XML support was disabled at compile time^M Reading /lib/ld-linux-armhf.so.3 from remote target...^M warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.^M Reading /lib/ld-linux-armhf.so.3 from remote target...^M Reading symbols from target:/lib/ld-linux-armhf.so.3...Reading /lib/ld-2.17.so.debug from remote target...^M Reading /lib/.debug/ld-2.17.so.debug from remote target...^M (no debugging symbols found)...done.^M Remote 'g' packet reply is too long: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000efffbe00000000808d0f4d100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000^ 0x4d0f8d80 in _start () from target:/lib/ld-linux-armhf.so.3^M Without XML support in GDB, it can't parse xml sent by GDBserver, and has to fall back to the oldest arch. However, GDBserver doesn't know this (IMO, this is a defect in RSP), and still choose the right target description to create regcache and 'g' packet. If the port only has one target description or coincidentally two sides choose the same target description, there is no such issue. Otherwise, GDB is broken on read registers. This patch is to skip gdbserver tests if XML is not support and the target has multiple target descriptions. gdb/testsuite: 2016-07-21 Yao Qi <yao.qi@linaro.org> * lib/gdbserver-support.exp (skip_gdbserver_tests): Return 1 if gdb_skip_xml_test is true on some targets.
2016-07-21Fix typo fsqrt -> sqrtf.Nick Clifton1-1/+1
2016-07-21oops - forgot to include binutils.texi in the previous delta.Nick Clifton1-29/+8
2016-07-21Use fsqrt() to calculate float (rather than double) square root.Nick Clifton2-1/+5
* simulator.c (fsqrts): Use fsqrt rather than sqrt.
2016-07-21Fix fail in gdb.server/solib-list.expYao Qi2-0/+9
If I run single test solib-list.exp, it is OK. If I run two, as below, there are fails, $ make check RUNTESTFLAGS="server-run.exp solib-list.exp" FAIL: gdb.server/solib-list.exp: non-stop 0: continue (the program exited) FAIL: gdb.server/solib-list.exp: non-stop 0: p libvar FAIL: gdb.server/solib-list.exp: non-stop 1: continue (the program exited) FAIL: gdb.server/solib-list.exp: non-stop 1: p libvar in gdb.log, /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/../../gdb/gdbserver/gdbserver --once :2347 /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.server/server-run/server-run /lib64/ld-linux-x86-64.so.2 /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.server/solib-list/solib-list server-run is spawned, which is wrong. If I only run solib-list.exp, ld-linux is spawned, which is right. /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/../../gdb/gdbserver/gdbserver --once :2346 /lib64/ld-linux-x86-64.so.2 /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.server/solib-list/solib-list in test, we spawn gdbserver this way, # Note we pass ${interp_system}, the program gdbserver spawns, as # argument here, instead of using gdb_load, because we don't want # to download the interpreter to the target (it's already there) # or to the test output directory. set res [gdbserver_spawn "${interp_system} ${remote_binfile}"] in gdbserver_spawn -> gdbserver_download_current_prog, if last_loaded_file is set (when you run multiple tests), it is returned. This patch is to unset last_loaded_file in solib-list.exp. gdb/testsuite: 2016-07-21 Yao Qi <yao.qi@linaro.org> * gdb.server/solib-list.exp: Unset last_loaded_file.
2016-07-21Use variable args in run_ld_link_exec_testsAlan Modra19-37/+61
If the last parameter of a tcl function is "args" then it can take zero or more arguments. Make use of this language feature in run_ld_link_exec_tests. * testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Replace "targets_to_xfail" parameter with "args". * testsuite/ld-elf/compress.exp: Remove empty list of xfails on all calls to run_ld_link_exec_tests. * testsuite/ld-elf/dwarf.exp: Likewise. * testsuite/ld-elf/indirect.exp: Likewise. * testsuite/ld-elf/wrap.exp: Likewise. * testsuite/ld-i386/i386.exp: Likewise. * testsuite/ld-i386/no-plt.exp: Likewise. * testsuite/ld-i386/tls.exp: Likewise. * testsuite/ld-ifunc/ifunc.exp: Likewise. * testsuite/ld-pie/pie.exp: Likewise. * testsuite/ld-plugin/lto.exp: Likewise. * testsuite/ld-size/size.exp: Likewise. * testsuite/ld-x86-64/mpx.exp: Likewise. * testsuite/ld-x86-64/no-plt.exp: Likewise. * testsuite/ld-x86-64/tls.exp: Likewise. * testsuite/ld-x86-64/x86-64.exp: Likewise. * testsuite/ld-elf/elf.exp: Likewise. Reorder args when providing xfails and simplify lists. * testsuite/ld-elf/shared.exp: Likewise.
2016-07-21Fix implib test failuresAlan Modra9-25/+72
bfd/ * elf.c (_bfd_elf_filter_global_symbols): Skip local symbols. (swap_out_syms): Return an error when not finding ELF output section rather than asserting. * elflink.c (elf_output_implib): Call bfd_set_error on no symbols. ld/ * testsuite/lib/ld-lib.exp (run_ld_link_tests): Add optional parameter to pass list of xfails. * testsuite/ld-elf/elf.exp: Add xfails for implib tests. Tidy implib test formatting. Don't set .data start address. * testsuite/ld-elf/implib.s: Remove first .bss directive and replace second one with equivalent .section directive. * testsuite/ld-elf/empty-implib.out: Add expected final error. * testsuite/ld-elf/implib.rd: Update.
2016-07-21Automatic date update in version.inGDB Administrator1-1/+1
2016-07-20Use a real vfork done event on FreeBSD when available.John Baldwin2-3/+45
FreeBSD 12 recently added a new ptrace event to indicate when the vfork parent resumes after the child process stops sharing the address space. Use this event to report a proper TARGET_WAITKIND_VFORK_DONE rather than faking a vfork done event after a delay. gdb/ChangeLog: * fbsd-nat.c (fbsd_enable_proc_events): Enable "PTRACE_VFORK" events. (fbsd_pending_vfork_done): Only define if "PTRACE_VFORK" is not defined. (fbsd_add_vfork_done): Likewise. (fbsd_is_vfork_done_pending): Likewise. (fbsd_next_vfork_done): Likewise. (fbsd_resume): Only ignore pending vfork done events if "PTRACE_VFORK" is not defined. (fbsd_wait): Only look for pending vfork done events if "PTRACE_VFORK" is not defined. [PTRACE_VFORK]: Handle "PL_FLAG_VFORKED" and "PL_FLAG_VFORK_DONE" events. (fbsd_follow_fork): Only fake a vfork done event if "PTRACE_VFORK" is not defined.
2016-07-20Enable ptrace events on new child processes.John Baldwin2-0/+8
New child processes on FreeBSD do not inherit optional ptrace events such as fork and LWP events from the parent process. Instead, explicitly enable events on new children when reporting a fork event. gdb/ChangeLog: * fbsd-nat.c (fbsd_wait): Use "fbsd_enable_proc_events" on new child processes.
2016-07-20Consolidate code to enable optional FreeBSD native target event reporting.John Baldwin2-31/+36
Add a new function to enable optional event reporting for FreeBSD native targets. Specifically, use this to enable fork and LWP events. The bodies of fbsd_enable_follow_fork and fbsd_enable_lwp_events have been subsumed into the new function. In addition, use the PT_GET_EVENT_MASK and PT_EVENT_SET_MASK requests added in FreeBSD 12 when present to enable these events. gdb/ChangeLog: * fbsd-nat.c (fbsd_enable_lwp_events): Remove function. (fbsd_enable_proc_events): New function. (fbsd_enable_follow_fork): Remove function. (fbsd_post_startup_inferior): Use "fbsd_enable_proc_events". (fbsd_post_attach): Likewise.
2016-07-20Add support to the ARC disassembler for selecting instruction classes.Claudiu Zissulescu19-131/+723
gas * testsuite/gas/arc/dsp.d: New file. * testsuite/gas/arc/dsp.s: Likewise. * testsuite/gas/arc/fpu.d: Likewise. * testsuite/gas/arc/fpu.s: Likewise. * testsuite/gas/arc/ext2op.d: Add specific disassembler option. * testsuite/gas/arc/ext3op.d: Likewise. * testsuite/gas/arc/tdpfp.d: Likewise. * testsuite/gas/arc/tfpuda.d: Likewise. opcodes * arc-dis.c (skipclass): New structure. (decodelist): New variable. (is_compatible_p): New function. (new_element): Likewise. (skip_class_p): Likewise. (find_format_from_table): Use skip_class_p function. (find_format): Decode first the extension instructions. (print_insn_arc): Select either ARCEM or ARCHS based on elf e_flags. (parse_option): New function. (parse_disassembler_options): Likewise. (print_arc_disassembler_options): Likewise. (print_insn_arc): Use parse_disassembler_options function. Proper select ARCv2 cpu variant. * disassemble.c (disassembler_usage): Add ARC disassembler options. binutils* doc/binutils.texi (objdump): Add ARC disassembler options. * testsuite/binutils-all/arc/dsp.s: New file. * testsuite/binutils-all/arc/objdump.exp: Likewise. include * dis-asm.h: Declare print_arc_disassembler_options.
2016-07-20Handle version 1a of FreeBSD's NT_PRSINFO.John Baldwin2-9/+34
Version 1a adds a pr_pid member containing the process ID of the terminating process. The presence of pr_pid is inferred from the note's size. bfd/ChangeLog: * elf.c (elfcore_grok_freebsd_psinfo): Check for minimum note size and handle pr_pid if present.
2016-07-20Check p_paddr for program header spaceH.J. Lu2-1/+9
Issue an error if p_paddr becomes invalid when allocating space for program headers. PR ld/20376 * elf.c (assign_file_positions_for_load_sections): Also check p_paddr for program header space.
2016-07-20testsuite: Fix gdb.gdb/selftest.exp for C++-O2-g-built GDBJan Kratochvil2-0/+13
tested on Fedora 24 x86_64 after: ./configure; make That is: CFLAGS='-g -O2' CXXFLAGS='-g -O2' FAIL: gdb.gdb/selftest.exp: unknown source line FAIL: gdb.gdb/selftest.exp: step into xmalloc call gdb/testsuite/ChangeLog 2016-07-20 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.gdb/selftest.exp (do_steps_and_nexts): Add "next over TRY" and "step into captured_main (args)".
2016-07-20testsuite: Fix gdb.btrace/tailcall-only.exp errors on x86_64-m32Jan Kratochvil2-2/+6
$ runtest 'CC_FOR_TARGET=gcc -m32' gdb.btrace/tailcall-only.exp Running ./gdb.btrace/tailcall-only.exp ... gdb compile failed, tailcall-only.c: Assembler messages: tailcall-only.c:142: Error: cannot represent relocation type BFD_RELOC_64 [...] tailcall-only.c:425: Error: cannot represent relocation type BFD_RELOC_64 It works for the other x86 arch combinations: On Mon, 11 Apr 2016 08:44:23 +0200, Metzger, Markus T wrote: I'm setting the target triplet to "i686-unknown-linux" in my m32 configuration. Like this: set target_triplet "i686-unknown-linux" set_board_info cflags "-m32" set_board_info cppflags "-m32" On Wed, 20 Jul 2016 16:02:20 +0200, Pedro Alves wrote: There's no reason you should _not_ set it. But, multilib-style testing with --target_board=unix\{-m64,-m32\} etc. should work _too_, IMO. gdb/testsuite/ChangeLog 2016-07-20 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.btrace/tailcall-only.exp: Use is_lp64_target check.
2016-07-20testsuite patch: Skip py-unwind.exp on x86_64 -m32Jan Kratochvil2-1/+5
(gdb) source /home/jkratoch/redhat/gdb-clean/gdb/testsuite/outputs/gdb.python/py-unwind/py-unwind.py^M Python script imported^M Python Exception <type 'exceptions.ValueError'> Bad register: ^M (gdb) FAIL: gdb.python/py-unwind.exp: import python scripts class TestUnwinder(Unwinder): AMD64_RBP = 6 AMD64_RSP = 7 AMD64_RIP = 16 On Tue, 19 Jul 2016 12:06:09 +0200, Yao Qi wrote: py-unwind.exp does nothing on arch specific thing, so py-unwind.exp shouldn't be aware of the arch difference, but py-unwind.py should. On Tue, 19 Jul 2016 20:04:33 +0200, Pedro Alves wrote: How about we handle this in the .exp file for now and leave something more complicated for when the test is first ported to some other arch. WDYT? gdb/testsuite/ChangeLog 2016-07-20 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.python/py-unwind.exp: Test also ![is_lp64_target].
2016-07-20MIPS/GAS: Remove erroneous ELF relocation referencesMaciej W. Rozycki2-7/+10
Remove R_MIPS_PC26_S2 and R_MIPS_PC21_S2 relocation references that went into `mips_force_relocation' with commit 9d862524f6ae ("MIPS: Verify the ISA mode and alignment of branch and jump targets") by mistake. Their BFD_RELOC_MIPS_26_PCREL_S2 and BFD_RELOC_MIPS_21_PCREL_S2 equivalents are already handled there. gas/ * config/tc-mips.c (mips_force_relocation): Remove R_MIPS_PC26_S2 and R_MIPS_PC21_S2.
2016-07-20Update documentation to reflect that the symbol localization options of ↵Nick Clifton2-2/+8
objcopy do not affect unique symbols. * doc/binutils.texi (objcopy): Note that the localize symbol options do not affect unique symbols.
2016-07-20Enable the configuration of GDB for the NDS32 target.Yan-Ting Lin3-6/+5
* configure.ac (nds32*-*-*): Remove entry to enable gdb. * configure: Regenerated.
2016-07-20Early expression evaluationAlan Modra3-55/+37
Folding a constant expression early can lead to loss of tokens, eg. ABSOLUTE, that are significant in ld's horrible context sensitive expression evaluation. Also, MAXPAGESIZE and other "constants" may not have taken values specified on the command line, leading to the wrong value being cached. * ldexp.c (exp_unop, exp_binop, exp_trinop, exp_nameop): Don't fold expression. * testsuite/ld-elf/maxpage3b.d: Expect correct maxpagesize.
2016-07-20Mark some more powerpc relocs as not handled by generic linkerAlan Modra3-68/+74
* elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_PLTREL32>): Put ppc64_elf_unhandled_reloc for special_function. * elf32-ppc.c (ppc_elf_howto_raw): Similarly for lots of relocs.
2016-07-20Automatic date update in version.inGDB Administrator1-1/+1
2016-07-19Support -pie for aarch64*-elf targets.Roland McGrath3-1/+10
ld/ * emulparams/aarch64elf.sh (GENERATE_PIE_SCRIPT): Set to yes. * emulparams/aarch64elf32.sh: Likewise.
2016-07-19Build gdb.opt/inline-*.exp tests at -O0, rely on __attribute__((always_inline))Pedro Alves6-5/+21
A test recently added to gdb.opt/inline-cmds.exp fails for arm-none-eabi targets because -O2 leads to instructions to be reordered widely. I guess it might have made sense years ago to enable optimization in these tests, but I fail to see the need for that nowadays. Using -O0 while relying on __attribute__((always_inline)), which is already used in the tests [1] [2], avoids this sort of trouble, while still exercising the inlining-related use cases that are the focus of these tests. I think that nowadays we can safely assume that all compilers we care about support __attribute__((always_inline)) or similar. [1] - Except one spot that missed it. [2] - Note that the .exp files make sure the frames that should have been inlined are indeed inlined, with "info frame". gdb/testsuite/ChangeLog: 2016-07-19 Pedro Alves <palves@redhat.com> * gdb.opt/inline-break.exp: Remove optimize=-O2. * gdb.opt/inline-bt.exp: Likewise. * gdb.opt/inline-cmds.exp: Remove optimize=-O2 and add additional_flags=-Winline. * gdb.opt/inline-locals.exp: Likewise. * gdb.opt/inline-markers.c (ATTR): Define. (inlined_fn): Use it.
2016-07-19MIPS: Convert cross-mode BAL to JALXMaciej W. Rozycki38-128/+600
Convert cross-mode regular MIPS and microMIPS BAL instructions to JALX, similarly to how JAL instructions are converted. bfd/ * elfxx-mips.c (mips_elf_perform_relocation): Convert cross-mode BAL to JALX. (_bfd_mips_elf_relocate_section) <bfd_reloc_outofrange>: Add a corresponding error message. gas/ * config/tc-mips.c (mips_force_relocation, mips_fix_adjustable): Adjust comments for BAL to JALX linker conversion. (fix_bad_cross_mode_branch_p): Accept cross-mode BAL. * testsuite/gas/mips/unaligned-branch-1.l: Update error messages expected. * testsuite/gas/mips/unaligned-branch-micromips-1.l: Likewise. * testsuite/gas/mips/branch-local-4.d: New test. * testsuite/gas/mips/branch-local-n32-4.d: New test. * testsuite/gas/mips/branch-local-n64-4.d: New test. * testsuite/gas/mips/branch-addend.d: New test. * testsuite/gas/mips/branch-addend-n32.d: New test. * testsuite/gas/mips/branch-addend-n64.d: New test. * testsuite/gas/mips/branch-local-4.s: New test source. * testsuite/gas/mips/branch-addend.s: New test source. * testsuite/gas/mips/mips.exp: Run the new tests. ld/ * testsuite/ld-mips-elf/unaligned-branch-2.d: Update error messages expected. * testsuite/ld-mips-elf/unaligned-branch-r6-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-mips16.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-micromips.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-addend.d: New test. * testsuite/ld-mips-elf/bal-jalx-local.d: New test. * testsuite/ld-mips-elf/bal-jalx-pic.d: New test. * testsuite/ld-mips-elf/bal-jalx-addend-n32.d: New test. * testsuite/ld-mips-elf/bal-jalx-local-n32.d: New test. * testsuite/ld-mips-elf/bal-jalx-pic-n32.d: New test. * testsuite/ld-mips-elf/bal-jalx-addend-n64.d: New test. * testsuite/ld-mips-elf/bal-jalx-local-n64.d: New test. * testsuite/ld-mips-elf/bal-jalx-pic-n64.d: New test. * testsuite/ld-mips-elf/unaligned-jalx-2.d: New test. * testsuite/ld-mips-elf/unaligned-jalx-3.d: New test. * testsuite/ld-mips-elf/unaligned-jalx-addend-2.d: New test. * testsuite/ld-mips-elf/unaligned-jalx-addend-3.d: New test. * testsuite/ld-mips-elf/unaligned-jalx-2.s: New test source. * testsuite/ld-mips-elf/unaligned-jalx-3.s: New test source. * testsuite/ld-mips-elf/unaligned-jalx-addend-2.s: New test source. * testsuite/ld-mips-elf/unaligned-jalx-addend-3.s: New test source. * testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
2016-07-19MIPS: Verify the ISA mode and alignment of branch and jump targetsMaciej W. Rozycki90-113/+5968
Verify that the ISA mode of branch targets is the same as the referring relocation, so that an attempt to produce a branch between instructions encoded in different ISA modes each causes an error rather than silently producing non-functional code. Make sure that no symbol or addend bits are silently truncated: terminate with an error if the relocation value calculated cannot be encoded in the relocatable field of a branch; for REL targets also applying to any intermediate addend. Also make jump target's alignment verification consistent with that for branches. This change will require an update to some obscure handcoded assembly sources which make branches to labels placed at data objects, however for microMIPS code only. These labels will have to be updated with the `.insn' directive for containing code to assemble and link successfully. Such code is broken as any such labels have always been required by the microMIPS architecture specification[1][2] to be annotated this way for correct interpretation, and with our old code missing `.insn' directives caused labels to present different semantics depending on whether they were referred with branch (ISA bit ignored) or other relocations (ISA bit respected). Enforcing these checks however will ensure errors in building software, like mixed regular MIPS and microMIPS code links with branches between, will be diagnosed at the build time rather than causing odd run-time errors such as intermittent crashes. It will also let cross-mode BAL instructions be converted to JALX instructions, with a separate change. References: [1] "MIPS Architecture for Programmers, Volume II-B: The microMIPS32 Instruction Set", MIPS Technologies, Inc., Document Number: MD00582, Revision 5.04, January 15, 2014, Section 7.1 "Assembly-Level Compatibility", p. 533 [2] "MIPS Architecture for Programmers, Volume II-B: The microMIPS64 Instruction Set", MIPS Technologies, Inc., Document Number: MD00594, Revision 5.04, January 15, 2014, Section 8.1 "Assembly-Level Compatibility", p. 623 bfd/ * elfxx-mips.c (b_reloc_p): Add R_MICROMIPS_PC16_S1, R_MICROMIPS_PC10_S1 and R_MICROMIPS_PC7_S1. (branch_reloc_p): New function. (mips_elf_calculate_relocation): Handle ISA mode determination for relocations against section symbols, against absolute symbols and absolute relocations. Also set `*cross_mode_jump_p' for branches. <R_MIPS16_26, R_MIPS_26, R_MICROMIPS_26_S1>: Suppress alignment checks for weak undefined symbols. Also check target alignment within the same ISA mode. <R_MIPS_PC16, R_MIPS_GNU_REL16_S2>: Handle cross-mode branches in the alignment check. <R_MICROMIPS_PC7_S1>: Add an alignment check. <R_MICROMIPS_PC10_S1>: Likewise. <R_MICROMIPS_PC16_S1>: Likewise. (mips_elf_perform_relocation): Report a failure for unsupported same-mode JALX instructions and cross-mode branches. (_bfd_mips_elf_relocate_section) <bfd_reloc_outofrange>: Add error messages for jumps to misaligned addresses. gas/ * config/tc-mips.c (mips_force_relocation): Also retain branch relocations against MIPS16 and microMIPS symbols. (fix_bad_cross_mode_jump_p): New function. (fix_bad_same_mode_jalx_p): Likewise. (fix_bad_misaligned_jump_p): Likewise. (fix_bad_cross_mode_branch_p): Likewise. (fix_bad_misaligned_branch_p): Likewise. (fix_validate_branch): Likewise. (md_apply_fix) <BFD_RELOC_MIPS_JMP, BFD_RELOC_MIPS16_JMP> <BFD_RELOC_MICROMIPS_JMP>: Separate from BFD_RELOC_MIPS_SHIFT5, etc. Verify the ISA mode and alignment of the jump target. <BFD_RELOC_MIPS_21_PCREL_S2>: Replace the inline alignment check with a call to `fix_validate_branch'. <BFD_RELOC_MIPS_26_PCREL_S2>: Likewise. <BFD_RELOC_16_PCREL_S2>: Likewise. <BFD_RELOC_MICROMIPS_7_PCREL_S1, BFD_RELOC_MICROMIPS_10_PCREL_S1> <BFD_RELOC_MICROMIPS_16_PCREL_S1>: Retain the original addend. Verify the ISA mode and alignment of the branch target. (md_convert_frag): Verify the ISA mode and alignment of resolved MIPS16 branch targets. * testsuite/gas/mips/branch-misc-1.s: Annotate non-instruction branch targets with `.insn'. * testsuite/gas/mips/branch-misc-5.s: Likewise. * testsuite/gas/mips/micromips@branch-misc-5-64.d: Update accordingly. * testsuite/gas/mips/micromips@branch-misc-5pic-64.d: Likewise. * testsuite/gas/mips/micromips-branch-relax.s: Annotate non-instruction branch target with `.insn'. * testsuite/gas/mips/micromips.s: Replace microMIPS JALX targets with external symbols. * testsuite/gas/mips/micromips-insn32.d: Update accordingly. * testsuite/gas/mips/micromips-noinsn32.d: Likewise. * testsuite/gas/mips/micromips-trap.d: Likewise. * testsuite/gas/mips/micromips.d: Likewise. * testsuite/gas/mips/mips16.s: Annotate non-instruction branch targets with `.insn'. * testsuite/gas/mips/mips16.d: Update accordingly. * testsuite/gas/mips/mips16-64.d: Likewise. * testsuite/gas/mips/mips16-dwarf2.s: Annotate non-instruction branch target with `.insn'. * testsuite/gas/mips/relax-swap3.s: Likewise. * testsuite/gas/mips/branch-local-2.l: New list test. * testsuite/gas/mips/branch-local-3.l: New list test. * testsuite/gas/mips/branch-local-n32-2.l: New list test. * testsuite/gas/mips/branch-local-n32-3.l: New list test. * testsuite/gas/mips/branch-local-n64-2.l: New list test. * testsuite/gas/mips/branch-local-n64-3.l: New list test. * testsuite/gas/mips/unaligned-jump-1.l: New list test. * testsuite/gas/mips/unaligned-jump-2.l: New list test. * testsuite/gas/mips/unaligned-jump-3.d: New test. * testsuite/gas/mips/unaligned-jump-mips16-1.l: New list test. * testsuite/gas/mips/unaligned-jump-mips16-2.l: New list test. * testsuite/gas/mips/unaligned-jump-mips16-3.d: New test. * testsuite/gas/mips/unaligned-jump-micromips-1.l: New list test. * testsuite/gas/mips/unaligned-jump-micromips-2.l: New list test. * testsuite/gas/mips/unaligned-jump-micromips-3.d: New test. * testsuite/gas/mips/unaligned-branch-1.l: New list test. * testsuite/gas/mips/unaligned-branch-2.l: New list test. * testsuite/gas/mips/unaligned-branch-3.d: New test. * testsuite/gas/mips/unaligned-branch-r6-1.l: New list test. * testsuite/gas/mips/unaligned-branch-r6-2.l: New list test. * testsuite/gas/mips/unaligned-branch-r6-3.l: New list test. * testsuite/gas/mips/unaligned-branch-r6-4.l: New list test. * testsuite/gas/mips/unaligned-branch-r6-5.d: New test. * testsuite/gas/mips/unaligned-branch-r6-6.d: New test. * testsuite/gas/mips/unaligned-branch-mips16-1.l: New list test. * testsuite/gas/mips/unaligned-branch-mips16-2.l: New list test. * testsuite/gas/mips/unaligned-branch-mips16-3.d: New test. * testsuite/gas/mips/unaligned-branch-micromips-1.l: New list test. * testsuite/gas/mips/unaligned-branch-micromips-2.l: New list test. * testsuite/gas/mips/unaligned-branch-micromips-3.d: New test. * testsuite/gas/mips/branch-local-2.s: New test source. * testsuite/gas/mips/branch-local-3.s: New test source. * testsuite/gas/mips/branch-local-n32-2.s: New test source. * testsuite/gas/mips/branch-local-n32-3.s: New test source. * testsuite/gas/mips/branch-local-n64-2.s: New test source. * testsuite/gas/mips/branch-local-n64-3.s: New test source. * testsuite/gas/mips/unaligned-jump-1.s: New test source. * testsuite/gas/mips/unaligned-jump-2.s: New test source. * testsuite/gas/mips/unaligned-jump-mips16-1.s: New test source. * testsuite/gas/mips/unaligned-jump-mips16-2.s: New test source. * testsuite/gas/mips/unaligned-jump-micromips-1.s: New test source. * testsuite/gas/mips/unaligned-jump-micromips-2.s: New test source. * testsuite/gas/mips/unaligned-branch-1.s: New test source. * testsuite/gas/mips/unaligned-branch-2.s: New test source. * testsuite/gas/mips/unaligned-branch-r6-1.s: New test source. * testsuite/gas/mips/unaligned-branch-r6-2.s: New test source. * testsuite/gas/mips/unaligned-branch-r6-3.s: New test source. * testsuite/gas/mips/unaligned-branch-r6-4.s: New test source. * testsuite/gas/mips/unaligned-branch-mips16-1.s: New test source. * testsuite/gas/mips/unaligned-branch-mips16-2.s: New test source. * testsuite/gas/mips/unaligned-branch-micromips-1.s: New test source. * testsuite/gas/mips/unaligned-branch-micromips-2.s: New test source. * testsuite/gas/mips/mips.exp: Run the new tests. ld/ * testsuite/ld-mips-elf/unaligned-jalx-1.d: Update error message expected. * testsuite/ld-mips-elf/unaligned-jalx-addend-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-mips16-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-micromips-1.d: Likewise. * testsuite/ld-mips-elf/undefweak-overflow.s: Add jumps, microMIPS BAL and MIPS16 instructions. * testsuite/ld-mips-elf/undefweak-overflow.d: Update accordingly. * testsuite/ld-mips-elf/unaligned-branch-2.d: New test. * testsuite/ld-mips-elf/unaligned-branch-r6-1.d: New test. * testsuite/ld-mips-elf/unaligned-branch-r6-2.d: New test. * testsuite/ld-mips-elf/unaligned-branch-mips16.d: New test. * testsuite/ld-mips-elf/unaligned-branch-micromips.d: New test. * testsuite/ld-mips-elf/unaligned-jump-mips16.d: New test. * testsuite/ld-mips-elf/unaligned-jump-micromips.d: New test. * testsuite/ld-mips-elf/unaligned-jump.d: New test. * testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
2016-07-19make the type of nds32_pseudo_opcode::pseudo_val unsignedTrevor Saunders2-32/+97
It can be initialized with values greater than 0x80000000, which don't fit in a signed int. Further it appears to be used as a set of bit flags where unsigned int is more typical. gas/ChangeLog: 2016-07-19 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> * config/tc-nds32.c (struct nds32_pseudo_opcode): Make pseudo_val unsigned int. (do_pseudo_b): Adjust. (do_pseudo_bal): Likewise. (do_pseudo_bge): Likewise. (do_pseudo_bges): Likewise. (do_pseudo_bgt): Likewise. (do_pseudo_bgts): Likewise. (do_pseudo_ble): Likewise. (do_pseudo_bles): Likewise. (do_pseudo_blt): Likewise. (do_pseudo_blts): Likewise. (do_pseudo_br): Likewise. (do_pseudo_bral): Likewise. (do_pseudo_la): Likewise. (do_pseudo_li): Likewise. (do_pseudo_ls_bhw): Likewise. (do_pseudo_ls_bhwp): Likewise. (do_pseudo_ls_bhwpc): Likewise. (do_pseudo_ls_bhwi): Likewise. (do_pseudo_move): Likewise. (do_pseudo_neg): Likewise. (do_pseudo_not): Likewise. (do_pseudo_pushpopm): Likewise. (do_pseudo_pushpop): Likewise. (do_pseudo_v3push): Likewise. (do_pseudo_v3pop): Likewise. (do_pseudo_pushpop_stack): Likewise. (do_pseudo_push_bhwd): Likewise. (do_pseudo_pop_bhwd): Likewise. (do_pseudo_pusha): Likewise. (do_pseudo_pushi): Likewise.
2016-07-19sparc: make a field type bfd_reloc_code_real_typeTrevor Saunders2-1/+6
gas/ChangeLog: 2016-07-19 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> * config/tc-sparc.c (struct pop_entry): Make the type of reloc bfd_reloc_code_real_type.
2016-07-19sparc: remove a sentinalTrevor Saunders2-16/+17
gas/ChangeLog: 2016-07-19 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> * config/tc-sparc.c (pop_table): Remove sentinel. (NUM_PERC_ENTRIES): Use ARRAY_SIZE on pop_table. (md_begin): Adjust.
2016-07-19tc-z8k.c: make some argument types bfd_reloc_code_real_typeTrevor Saunders2-3/+14
gas/ChangeLog: 2016-07-19 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> * config/tc-z8k.c (newfix): Make type of type argument bfd_reloc_code_real_type. (apply_fix): Likewise.
2016-07-19Use do_self_tests in selftest.expYao Qi2-105/+9
This patch uses do_self_tests to simplify selftest.exp. It doesn't change the tests except the order, -PASS: gdb.gdb/selftest.exp: Disassemble main PASS: gdb.gdb/selftest.exp: breakpoint in captured_main +PASS: gdb.gdb/selftest.exp: run until breakpoint at captured_main +PASS: gdb.gdb/selftest.exp: Disassemble main PASS: gdb.gdb/selftest.exp: set interrupt character in test_with_self PASS: gdb.gdb/selftest.exp: set listsize to 1 -PASS: gdb.gdb/selftest.exp: run until breakpoint at captured_main gdb/testsuite: 2016-07-19 Yao Qi <yao.qi@linaro.org> * gdb.gdb/selftest.exp: Remove checks on is_remote and isnative. (test_with_self): Remove some code. Remove argument executable. (top-level): Use do_self_tests.
2016-07-19ld: Restore file offset after a plugin fails to claim a fileAndrew Burgess5-1/+90
When using the plugin interface to claim an input file the claim method from (possible) many plugins can be called on an input file. If these claim methods read content from the input file then the file offset stored in the underlying file descriptor will change. As we share a file descriptor between the plugin interface (created with dup in ld/plugin.c:plugin_object_p) and the input bfd object, then any changes to the file offset in the file descriptor will effect the bfd object. Also, as the changes to the file offset did not originate from calls through the bfd interface, but instead came from the plugin directly, then the bfd will not be aware that the file offset has changed. This is a problem as the bfd library caches the file offset. If the plugin decides not to claim an input file then, currently, we leave the bfd in a state where the actual file offset is out of sync with the cached file offset. This problem came to light after a recent commit 7d0b9ebc1e0079271a7c7737b53bc026525eab64 (Don't include libbfd.h outside of bfd, part 6) however, I don't believe that commit actual introduces the bug, it just exposed the existing issue. This commit solves the problem by backing up and restoring the file offset for the file descriptor of the input file. The restore is only done if the plugin does not claim the input file, as it is in this case that the bfd library might be used again to try and identify the unclaimed file. ld/ChangeLog: * plugin.c (plugin_call_claim_file): Restore the file offset after an unsuccessful attempt to claim a file. * testplug.c (bytes_to_read_before_claim): New global. (record_read_length): New function, sets new global bytes_to_read_before_claim. (parse_option): Handle 'read:<NUMBER>' option. (onclaim_file): Read file content before checking for claim. * testsuite/ld-plugin/plugin-30.d: New file. * testsuite/ld-plugin/plugin.exp: Add new test.
2016-07-19 Update PC when simulate break instruction.Denis Chertykov2-2/+8
PR target/ 19401 * avr/interp.c (step_once): Pass break instruction address to sim_engine_halt function which writes that to PC. Remove code that follows that function call as it is unreachable.
2016-07-19Automatic date update in version.inGDB Administrator1-1/+1
2016-07-18Automatic date update in version.inGDB Administrator1-1/+1
2016-07-17Automatic date update in version.inGDB Administrator1-1/+1