aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-09-24Automatic date update in version.inGDB Administrator1-1/+1
2015-09-23Automatic date update in version.inGDB Administrator1-1/+1
2015-09-22Automatic date update in version.inGDB Administrator1-1/+1
2015-09-21Automatic date update in version.inGDB Administrator1-1/+1
2015-09-20Automatic date update in version.inGDB Administrator1-1/+1
2015-09-19Automatic date update in version.inGDB Administrator1-1/+1
2015-09-18Automatic date update in version.inGDB Administrator1-1/+1
2015-09-17Automatic date update in version.inGDB Administrator1-1/+1
2015-09-16Automatic date update in version.inGDB Administrator1-1/+1
2015-09-15gdb/doc: revert previous vforkdone changePedro Alves2-6/+11
The previous manual change was wrong. The vfork parent thread ID should be reported with the usual "thread" magic register: Sending packet: $vCont;c:p7260.7260#1e...Packet received: OK - Notification received: Stop:T05vforkdone:; + Notification received: Stop:T05vforkdone:;thread:p7260.7260 ^^^^^^^^^^^^^^^^^ This is already how the parent is reported in the vfork/fork events, and is actually what the fix made gdbserver do. Following the documentation change, the event would have been reported like this instead: Notification received: Stop:T05vforkdone:p7260.7260 gdb/doc/ChangeLog: 2015-09-15 Pedro Alves <palves@redhat.com> PR remote/18965 * gdb.texinfo (Stop Reply Packets): Revert previous change to the vforkdone description.
2015-09-15PR remote/18965: vforkdone stop reply should indicate parent PIDPedro Alves4-15/+26
The vforkdone stop reply misses indicating the thread ID of the vfork parent which the event relates to: @cindex vfork events, remote reply @item vfork The packet indicates that @code{vfork} was called, and @var{r} is the thread ID of the new child process. Refer to @ref{thread-id syntax} for the format of the @var{thread-id} field. This packet is only applicable to targets that support vfork events. @cindex vforkdone events, remote reply @item vforkdone The packet indicates that a child process created by a vfork has either called @code{exec} or terminated, so that the address spaces of the parent and child process are no longer shared. The @var{r} part is ignored. This packet is only applicable to targets that support vforkdone events. Unfortunately, this is not just a documentation issue. GDBserver is really not specifying the thread ID. I noticed because in non-stop mode, gdb complains: [Thread 6089.6089] #1 stopped. #0 0x0000003615a011f0 in ?? () 0x0000003615a011f0 in ?? () (gdb) set debug remote 1 (gdb) c Continuing. Sending packet: $QPassSignals:e;10;14;17;1a;1b;1c;21;24;25;2c;4c;#5f...Packet received: OK Sending packet: $vCont;c:p17c9.17c9#88...Packet received: OK Notification received: Stop:T05vfork:p17ce.17ce;06:40d7ffffff7f0000;07:30d7ffffff7f0000;10:e4c9eb1536000000;thread:p17c9.17c9;core:2; Sending packet: $vStopped#55...Packet received: OK Sending packet: $D;17ce#af...Packet received: OK Sending packet: $vCont;c:p17c9.17c9#88...Packet received: OK Notification received: Stop:T05vforkdone:; No process or thread specified in stop reply: T05vforkdone:; (gdb) This is not non-stop-mode-specific, however. Consider e.g., that in all-stop, you may be debugging more than one process at the same time. You continue, and both processes vfork. So when you next get a T05vforkdone, there's no way to tell which of the parent processes is done with the vfork. Tests will be added later. Tested on x86_64 Fedora 20. gdb/gdbserver/ChangeLog: 2015-09-15 Pedro Alves <palves@redhat.com> PR remote/18965 * remote-utils.c (prepare_resume_reply): Merge TARGET_WAITKIND_VFORK_DONE switch case with the TARGET_WAITKIND_FORKED case. gdb/doc/ChangeLog: 2015-09-15 Pedro Alves <palves@redhat.com> PR remote/18965 * gdb.texinfo (Stop Reply Packets): Explain that vforkdone's 'r' part indicates the thread ID of the parent process.
2015-09-15Automatic date update in version.inGDB Administrator1-1/+1
2015-09-14Fix build issue with nat/linux-namespaces.cGary Benson2-6/+13
This commit fixes a build issue on systems with a prototype for setns in their header files but no working setns is detected by configure. gdb/ChangeLog: PR gdb/18957 * nat/linux-namespaces.c (setns): Rename from this ... (do_setns): ... to this. Support calling setns if it exists. (mnsh_handle_setns): Call do_setns.
2015-09-14Automatic date update in version.inGDB Administrator1-1/+1
2015-09-13Automatic date update in version.inGDB Administrator1-1/+1
2015-09-12Automatic date update in version.inGDB Administrator1-1/+1
2015-09-11Automatic date update in version.inGDB Administrator1-1/+1
2015-09-10Automatic date update in version.inGDB Administrator1-1/+1
2015-09-09Automatic date update in version.inGDB Administrator1-1/+1
2015-09-08Automatic date update in version.inGDB Administrator1-1/+1
2015-09-07Automatic date update in version.inGDB Administrator1-1/+1
2015-09-06Automatic date update in version.inGDB Administrator1-1/+1
2015-09-05Automatic date update in version.inGDB Administrator1-1/+1
2015-09-04Automatic date update in version.inGDB Administrator1-1/+1
2015-09-03Automatic date update in version.inGDB Administrator1-1/+1
2015-09-02Automatic date update in version.inGDB Administrator1-1/+1
2015-09-01Automatic date update in version.inGDB Administrator1-1/+1
2015-08-31Automatic date update in version.inGDB Administrator1-1/+1
2015-08-30Automatic date update in version.inGDB Administrator1-1/+1
2015-08-29Automatic date update in version.inGDB Administrator1-1/+1
2015-08-28Bump GDB version number to 7.10.0.DATE-cvs.Joel Brobecker2-1/+5
gdb/ChangeLog: * version.in: Set GDB version number to 7.10.0.DATE-cvs.
2015-08-28Document the GDB 7.10 release in gdb/ChangeLogJoel Brobecker1-0/+4
gdb/ChangeLog: GDB 7.10 released.
2015-08-28Set GDB version number to 7.10.gdb-7.10-releaseJoel Brobecker2-1/+5
gdb/ChangeLog: * version.in: Set GDB version number to 7.10.
2015-08-28gdb/NEWS: Rename "Changes since GDB 7.9" into "Changes in GDB 7.10"Joel Brobecker2-1/+5
This is in preparation for the GDB 7.10 release. gdb/ChangeLog: * NEWS: Rename "Changes since GDB 7.9" into "Changes in GDB 7.10".
2015-08-28Automatic date update in version.inGDB Administrator1-1/+1
2015-08-27Automatic date update in version.inGDB Administrator1-1/+1
2015-08-26Automatic date update in version.inGDB Administrator1-1/+1
2015-08-25signal_command: Leftover cleanup chain regressionJan Kratochvil2-0/+6
gdb/ChangeLog 2015-08-04 Jan Kratochvil <jan.kratochvil@redhat.com> * infcmd.c (signal_command): Call do_cleanups for args_chain.
2015-08-25ASAN attach crash - 7.9 regressionJan Kratochvil2-3/+13
-fsanitize=address gdb.base/attach-pie-noexec.exp ==32586==ERROR: AddressSanitizer: heap-use-after-free on address 0x60200004ed90 at pc 0x48ad50 bp 0x7ffceb3aef50 sp 0x7ffceb3aef20 READ of size 2 at 0x60200004ed90 thread T0 #0 0x48ad4f in __interceptor_strlen (/home/jkratoch/redhat/gdb-test-asan/gdb/gdb+0x48ad4f) #1 0xeafe5c in xstrdup xstrdup.c:33 #2 0x85e024 in attach_command /home/jkratoch/redhat/gdb-test-asan/gdb/infcmd.c:2680 regressed by: commit 6c4486e63f7583ed85a0c72841f6ccceebbf858e Author: Pedro Alves <palves@redhat.com> Date: Fri Oct 17 13:31:26 2014 +0100 PR gdb/17471: Repeating a background command makes it foreground gdb/ChangeLog 2015-08-04 Jan Kratochvil <jan.kratochvil@redhat.com> PR gdb/18767 * infcmd.c (attach_command): Move ARGS_CHAIN cleanup after last ARGS use.
2015-08-25remote: allow aborting long operations (e.g., file transfers)Pedro Alves9-21/+144
Currently, when remote debugging, if you type Ctrl-C just while the target stopped for an internal event, and GDB is busy doing something that takes a while (e.g., fetching chunks of a shared library off of the target, with vFile, to process ELF headers and debug info), the Ctrl-C is lost. The patch hooks up the QUIT macro to a new target method that lets the target react to the double-Ctrl-C before the event loop is reached, which allows reacting to a double-Ctrl-C even when GDB is busy doing some long operation and not waiting for a stop reply. That end result is: (gdb) c Continuing. ^C ^C Interrupted while waiting for the program. Give up waiting? (y or n) y Quit (gdb) info threads Id Target Id Frame * 1 Thread 11673 0x00007ffff7deb240 in _dl_debug_state () from target:/lib64/ld-linux-x86-64.so.2 (gdb) If, however, GDB is waiting for a stop reply (because the target has been resumed, with e.g., vCont;c), but the target isn't responding, we now get: (gdb) c Continuing. ^C ^C The target is not responding to interrupt requests. Stop debugging it? (y or n) y Disconnected from target. (gdb) info threads No threads. This offers to disconnect, because when we're waiting for a stop reply, there's nothing else we can send the target other than an interrupt request. And if that doesn't work, there's nothing else we can do. The Ctrl-C is presently lost because until we get to a user-visible stop, the SIGINT handler that is installed is the one that forwards the interrupt to the remote side, with the \003 "packet" [1]. But, gdbserver ignores an interrupt request if the program is stopped. Still, even if it didn't, the server can only report back a stop-because-of-SIGINT when the program is next resumed. And it may take a while to actually re-resume the target. [1] - In the old sync days, the remote target would react to a double-Ctrl-C by asking users whether they wanted to give up waiting and disconnect. The code is still there, but it it isn't reacheable on most hosts, which support serial connections in async mode (probably only DJGPP doesn't). Even then, in sync mode, remote.c's SIGINT handler is only installed while the target is resumed, and is removed as soon as the target sends back a stop reply. That means that a Ctrl-C just while GDB is processing an internal event can end up with an odd "Quit" at the prompt instead of "Program stopped by SIGINT". In contrast, in async mode, remote.c's SIGINT handler is set up as long as target_terminal_inferior or target_terminal_ours_for_output are in effect (IOW, until we get a user-visible stop and call target_terminal_ours), so the user shouldn't get back a spurious Quit. However, it's still desirable to be able to interrupt a long-running GDB operation, if GDB takes a while to re-resume the target or get back to the event loop. Tested on x86_64 Fedora 20. gdb/ChangeLog: 2015-08-24 Pedro Alves <palves@redhat.com> PR gdb/18804 * defs.h (maybe_quit): Declare. (QUIT): Now calls maybe_quit. * event-loop.c (clear_async_signal_handler) (async_signal_handler_is_marked): New functions. * event-loop.h (async_signal_handler_is_marked) (clear_async_signal_handler): New declarations. * remote.c (remote_check_pending_interrupt): New function. (interrupt_query): Use make_cleanup_restore_target_terminal. No longer check whether the target is async. If waiting for a stop reply, and a Ctrl-C as been sent to the target, offer to disconnect, and throw TARGET_CLOSE_ERROR instead of a quit. Otherwise do not disconnect and throw a quit. (_initialize_remote): Install remote_check_pending_interrupt as to_check_pending_interrupt. * target.c (target_check_pending_interrupt): New function. * target.h (struct target_ops) <to_check_pending_interrupt>: New field. (target_check_pending_interrupt): New declaration. * utils.c (maybe_quit): New function. * target-delegates.c: Regenerate.
2015-08-25Automatic date update in version.inGDB Administrator1-1/+1
2015-08-24Automatic date update in version.inGDB Administrator1-1/+1
2015-08-23Automatic date update in version.inGDB Administrator1-1/+1
2015-08-22Automatic date update in version.inGDB Administrator1-1/+1
2015-08-21Make remote file transfers interruptibleGary Benson2-0/+6
This commit makes it possible to interrupt remote file transfers. gdb/ChangeLog: * gdb_bfd.c (gdb_bfd_iovec_fileio_pread): Add QUIT call.
2015-08-21Warn when accessing binaries from remote targetsGary Benson9-24/+97
GDB provides no indicator of progress during file operations, and can appear to have locked up during slow remote transfers. This commit updates GDB to print a warning each time a file is accessed over RSP. An additional message detailing how to avoid remote transfers is printed for the first transfer only. gdb/ChangeLog: * target.h (struct target_ops) <to_fileio_open>: New argument warn_if_slow. Update comment. All implementations updated. (target_fileio_open_warn_if_slow): New declaration. * target.c (target_fileio_open): Renamed as... (target_fileio_open_1): ...this. New argument warn_if_slow. Pass warn_if_slow to implementation. Update debug printing. (target_fileio_open): New function. (target_fileio_open_warn_if_slow): Likewise. * gdb_bfd.c (gdb_bfd_iovec_fileio_open): Use new function target_fileio_open_warn_if_slow. gdb/testsuite/ChangeLog: * gdb.trace/pending.exp: Cope with remote transfer warnings.
2015-08-21Fix stale cleanup left by linux_mntns_access_fsGary Benson2-1/+6
This commit fixes a stale cleanup left by linux_mntns_access_fs. gdb/ChangeLog: * nat/linux-namespaces.c (linux_mntns_access_fs): Do not overwrite old_chain.
2015-08-21Add readahead cache to gdb's vFile:preadPedro Alves2-4/+149
This patch almost halves the time it takes to "target remote + run to main" on a higher-latency connection. E.g., I've got a ping time of ~85ms to an x86-64 machine on the gcc compile farm (almost 2000km away from me), and I'm behind a ~16Mbit ADSL. When I connect to a gdbserver debugging itself on that machine and run to main, it takes almost 55 seconds: [palves@gcc76] $ ./gdbserver :9999 ./gdbserver [palves@home] $ ssh -L 9999:localhost:9999 gcc76.fsffrance.org [palves@home] $ time ./gdb -data-directory=data-directory -ex "tar rem :9999" -ex "b main" -ex "c" -ex "set confirm off" -ex "quit" Pristine gdb 7.10.50.20150820-cvs gets us: ... Remote debugging using :9999 Reading symbols from target:/home/palves/gdb/build/gdb/gdbserver/gdbserver...done. Reading symbols from target:/lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done. 0x00007ffff7ddd190 in ?? () from target:/lib64/ld-linux-x86-64.so.2 Breakpoint 1 at 0x41200c: file ../../../src/gdb/gdbserver/server.c, line 3635. Continuing. Breakpoint 1, main (argc=1, argv=0x7fffffffe3d8) at ../../../src/gdb/gdbserver/server.c:3635 3635 ../../../src/gdb/gdbserver/server.c: No such file or directory. /home/palves/gdb/build/gdb/gdbserver/gdbserver: No such file or directory. real 0m54.803s user 0m0.329s sys 0m0.064s While with the readahead cache added by this patch, it drops to: real 0m29.462s user 0m0.454s sys 0m0.054s I added a few counters to show cache hit/miss, and got: readahead cache miss 142 readahead cache hit 310 Tested on x86_64 Fedora 20. gdb/ChangeLog: 2015-08-21 Pedro Alves <palves@redhat.com> * remote.c (struct readahead_cache): New. (struct remote_state) <readahead_cache>: New field. (remote_open_1): Invalidate the cache. (readahead_cache_invalidate, readahead_cache_invalidate_fd): New functions. (remote_hostio_pwrite): Invalidate the readahead cache. (remote_hostio_pread): Rename to ... (remote_hostio_pread_vFile): ... this. (remote_hostio_pread_from_cache): New function. (remote_hostio_pread): Reimplement. (remote_hostio_close): Invalidate the readahead cache.
2015-08-21procfs.c: Include "filestuff.h"Marcin Cieslak2-0/+6
Fixes implicit function declaration error in gdb/procfs.c:4927 about undeclared make_cleanup_close(). gdb/ChangeLog: PR build/18843 * procfs.c: Include "filestuff.h".
2015-08-21Automatic date update in version.inGDB Administrator1-1/+1