aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-01-18Fix PR threads/19422 - show which thread caused stopPedro Alves29-47/+191
This commit changes GDB like this: - Program received signal SIGINT, Interrupt. + Thread 1 "main" received signal SIGINT, Interrupt. - Breakpoint 1 at 0x40087a: file threads.c, line 87. + Thread 3 "bar" hit Breakpoint 1 at 0x40087a: file threads.c, line 87. ... once the program goes multi-threaded. Until GDB sees a second thread spawn, the output is still the same as before, per the discussion back in 2012: https://www.sourceware.org/ml/gdb/2012-11/msg00010.html This helps non-stop mode, where you can't easily tell which thread hit a breakpoint or received a signal: (gdb) info threads Id Target Id Frame * 1 Thread 0x7ffff7fc1740 (LWP 19362) "main" (running) 2 Thread 0x7ffff7fc0700 (LWP 19366) "foo" (running) 3 Thread 0x7ffff77bf700 (LWP 19367) "bar" (running) (gdb) Program received signal SIGUSR1, User defined signal 1. 0x0000003616a09237 in pthread_join (threadid=140737353877248, thread_return=0x7fffffffd5b8) at pthread_join.c:92 92 lll_wait_tid (pd->tid); (gdb) b threads.c:87 Breakpoint 1 at 0x40087a: file threads.c, line 87. (gdb) Breakpoint 1, thread_function1 (arg=0x1) at threads.c:87 87 usleep (1); /* Loop increment. */ The best the user can do is run "info threads" and try to figure things out. It actually also affects all-stop mode, in case of "handle SIG print nostop": ... Program received signal SIGUSR1, User defined signal 1. Program received signal SIGUSR1, User defined signal 1. Program received signal SIGUSR1, User defined signal 1. Program received signal SIGUSR1, User defined signal 1. ... The above doesn't give any clue that these were different threads getting the SIGUSR1 signal. I initially thought of lowercasing "breakpoint" in "Thread 3 hit Breakpoint 1" but then after trying it I realized that leaving "Breakpoint" uppercase helps the eye quickly find the relevant information. It's also easier to implement not showing anything about threads until the program goes multi-threaded this way. Here's a larger example session in non-stop mode: (gdb) c -a& Continuing. (gdb) interrupt -a (gdb) Thread 1 "main" stopped. 0x0000003616a09237 in pthread_join (threadid=140737353877248, thread_return=0x7fffffffd5b8) at pthread_join.c:92 92 lll_wait_tid (pd->tid); Thread 2 "foo" stopped. 0x0000003615ebc6ed in nanosleep () at ../sysdeps/unix/syscall-template.S:81 81 T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS) Thread 3 "bar" stopped. 0x0000003615ebc6ed in nanosleep () at ../sysdeps/unix/syscall-template.S:81 81 T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS) b threads.c:87 Breakpoint 4 at 0x40087a: file threads.c, line 87. (gdb) b threads.c:67 Breakpoint 5 at 0x400811: file threads.c, line 67. (gdb) c -a& Continuing. (gdb) Thread 3 "bar" hit Breakpoint 4, thread_function1 (arg=0x1) at threads.c:87 87 usleep (1); /* Loop increment. */ Thread 2 "foo" hit Breakpoint 5, thread_function0 (arg=0x0) at threads.c:68 68 (*myp) ++; info threads Id Target Id Frame * 1 Thread 0x7ffff7fc1740 (LWP 31957) "main" (running) 2 Thread 0x7ffff7fc0700 (LWP 31961) "foo" thread_function0 (arg=0x0) at threads.c:68 3 Thread 0x7ffff77bf700 (LWP 31962) "bar" thread_function1 (arg=0x1) at threads.c:87 (gdb) shell kill -SIGINT 31957 (gdb) Thread 1 "main" received signal SIGINT, Interrupt. 0x0000003616a09237 in pthread_join (threadid=140737353877248, thread_return=0x7fffffffd5b8) at pthread_join.c:92 92 lll_wait_tid (pd->tid); info threads Id Target Id Frame * 1 Thread 0x7ffff7fc1740 (LWP 31957) "main" 0x0000003616a09237 in pthread_join (threadid=140737353877248, thread_return=0x7fffffffd5b8) at pthread_join.c:92 2 Thread 0x7ffff7fc0700 (LWP 31961) "foo" thread_function0 (arg=0x0) at threads.c:68 3 Thread 0x7ffff77bf700 (LWP 31962) "bar" thread_function1 (arg=0x1) at threads.c:87 (gdb) t 2 [Switching to thread 2, Thread 0x7ffff7fc0700 (LWP 31961)] #0 thread_function0 (arg=0x0) at threads.c:68 68 (*myp) ++; (gdb) catch syscall Catchpoint 6 (any syscall) (gdb) c& Continuing. (gdb) Thread 2 "foo" hit Catchpoint 6 (call to syscall nanosleep), 0x0000003615ebc6ed in nanosleep () at ../sysdeps/unix/syscall-template.S:81 81 T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS) I'll work on documentation next if this looks agreeable. This patch applies on top of the star wildcards thread IDs series: https://sourceware.org/ml/gdb-patches/2016-01/msg00291.html For convenience, I've pushed this to the users/palves/show-which-thread-caused-stop branch. gdb/doc/ChangeLog: 2016-01-18 Pedro Alves <palves@redhat.com> * gdb.texinfo (Threads): Mention that GDB displays the ID and name of the thread that hit a breakpoint or received a signal. gdb/ChangeLog: 2016-01-18 Pedro Alves <palves@redhat.com> * NEWS: Mention that GDB now displays the ID and name of the thread that hit a breakpoint or received a signal. * break-catch-sig.c (signal_catchpoint_print_it): Use maybe_print_thread_hit_breakpoint. * break-catch-syscall.c (print_it_catch_syscall): Likewise. * break-catch-throw.c (print_it_exception_catchpoint): Likewise. * breakpoint.c (maybe_print_thread_hit_breakpoint): New function. (print_it_catch_fork, print_it_catch_vfork, print_it_catch_solib) (print_it_catch_exec, print_it_ranged_breakpoint) (print_it_watchpoint, print_it_masked_watchpoint, bkpt_print_it): Use maybe_print_thread_hit_breakpoint. * breakpoint.h (maybe_print_thread_hit_breakpoint): Declare. * gdbthread.h (show_thread_that_caused_stop): Declare. * infrun.c (print_signal_received_reason): Print which thread received signal. * thread.c (show_thread_that_caused_stop): New function. gdb/testsuite/ChangeLog: 2016-01-18 Pedro Alves <palves@redhat.com> * gdb.base/async-shell.exp: Adjust expected output. * gdb.base/dprintf-non-stop.exp: Adjust expected output. * gdb.base/siginfo-thread.exp: Adjust expected output. * gdb.base/watchpoint-hw-hit-once.exp: Adjust expected output. * gdb.java/jnpe.exp: Adjust expected output. * gdb.threads/clone-new-thread-event.exp: Adjust expected output. * gdb.threads/continue-pending-status.exp: Adjust expected output. * gdb.threads/leader-exit.exp: Adjust expected output. * gdb.threads/manythreads.exp: Adjust expected output. * gdb.threads/pthreads.exp: Adjust expected output. * gdb.threads/schedlock.exp: Adjust expected output. * gdb.threads/siginfo-threads.exp: Adjust expected output. * gdb.threads/signal-command-multiple-signals-pending.exp: Adjust expected output. * gdb.threads/signal-delivered-right-thread.exp: Adjust expected output. * gdb.threads/sigthread.exp: Adjust expected output. * gdb.threads/watchpoint-fork.exp: Adjust expected output.
2016-01-18Replace some $ARCH_{get,set}_pc with linux_{get,set}_pc_64bitYao Qi5-32/+46
This patch is the follow-up of https://sourceware.org/ml/gdb-patches/2016-01/msg00164.html to provide linux_{get,set}_pc_64bit functions. Rebuild GDBserver with tilegx-linux-gcc. Not tested. I think about pc in Tile-GX a little bit. Looks current Tile-GX supports debugging 32-bit program (multi-arch), but PC is always 64-bit. See this thread https://sourceware.org/ml/gdb-patches/2013-02/msg00113.html and GDBserver reads PC as 64-bit through ptrace. However, if the inferior is 32-bit, the PC in the target description and regcache is 32-bit, so only 32-bit contents are sent back GDB. Anyway, Tile-GX GDBserver may have some problems here, but this patch doesn't change anything. gdb/gdbserver: 2016-01-18 Yao Qi <yao.qi@linaro.org> * linux-low.c (linux_set_pc_64bit): New function. (linux_get_pc_64bit): New function. * linux-low.h (linux_set_pc_64bit, linux_get_pc_64bit): Declare. * linux-sparc-low.c (debug_threads): Remove declaration. (sparc_get_pc): Remove. (the_low_target): Use linux_get_pc_64bit instead of sparc_get_pc. * linux-tile-low.c (tile_get_pc, tile_set_pc): Remove. (the_low_target): Use linux_get_pc_64bit and linux_set_pc_64bit.
2016-01-18Replace some $ARCH_{get,set}_pc with linux_{get,set}_pc_32bitYao Qi12-180/+83
This patch adds a pair of new functions linux_get_pc_32bit and linux_set_pc_32bit which get and set 32-bit register "pc" from regcache. This function can be used some targets and these own $ARCH_{get,set}_pc are replaced by linux_{get,set}_pc_32bit respectively. This patch touches many targets, but I only have arm board to test and no regression. I also rebuilt nios2-linux GDBserver. If it is right to go, I'll post the 64-bit counterpart later. gdb/gdbserver: 2016-01-18 Yao Qi <yao.qi@linaro.org> * linux-arm-low.c (debug_threads): Remove declaration. (arm_get_pc, arm_set_pc): Remove. (the_low_target): Use linux_get_pc_32bit and linux_set_pc_32bit. * linux-bfin-low.c (bfin_get_pc, bfin_set_pc): Remove. (the_low_target): Use linux_get_pc_32bit and linux_set_pc_32bit. * linux-cris-low.c (debug_threads): Remove declaration. (cris_get_pc, cris_set_pc,): Remove. (the_low_target): Use linux_get_pc_32bit and linux_set_pc_32bit. * linux-crisv32-low.c (debug_threads): Remove declaration. (cris_get_pc, cris_set_pc): Remove. (the_low_target): Use linux_get_pc_32bit and linux_set_pc_32bit. * linux-low.c: Include inttypes.h. (linux_get_pc_32bit, linux_set_pc_32bit): New functions. * linux-low.h (linux_get_pc_32bit, linux_set_pc_32bit): Declare. * linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Remove. (the_low_target): Use linux_get_pc_32bit and linux_set_pc_32bit. * linux-m68k-low.c (m68k_get_pc, m68k_set_pc): Remove. (the_low_target): Use linux_get_pc_32bit and linux_set_pc_32bit. * linux-nios2-low.c (nios2_get_pc, nios2_set_pc): Remove. (the_low_target): Use linux_get_pc_32bit and linux_set_pc_32bit. * linux-sh-low.c (sh_get_pc, sh_set_pc): Remove. (the_low_target): Use linux_get_pc_32bit and linux_set_pc_32bit. * linux-xtensa-low.c (xtensa_get_pc, xtensa_set_pc): Remove. (the_low_target): Use linux_get_pc_32bit and linux_set_pc_32bit.
2016-01-18[testsuite] @progbits -> %progbitsYao Qi3-8/+14
The ARM assembler has "@" as a comment character, so there are compile errors in {py,scm}-section-script.c, gdb compile failed, /tmp/ccHEzYqy.s: Assembler messages: /tmp/ccHEzYqy.s:19: Error: junk at end of line, first unrecognized character is `,' /tmp/ccHEzYqy.s:24: Error: junk at end of line, first unrecognized character is `,' /tmp/ccHEzYqy.s:29: Error: junk at end of line, first unrecognized character is `,' /tmp/ccHEzYqy.s:41: Error: junk at end of line, first unrecognized character is `,' This patch replaces @progbits with %progbits. gdb/testsuite: 2016-01-18 Yao Qi <yao.qi@linaro.org> * gdb.guile/scm-section-script.c: Replace @progbits with %progbits. * gdb.python/py-section-script.c: Likewise.
2016-01-18Re-enable rgn-at11 test for MIPS targets with adjusted section alignment.Nick Clifton3-6/+19
* testsuite/ld-scripts/rgn-at11.s: New file - based on rgn-at10.s but with 16 byte section alignment. * testsuite/ld-scripts/rgn-at11.d: Use new source file. Reenable test for MIPS targets.
2016-01-18Provide AC_PROG_LEX that copes with LEX=missing from top-levelAlan Modra8-12/+44
config/ PR binutils/19481 * override.m4 (AC_PROG_LEX): Define. binutils/ * configure: Regenerate. gas/ * configure: Regenerate. ld/ * configure: Regenerate.
2016-01-18Fix gdbserver build failure on targets without forkGary Benson6-55/+326
This commit fixes nat/linux-namespaces.c to build correctly on targets without fork. gdb/ChangeLog: * nat/linux-namespaces.c (do_fork): New function. (linux_mntns_get_helper): Use the above. gdb/gdbserver/ChangeLog: * configure.ac (AC_FUNC_FORK): New check. * config.in: Regenerate. * configure: Likewise.
2016-01-18Skip linker plugin tests if the linker has not been configured to support ↵Nick Clifton2-0/+11
plugins. * ld-plugin/plugin.exp: Skip plugin tests if the linker is not configured to support plugins.
2016-01-18Automatic date update in version.inGDB Administrator1-1/+1
2016-01-17GDB SIGSEGV opening a Fortran program compiled with ifortJonas Hahnfeld2-1/+9
This patch fixes a SIGSEGV when trying to open a Fortran program compiled with ifort (reproduced using version using version 16.0.1.150). The error can be reproduce with most, if not any program. For instance, a single file only containing "end", compiled with no additional flag, suffices. gdb/ChangeLog: PR gdb/19208 * dwarf2read.c (read_partial_die): Do not call set_objfile_main_name if the function has no name.
2016-01-17fix gdb version parsing in src-release.shJoel Brobecker1-1/+1
Small change required after we switched the gdb version scheme to using a -git suffix rather than a -cvs one. ChangeLog: * src-release.sh: Compute the gdb tarball name by stripping '-git' rather than '-cvs'. Tested by running "src-release.sh gdb" and verifying the tarball name as well as its contents.
2016-01-17Minor comment fixes in sim/common/sim-fpu.c.Joel Brobecker2-67/+71
This patch makes a fair number of fixes in the various comments of sim-fpu.c, mostly to either better conform to the GNU Coding Standards (sentences start with a capital letter, end with a period), or to fix spelling mistakes. sim/common/ChangeLog: * sim-fpu.c: Minor comment fixes throughout.
2016-01-17minor reformatting in sim/common/sim-fpu.c.Joel Brobecker2-2/+9
This patch just makes a copy of formatting changes to better conform with the GNU Coding Style. sim/common/ChangeLog: * sim-fpu.c (print_bits): Minor reformatting (no code change). (sim_fpu_map): Likewise.
2016-01-17Regen configureAlan Modra12-7/+31
Picks up 2016-01-12 libtool.m4 change. bfd/ * configure: Regenerate. binutils/ * configure: Regenerate. gas/ * configure: Regenerate. gprof/ * configure: Regenerate. ld/ * configure: Regenerate. opcodes/ * configure: Regenerate.
2016-01-17m68hc11/12 and xgate config.sub weirdnessAlan Modra10-2/+34
Oddly, config.sub converts a duple ending in -elf for these target to -unknown-none, which means they aren't seen as elf targets by binutils. So, counter that. This exposes a number of testsuite issues (ones you would have seen if configuring with a full triple, say m68hc11-unknown-elf). binutils/ * testsuite/lib/binutils-common.exp (is_elf_format): Return true for m68hc11/12 and xgate triples. gas/ * testsuite/gas/cfi/cfi.exp: Exclude m68hc11/12 from m68k test. ld/ * testsuite/lib/ld-lib.exp (check_shared_lib_support): Exclude xgate. * testsuite/ld-elf/endsym.d: xfail m68hc11/12 and xgate. * testsuite/ld-elf/pr14156a.d: Likewise. * testsuite/ld-elf/pr14926.d: Don't run for m68hc11/12 and xgate. * testsuite/ld-elf/sec64k.exp: Likewise.
2016-01-17m68hc11/12 readelf supportAlan Modra2-0/+7
Supports relocation of debug sections. * readelf.c (is_32bit_abs_reloc): Add R_M68HC11_32.
2016-01-17Automatic date update in version.inGDB Administrator1-1/+1
2016-01-15[gold][aarch64] PR gold/19472 - DSOs need pc-relative stubs.Han Shen2-2/+11
The stub generated during relaxation uses absolute addressing mode for shared libraries, which is not correct. Use pc-relative addressing instead. gold/ChangeLog: 2016-01-15 Han Shen <shenhan@google.com> PR gold/19472 - DSOs need pc-relative stubs. * aarch64.cc (Reloc_stub::stub_type_for_reloc): Return PC-relative stub type for DSOs and pie executables.
2016-01-16Automatic date update in version.inGDB Administrator1-1/+1
2016-01-15Fix phony_iconv wide character support.Sandra Loosemore2-27/+57
2016-01-15 Sandra Loosemore <sandra@codesourcery.com> gdb/ * charset.c [PHONY_ICONV] (GDB_DEFAULT_HOST_CHARSET): Conditionalize for Windows host. (GDB_DEFAULT_TARGET_CHARSET): Match GDB_DEFAULT_HOST_CHARSET. (GDB_DEFAULT_TARGET_WIDE_CHARSET): Use UTF-32. (phony_iconv_open): Handle both UTF-32 endiannesses. (phony_iconv): Likewise. Check for output overflow and clean up out-of-input cases. Correct adjustment to input buffer pointer. (set_be_le_names) [PHONY_ICONV]: Use hard-wired names to match phony_iconv_open.
2016-01-15Star wildcard ranges (e.g., "info thread 2.*")Pedro Alves11-30/+185
Add support for specifying "all threads of inferior N", by writing "*" as thread number/range in thread ID lists. E.g., "info threads 2.*" or "thread apply 2.* bt". gdb/ChangeLog: 2016-01-15 Pedro Alves <palves@redhat.com> * NEWS: Mention star wildcard ranges. * cli/cli-utils.c (get_number_or_range): Check state->in_range first. (number_range_setup_range): New function. * cli/cli-utils.h (number_range_setup_range): New declaration. * thread.c (thread_apply_command): Support star TID ranges. * tid-parse.c (tid_range_parser_finished) (tid_range_parser_string, tid_range_parser_skip) (get_tid_or_range, get_tid_or_range): Handle TID_RANGE_STATE_STAR_RANGE. (tid_range_parser_star_range): New function. * tid-parse.h (enum tid_range_state) <TID_RANGE_STATE_STAR_RANGE>: New value. (tid_range_parser_star_range): New declaration. gdb/doc/ChangeLog: 2016-01-15 Pedro Alves <palves@redhat.com> * gdb.texinfo (Threads) <thread ID lists>: Document star ranges. gdb/testsuite/ChangeLog: 2016-01-15 Pedro Alves <palves@redhat.com> * gdb.multi/tids.exp: Test star wildcard ranges.
2016-01-15Fix "thread apply $conv_var" and misc other related problemsPedro Alves5-22/+165
This fixes a few bugs in "thread apply". While this works: (gdb) thread apply 1 p 1234 Thread 1 (Thread 0x7ffff7fc1740 (LWP 14048)): $1 = 1234 This doesn't: (gdb) thread apply $thr p 1234 Thread 1 (Thread 0x7ffff7fc1740 (LWP 12039)): Invalid thread ID: p 1234 (gdb) ~~~~ Also, while this works: (gdb) thread apply 1 Please specify a command following the thread ID list This doesn't: (gdb) thread apply $thr Thread 1 (Thread 0x7ffff7fc1740 (LWP 12039)): [Current thread is 1 (Thread 0x7ffff7fc1740 (LWP 12039))] (gdb) ~~~~ And, while this works: (gdb) thread apply Please specify a thread ID list This obviously bogus invocation is just silent: (gdb) thread apply bt (gdb) gdb/ChangeLog: 2016-01-15 Pedro Alves <palves@redhat.com> * thread.c (thread_apply_command): Use the tid range parser to advance past the thread ID list. * tid-parse.c (get_positive_number_trailer): New function. (parse_thread_id): Use it. (get_tid_or_range): Use it. Return 0 instead of throwing invalid thread ID error. (get_tid_or_range): Detect negative values. Return 0 instead of throwing invalid thread ID error. gdb/testsuite/ChangeLog: 2016-01-15 Pedro Alves <palves@redhat.com> * gdb.multi/tids.exp (thr_apply_info_thr_error): Remove "p 1234" command from "thread apply" invocation. (thr_apply_info_thr_invalid): Default the expected output to the input tid list. (top level): Add tests that use convenience variables. Add tests for "thread apply" with a valid TID list, but missing the command.
2016-01-15Automatic date update in version.inGDB Administrator1-1/+1
2016-01-14Fix display of RL78 MOVW instructions that use the stack pointer.Nick Clifton8-3/+53
* rl78-decode.opc (rl78_decode_opcode): Add 's' operand to movw instructions that can support stack pointer operations. * rl78-decode.c: Regenerate. * rl78-dis.c: Fix display of stack pointer in MOVW based instructions. * testsuite/gas/rl78/sp-relative-movw.s: New test. * testsuite/gas/rl78/sp-relative-movw.d: Expected disassembly. * testsuite/gas/rl78/rl78.exp: Run the new test.
2016-01-14[ARM] Remove field syscall_next_pc in struct gdbarch_tdepYao Qi4-29/+36
Field syscall_next_pc in struct gdbarch_tdep was to calculate the next pc of syscall instruction. On linux target, syscall_next_pc is set to arm_linux_syscall_next_pc, to do linux specific things. However, after we have struct arm_get_next_pcs_ops, we can do the same thing in struct arm_get_next_pcs_ops field syscall_next_pc, so syscall_next_pc in struct gdbarch_tdep is not needed any more. gdb: 2016-01-14 Yao Qi <yao.qi@linaro.org> * arm-linux-tdep.c (arm_linux_get_next_pcs_syscall_next_pc): Declare. (arm_linux_get_next_pcs_ops): Install arm_linux_get_next_pcs_syscall_next_pc. (arm_linux_syscall_next_pc): Change to ... (arm_linux_get_next_pcs_syscall_next_pc): ... it. (arm_linux_init_abi): Don't set tdep->syscall_next_pc. * arm-tdep.c (arm_get_next_pcs_syscall_next_pc): Declare. (arm_get_next_pcs_syscall_next_pc): Make it static. Don't call tdep->syscall_next_pc. * arm-tdep.h (struct gdbarch_tdep) <syscall_next_pc>: Remove. (arm_get_next_pcs_syscall_next_pc): Remove.
2016-01-14Fix C++ build error by casting void *Yao Qi3-2/+7
Two recent patches breaks GDB C++ mode build, https://sourceware.org/ml/gdb-patches/2016-01/msg00150.html https://sourceware.org/ml/gdb-patches/2016-01/msg00086.html gdb/remote.c: In function 'int remote_set_syscall_catchpoint(target_ops*, int, int, int, int, int*)': gdb/remote.c:2036:39: error: invalid conversion from 'void*' to 'char*' [-fpermissive] catch_packet = xmalloc (maxpktsz); ^ gdb/thread.c: In function 'int do_captured_thread_select(ui_out*, void*)': gdb/git/gdb/thread.c:1999:24: error: invalid conversion from 'void*' to 'const char*' [-fpermissive] const char *tidstr = tidstr_v; ^ this patch fixes them by casting void * to the right type. gdb: 2016-01-14 Yao Qi <yao.qi@linaro.org> * remote.c (remote_set_syscall_catchpoint): Cast to char *. * thread.c (do_captured_thread_select): Cast to const char *.
2016-01-14[AArch64] Fix missing architecture checks for ARMv8.2 system registers.Matthew Wahab5-9/+70
Some of the RAS system registers added to binutils as part of the ARMv8.2 support are missing the feature checks to warn when they aren't supported by the target. This patch adds the missing feature checks with a test to check that the correct warnings are given for all the ARMv8.2 system registers. gas/ 2016-01-14 Matthew Wahab <matthew.wahab@arm.com> * testsuite/gas/aarch64/illegal-sysreg-2.l: New. * testsuite/gas/aarch64/illegal-sysreg-2.d: New. opcodes/ 2016-01-14 Matthew Wahab <matthew.wahab@arm.com> * aarch64-opc.c (aarch64_sys_reg_supported_p): Merge conditionals testing for RAS support. Add checks for erxfr_el1, erxctlr_el1, erxtatus_el1 and erxaddr_el1. Change-Id: I66b590ea49c1eb6b0e5c93e0dc2bc9c4e79a52fe
2016-01-14Fix Thumb-Thumb farcall v6-M (no profile) testThomas Preud'homme4-9/+15
2016-01-14 Thomas Preud'homme <thomas.preudhomme@arm.com> ld/ * testsuite/ld-arm/arm-elf.exp (Thumb-Thumb farcall v6-M (no profile)): Set address of .foo section when linking. * testsuite/ld-arm/farcall-thumb-thumb-m-no-profile-b.s: Place myfunc in .foo section. * testsuite/ld-arm/farcall-thumb-thumb-m-no-profile.d: Adapt expected output to the above changes.
2016-01-14[ARM] Make thumb2_breakpoint static againYao Qi9-12/+33
This patch makes thumb2_breakpoint static. When writing this patch, I find the only reason we keep thumb2_breakpoint extern is that it is used as an argument passed to arm_gdbserver_get_next_pcs. However, field arm_thumb2_breakpoint is only used in a null check in thumb_get_next_pcs_raw, so I wonder why do need to pass thumb2_breakpoint to arm_gdbserver_get_next_pcs. thumb2_breakpoint was added by Daniel Jacobowitz in order to support single-step IT block https://sourceware.org/ml/gdb-patches/2010-01/msg00624.html the logic there was if we have 32-bit thumb-2 breakpoint defined, we can safely single-step IT block, otherwise, we can't. Daniel didn't want to use 16-bit thumb BKPT instruction, because it triggers even on instruction which should be executed. Secondly, using 16-bit thumb illegal instruction on top of 32-bit thumb instruction may break the meaning of original IT blocks, because the other 16-bit can be regarded as an instruction. See more explanations from Daniel's kernel patch http://www.spinics.net/lists/arm-kernel/msg80476.html Let us back to this patch, GDB/GDBserver can safely single step IT block if thumb2_breakpoint is defined, but the single step logic doesn't have to know the thumb-2 breakpoint instruction. Only breakpoint insertion mechanism decides to use which breakpoint instruction. In the software single step code, instead of pass thumb2_breakpoint, we can pass a boolean variable has_thumb2_breakpoint indicate whether the target has thumb-2 breakpoint defined, which is equivalent to the original code. Regression tested on arm-linux. No regression. gdb: 2016-01-14 Yao Qi <yao.qi@linaro.org> * arch/arm-get-next-pcs.c (arm_get_next_pcs_ctor): Change argument arm_thumb2_breakpoint to has_thumb2_breakpoint. (thumb_get_next_pcs_raw): Check has_thumb2_breakpoint instead. * arch/arm-get-next-pcs.h (struct arm_get_next_pcs) <arm_thumb2_breakpoint>: Remove. <has_thumb2_breakpoint>: New field. (arm_get_next_pcs_ctor): Update declaration. * arm-linux-tdep.c (arm_linux_software_single_step): Pass 1 to arm_get_next_pcs_ctor. * arm-tdep.c (arm_software_single_step): Pass 0 to arm_get_next_pcs_ctor. gdb/gdbserver: 2016-01-14 Yao Qi <yao.qi@linaro.org> * linux-aarch32-low.c (thumb2_breakpoint): Make it static. * linux-aarch32-low.h (thumb2_breakpoint): Remove declaration. * linux-arm-low.c (arm_gdbserver_get_next_pcs): Pass 1 to arm_get_next_pcs_ctor.
2016-01-14Automatic date update in version.inGDB Administrator1-1/+1
2016-01-13Nios II/GAS: Fix build error in `output_movia'Maciej W. Rozycki2-1/+5
Fix: cc1: warnings being treated as errors .../gas/config/tc-nios2.c: In function 'output_movia': .../gas/config/tc-nios2.c:3474: warning: 'code' may be used uninitialized in this function make[4]: *** [tc-nios2.o] Error 1 seen with GCC 4.1.2 and 4.4.7. gas/ * config/tc-nios2.c (output_movia): Preset `code' to 0.
2016-01-13MAINTAINERS: Add Andreas Arnez as s390 target maintainer.Ulrich Weigand2-0/+5
gdb/ChangeLog: * MAINTAINERS: Add Andreas Arnez as s390 target maintainer.
2016-01-13Remove spurious condition in test for closing parenthesis.Yoshinori Sato2-1/+6
* config/tc-h8300.c (get_operand): Remove spurious condition in test for closing parenthesis.
2016-01-13Read instruction with byte_order_for_codeYao Qi2-1/+7
When reading instruction, we should use byte_order_for_code instead of byte_order. gdb: 2016-01-13 Yao Qi <yao.qi@linaro.org> * arch/arm-get-next-pcs.c (arm_get_next_pcs_raw): Use byte_order_for_code to read instruction.
2016-01-13Add $_gthread convenience variablePedro Alves10-11/+89
This commit adds a new $_gthread convenience variable, that is like $_thread, but holds the current thread's global thread id. gdb/ChangeLog: 2016-01-13 Pedro Alves <palves@redhat.com> * NEWS: Mention $_gthread. * gdbthread.h (struct thread_info) <global_num>: Mention $_gthread. * thread.c (thread_num_make_value_helper): New function. (thread_id_make_value): Delete. (thread_id_per_inf_num_make_value, global_thread_id_make_value): New. (thread_funcs): Adjust. (gthread_funcs): New. (_initialize_thread): Register $_gthread variable. gdb/testsuite/ChangeLog: 2016-01-13 Pedro Alves <palves@redhat.com> * gdb.base/default.exp: Expect $_gthread as well. * gdb.multi/tids.exp: Test $_gthread. * gdb.threads/thread-specific.exp: Test $_gthread. gdb/doc/ChangeLog: 2016-01-13 Pedro Alves <palves@redhat.com> * gdb.texinfo (Threads): Document the $_gthread convenience variable. (Convenience Vars): Likewise.
2016-01-13Implement "info threads -gid"Pedro Alves8-10/+55
This commit makes global thread IDs optionaly visible in "info threads", with the new "-gid" switch: (gdb) info threads -gid Id GId Target Id Frame 1.1 1 Thread 0x7ffff7fc2740 (LWP 6022) "threads" (running) 1.2 3 Thread 0x7ffff77c0700 (LWP 6028) "threads" (running) 1.3 4 Thread 0x7ffff7fc2740 (LWP 6032) "threads" (running) 2.1 2 Thread 0x7ffff7fc1700 (LWP 6037) "threads" (running) 2.2 5 Thread 0x7ffff77c0700 (LWP 6038) "threads" (running) * 2.3 6 Thread 0x7ffff7fc2740 (LWP 6039) "threads" (running) (gdb) info threads Id Target Id Frame 1.1 Thread 0x7ffff7fc2740 (LWP 6022) "threads" (running) 1.2 Thread 0x7ffff77c0700 (LWP 6028) "threads" (running) 1.3 Thread 0x7ffff7fc2740 (LWP 6032) "threads" (running) 2.1 Thread 0x7ffff7fc1700 (LWP 6037) "threads" (running) 2.2 Thread 0x7ffff77c0700 (LWP 6038) "threads" (running) * 2.3 Thread 0x7ffff7fc2740 (LWP 6039) "threads" (running) No regressions on x86_64 Fedora 20. gdb/ChangeLog: 2016-01-13 Pedro Alves <palves@redhat.com> * NEWS: Mention "info threads -gid". * gdbthread.h (struct thread_info) <global_num>: Mention "info threads -gid". * thread.c (info_threads_command): Handle "-gid". (_initialize_thread): Adjust "info threads" help string to mention -gid. gdb/testsuite/ChangeLog: 2016-01-13 Pedro Alves <palves@redhat.com> * gdb.multi/tids.exp: Test "info threads -gid". gdb/doc/ChangeLog: 2016-01-13 Pedro Alves <palves@redhat.com> * gdb.texinfo (Threads): Document "info threads -gid".
2016-01-13Add Python InferiorThread.global_num attributePedro Alves8-4/+63
This commit adds a new Python InferiorThread.global_num attribute. This can be used to pass the correct thread ID to Breakpoint.thread, which takes a global thread ID, not a per-inferior thread number. gdb/ChangeLog: 2016-01-13 Pedro Alves <palves@redhat.com> * NEWS: Mention InferiorThread.global_num. * python/py-infthread.c (thpy_get_global_num): New function. (thread_object_getset): Register "global_num". gdb/testsuite/ChangeLog: 2016-01-13 Pedro Alves <palves@redhat.com> * gdb.multi/tids.exp: Test InferiorThread.global_num and Breakpoint.thread. * gdb.python/py-infthread.exp: Test InferiorThread.global_num. gdb/doc/ChangeLog: 2016-01-13 Pedro Alves <palves@redhat.com> * python.texi (Breakpoints In Python) <Breakpoint.thread>: Add anchor. (Threads In Python): Document new InferiorThread.global_num attribute.
2016-01-13Per-inferior/Inferior-qualified thread IDsPedro Alves42-341/+1537
This commit changes GDB to track thread numbers per-inferior. Then, if you're debugging multiple inferiors, GDB displays "inferior-num.thread-num" instead of just "thread-num" whenever it needs to display a thread: (gdb) info inferiors Num Description Executable 1 process 6022 /home/pedro/gdb/tests/threads * 2 process 6037 /home/pedro/gdb/tests/threads (gdb) info threads Id Target Id Frame 1.1 Thread 0x7ffff7fc2740 (LWP 6022) "threads" (running) 1.2 Thread 0x7ffff77c0700 (LWP 6028) "threads" (running) 1.3 Thread 0x7ffff7fc2740 (LWP 6032) "threads" (running) 2.1 Thread 0x7ffff7fc1700 (LWP 6037) "threads" (running) 2.2 Thread 0x7ffff77c0700 (LWP 6038) "threads" (running) * 2.3 Thread 0x7ffff7fc2740 (LWP 6039) "threads" (running) (gdb) ... (gdb) thread 1.1 [Switching to thread 1.1 (Thread 0x7ffff7fc2740 (LWP 8155))] (gdb) ... etc. You can still use "thread NUM", in which case GDB infers you're referring to thread NUM of the current inferior. The $_thread convenience var and Python's InferiorThread.num attribute are remapped to the new per-inferior thread number. It's a backward compatibility break, but since it only matters when debugging multiple inferiors, I think it's worth doing. Because MI thread IDs need to be a single integer, we keep giving threads a global identifier, _in addition_ to the per-inferior number, and make MI always refer to the global thread IDs. IOW, nothing changes from a MI frontend's perspective. Similarly, since Python's Breakpoint.thread and Guile's breakpoint-thread/set-breakpoint-thread breakpoint methods need to work with integers, those are adjusted to work with global thread IDs too. Follow up patches will provide convenient means to access threads' global IDs. To avoid potencially confusing users (which also avoids updating much of the testsuite), if there's only one inferior and its ID is "1", IOW, the user hasn't done anything multi-process/inferior related, then the "INF." part of thread IDs is not shown. E.g,.: (gdb) info inferiors Num Description Executable * 1 process 15275 /home/pedro/gdb/tests/threads (gdb) info threads Id Target Id Frame * 1 Thread 0x7ffff7fc1740 (LWP 15275) "threads" main () at threads.c:40 (gdb) add-inferior Added inferior 2 (gdb) info threads Id Target Id Frame * 1.1 Thread 0x7ffff7fc1740 (LWP 15275) "threads" main () at threads.c:40 (gdb) No regressions on x86_64 Fedora 20. gdb/ChangeLog: 2016-01-13 Pedro Alves <palves@redhat.com> * NEWS: Mention that thread IDs are now per inferior and global thread IDs. * Makefile.in (SFILES): Add tid-parse.c. (COMMON_OBS): Add tid-parse.o. (HFILES_NO_SRCDIR): Add tid-parse.h. * ada-tasks.c: Adjust to use ptid_to_global_thread_id. * breakpoint.c (insert_breakpoint_locations) (remove_threaded_breakpoints, bpstat_check_breakpoint_conditions) (print_one_breakpoint_location, set_longjmp_breakpoint) (check_longjmp_breakpoint_for_call_dummy) (set_momentary_breakpoint): Adjust to use global IDs. (find_condition_and_thread, watch_command_1): Use parse_thread_id. (until_break_command, longjmp_bkpt_dtor) (breakpoint_re_set_thread, insert_single_step_breakpoint): Adjust to use global IDs. * dummy-frame.c (pop_dummy_frame_bpt): Adjust to use ptid_to_global_thread_id. * elfread.c (elf_gnu_ifunc_resolver_stop): Likewise. * gdbthread.h (struct thread_info): Rename field 'num' to 'global_num. Add new fields 'per_inf_num' and 'inf'. (thread_id_to_pid): Rename thread_id_to_pid to global_thread_id_to_ptid. (pid_to_thread_id): Rename to ... (ptid_to_global_thread_id): ... this. (valid_thread_id): Rename to ... (valid_global_thread_id): ... this. (find_thread_id): Rename to ... (find_thread_global_id): ... this. (ALL_THREADS, ALL_THREADS_BY_INFERIOR): Declare. (print_thread_info): Add comment. * tid-parse.h: New file. * tid-parse.c: New file. * infcmd.c (step_command_fsm_prepare) (step_command_fsm_should_stop): Adjust to use the global thread ID. (until_next_command, until_next_command) (finish_command_fsm_should_stop): Adjust to use the global thread ID. (attach_post_wait): Adjust to check the inferior number too. * inferior.h (struct inferior) <highest_thread_num>: New field. * infrun.c (handle_signal_stop) (insert_exception_resume_breakpoint) (insert_exception_resume_from_probe): Adjust to use the global thread ID. * record-btrace.c (record_btrace_open): Use global thread IDs. * remote.c (process_initial_stop_replies): Also consider the inferior number. * target.c (target_pre_inferior): Clear the inferior's highest thread num. * thread.c (clear_thread_inferior_resources): Adjust to use the global thread ID. (new_thread): New inferior parameter. Adjust to use it. Set both the thread's global ID and the thread's per-inferior ID. (add_thread_silent): Adjust. (find_thread_global_id): New. (find_thread_id): Make static. Adjust to rename. (valid_thread_id): Rename to ... (valid_global_thread_id): ... this. (pid_to_thread_id): Rename to ... (ptid_to_global_thread_id): ... this. (thread_id_to_pid): Rename to ... (global_thread_id_to_ptid): ... this. Adjust. (first_thread_of_process): Adjust. (do_captured_list_thread_ids): Adjust to use global thread IDs. (should_print_thread): New function. (print_thread_info): Rename to ... (print_thread_info_1): ... this, and add new show_global_ids parameter. Handle it. Iterate over inferiors. (print_thread_info): Reimplement as wrapper around print_thread_info_1. (show_inferior_qualified_tids): New function. (print_thread_id): Use it. (tp_array_compar): Compare inferior numbers too. (thread_apply_command): Use tid_range_parser. (do_captured_thread_select): Use parse_thread_id. (thread_id_make_value): Adjust. (_initialize_thread): Adjust "info threads" help string. * varobj.c (struct varobj_root): Update comment. (varobj_create): Adjust to use global thread IDs. (value_of_root_1): Adjust to use global_thread_id_to_ptid. * windows-tdep.c (display_tib): No longer accept an argument. * cli/cli-utils.c (get_number_trailer): Make extern. * cli/cli-utils.h (get_number_trailer): Declare. (get_number_const): Adjust documentation. * mi/mi-cmd-var.c (mi_cmd_var_update_iter): Adjust to use global thread IDs. * mi/mi-interp.c (mi_new_thread, mi_thread_exit) (mi_on_normal_stop, mi_output_running_pid, mi_on_resume): * mi/mi-main.c (mi_execute_command, mi_cmd_execute): Likewise. * guile/scm-breakpoint.c (gdbscm_set_breakpoint_thread_x): Likewise. * python/py-breakpoint.c (bppy_set_thread): Likewise. * python/py-finishbreakpoint.c (bpfinishpy_init): Likewise. * python/py-infthread.c (thpy_get_num): Add comment and return the per-inferior thread ID. (thread_object_getset): Update comment of "num". gdb/testsuite/ChangeLog: 2016-01-07 Pedro Alves <palves@redhat.com> * gdb.base/break.exp: Adjust to output changes. * gdb.base/hbreak2.exp: Likewise. * gdb.base/sepdebug.exp: Likewise. * gdb.base/watch_thread_num.exp: Likewise. * gdb.linespec/keywords.exp: Likewise. * gdb.multi/info-threads.exp: Likewise. * gdb.threads/thread-find.exp: Likewise. * gdb.multi/tids.c: New file. * gdb.multi/tids.exp: New file. gdb/doc/ChangeLog: 2016-01-07 Pedro Alves <palves@redhat.com> * gdb.texinfo (Threads): Document per-inferior thread IDs, qualified thread IDs, global thread IDs and thread ID lists. (Set Watchpoints, Thread-Specific Breakpoints): Adjust to refer to thread IDs. (Convenience Vars): Document the $_thread convenience variable. (Ada Tasks): Adjust to refer to thread IDs. (GDB/MI Async Records, GDB/MI Thread Commands, GDB/MI Ada Tasking Commands, GDB/MI Variable Objects): Update to mention global thread IDs. * guile.texi (Breakpoints In Guile) <breakpoint-thread/set-breakpoint-thread breakpoint>: Mention global thread IDs instead of thread IDs. * python.texi (Threads In Python): Adjust documentation of InferiorThread.num. (Breakpoint.thread): Mention global thread IDs instead of thread IDs.
2016-01-13Centralize thread ID printingPedro Alves11-71/+137
Add a new function to print a thread ID, in the style of paddress, plongest, etc. and adjust all CLI-reachable paths to use it. This gives us a single place to tweak to print inferior-qualified thread IDs later: - [Switching to thread 1 (Thread 0x7ffff7fc2740 (LWP 8155))] + [Switching to thread 1.1 (Thread 0x7ffff7fc2740 (LWP 8155))] etc., though for now, this has no user-visible change. No regressions on x86_64 Fedora 20. gdb/ChangeLog: 2016-01-13 Pedro Alves <palves@redhat.com> * breakpoint.c (remove_threaded_breakpoints) (print_one_breakpoint_location): Use print_thread_id. * btrace.c (btrace_enable, btrace_disable, btrace_teardown) (btrace_fetch, btrace_clear): Use print_thread_id. * common/print-utils.c (CELLSIZE): Delete. (get_cell): Rename to ... (get_print_cell): ... this and made extern. Adjust call callers. Adjust to use PRINT_CELL_SIZE. * common/print-utils.h (get_print_cell): Declare. (PRINT_CELL_SIZE): New. * gdbthread.h (print_thread_id): Declare. * infcmd.c (signal_command): Use print_thread_id. * inferior.c (print_inferior): Use print_thread_id. * infrun.c (handle_signal_stop) (insert_exception_resume_breakpoint) (insert_exception_resume_from_probe) (print_signal_received_reason): Use print_thread_id. * record-btrace.c (record_btrace_info) (record_btrace_resume_thread, record_btrace_cancel_resume) (record_btrace_step_thread, record_btrace_wait): Use print_thread_id. * thread.c (thread_apply_all_command): Use print_thread_id. (print_thread_id): New function. (thread_apply_command): Use print_thread_id. (thread_command, thread_find_command, do_captured_thread_select): Use print_thread_id.
2016-01-13Add Python InferiorThread.inferior attributePedro Alves7-0/+42
So a script can easily get at a thread's inferior and its number. gdb/ChangeLog: 2016-01-13 Pedro Alves <palves@redhat.com> * NEWS: Mention InferiorThread.inferior. * python/py-infthread.c (thpy_get_inferior): New. (thread_object_getset): Register "inferior". gdb/testsuite/ChangeLog: 2016-01-13 Pedro Alves <palves@redhat.com> * gdb.python/py-infthread.exp: Test InferiorThread.inferior. gdb/doc/ChangeLog: 2016-01-13 Pedro Alves <palves@redhat.com> * python.texi (Threads In Python): Document InferiorThread.inferior.
2016-01-13Add a new $_inferior convenience variablePedro Alves8-0/+57
Like $_thread, but holds the current inferior number. gdb/ChangeLog: 2016-01-13 Pedro Alves <palves@redhat.com> * NEWS: Mention $_inferior. * inferior.c (inferior_id_make_value): New. (inferior_funcs): New. (_initialize_inferior): Create $_inferior variable. gdb/testsuite/ChangeLog: 2016-01-13 Pedro Alves <palves@redhat.com> * gdb.base/default.exp: Expect $_inferior as well. * gdb.multi/base.exp: Test $_inferior. gdb/doc/ChangeLog: 2016-01-13 Pedro Alves <palves@redhat.com> * gdb.texinfo (Inferiors and Programs): Document the $_inferior convenience variable. (Convenience Vars): Likewise.
2016-01-13Fix PR19388: Can't access $_siginfo in breakpoint (catch signal) conditionPedro Alves8-29/+144
This commit merges both the registers and $_siginfo "thread running/executing" checks into a single function. Accessing $_siginfo from a "catch signal" breakpoint condition doesn't work. The condition always fails with "Selected thread is running": (gdb) catch signal Catchpoint 3 (standard signals) (gdb) condition $bpnum $_siginfo.si_signo == 5 (gdb) continue Continuing. Error in testing breakpoint condition: Selected thread is running. Catchpoint 3 (signal SIGUSR1), 0x0000003615e35877 in __GI_raise (sig=10) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 56 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig); (gdb) When accessing the $_siginfo object, we check whether the thread is marked running (external/public) state and refuse the access if so. This is so "print $_siginfo" at the prompt fails nicelly when the current thread is running. While evaluating breakpoint conditionals, we haven't decided yet whether the thread is going to stop, so is_running still returns true, and we thus always error out. Evaluating an expression that requires registers access is really conceptually the same -- we could think of $_siginfo as a pseudo register. However, in that case we check whether the thread is marked executing (internal/private state), not running (external/public state). Changing the $_siginfo validation to check is_executing as well fixes the bug in question. Note that checking is_executing is not fully correct, not even for registers. See PR 19389. However, I think this is the lesser of two evils and ends up as an improvement. We at least now have a single place to fix. Tested on x86_64 GNU/Linux. gdb/ChangeLog: 2016-01-13 Pedro Alves <palves@redhat.com> PR breakpoints/19388 * frame.c (get_current_frame): Use validate_registers_access. * gdbthread.h (validate_registers_access): Declare. * infrun.c (validate_siginfo_access): Delete. (siginfo_value_read, siginfo_value_write): Use validate_registers_access. * thread.c (validate_registers_access): New function. gdb/testsuite/ChangeLog: 2016-01-13 Pedro Alves <palves@redhat.com> PR breakpoints/19388 * gdb.base/catch-signal-siginfo-cond.c: New file. * gdb.base/catch-signal-siginfo-cond.exp: New file.
2016-01-13Mark the linker's -Bsymbolic-functions test as an expected failure for MIPS ↵Nick Clifton2-0/+5
targets. * ld-elf/elf.exp (-Bymsolic-functions): Expect to fail for MIPS targets.
2016-01-13Mark the linker's extract symbols test as an expected failure for MIPS targets.Nick Clifton2-0/+15
* testsuite/ld-scripts/script.exp (extract_symbol_test): Expect to fail for MIPS targets.
2016-01-13Mark the rgn-at11 test as an expected failure for MIPS targets.Nick Clifton2-1/+9
* ld-scripts/rgn-at11.d: Expect this test to fail for MIPS targets.
2016-01-13Automatic date update in version.inGDB Administrator1-1/+1
2016-01-12Implement 'catch syscall' for gdbserverJosh Stone19-8/+566
This adds a new QCatchSyscalls packet to enable 'catch syscall', and new stop reasons "syscall_entry" and "syscall_return" for those events. It is currently only supported on Linux x86 and x86_64. gdb/ChangeLog: 2016-01-12 Josh Stone <jistone@redhat.com> Philippe Waroquiers <philippe.waroquiers@skynet.be> * NEWS (Changes since GDB 7.10): Mention QCatchSyscalls and the syscall_entry and syscall_return stop reasons. Mention GDB support for remote catch syscall. * remote.c (PACKET_QCatchSyscalls): New enum. (remote_set_syscall_catchpoint): New function. (remote_protocol_features): New element for QCatchSyscalls. (remote_parse_stop_reply): Parse syscall_entry/return stops. (init_remote_ops): Install remote_set_syscall_catchpoint. (_initialize_remote): Config QCatchSyscalls. * linux-nat.h (struct lwp_info) <syscall_state>: Comment typo. gdb/doc/ChangeLog: 2016-01-12 Josh Stone <jistone@redhat.com> Philippe Waroquiers <philippe.waroquiers@skynet.be> * gdb.texinfo (Remote Configuration): List the QCatchSyscalls packet. (Stop Reply Packets): List the syscall entry and return stop reasons. (General Query Packets): Describe QCatchSyscalls, and add it to the table and the detailed list of stub features. gdb/gdbserver/ChangeLog: 2016-01-12 Josh Stone <jistone@redhat.com> Philippe Waroquiers <philippe.waroquiers@skynet.be> * inferiors.h: Include "gdb_vecs.h". (struct process_info): Add syscalls_to_catch. * inferiors.c (remove_process): Free syscalls_to_catch. * remote-utils.c (prepare_resume_reply): Report syscall_entry and syscall_return stops. * server.h (UNKNOWN_SYSCALL, ANY_SYSCALL): Define. * server.c (handle_general_set): Handle QCatchSyscalls. (handle_query): Report support for QCatchSyscalls. * target.h (struct target_ops): Add supports_catch_syscall. (target_supports_catch_syscall): New macro. * linux-low.h (struct linux_target_ops): Add get_syscall_trapinfo. (struct lwp_info): Add syscall_state. * linux-low.c (handle_extended_wait): Mark syscall_state as an entry. Maintain syscall_state and syscalls_to_catch across exec. (get_syscall_trapinfo): New function, proxy to the_low_target. (linux_low_ptrace_options): Enable PTRACE_O_TRACESYSGOOD. (linux_low_filter_event): Toggle syscall_state entry/return for syscall traps, and set it ignored for all others. (gdb_catching_syscalls_p): New function. (gdb_catch_this_syscall_p): New function. (linux_wait_1): Handle SYSCALL_SIGTRAP. (linux_resume_one_lwp_throw): Add PTRACE_SYSCALL possibility. (linux_supports_catch_syscall): New function. (linux_target_ops): Install it. * linux-x86-low.c (x86_get_syscall_trapinfo): New function. (the_low_target): Install it. gdb/testsuite/ChangeLog: 2016-01-12 Josh Stone <jistone@redhat.com> Philippe Waroquiers <philippe.waroquiers@skynet.be> * gdb.base/catch-syscall.c (do_execve): New variable. (main): Conditionally trigger an execve. * gdb.base/catch-syscall.exp: Enable testing for remote targets. (test_catch_syscall_execve): New, check entry/return across execve. (do_syscall_tests): Call test_catch_syscall_execve.
2016-01-12Fix compile error with use of 'typename' outside of templateH.J. Lu2-3/+7
* i386.cc (Target_i386::Classify_reloc::get_r_addend): Remove 'typename'.
2016-01-12Remove typename from Mips64_rela_dataH.J. Lu1-1/+1
2016-01-12Fix breakage for SHT_REL targets where get_r_addend() gives internal error.Cary Coutant4-2/+33
gold/ * arm.cc (Target_arm::Classify_reloc::get_r_addend): New method. * i386.cc (Target_i386::Classify_reloc::get_r_addend): New method. * mips.cc (Target_arm::Mips_classify_reloc::get_r_addend): (Both specializations) New method.