head 1.1; branch 1.1.1; access; symbols netbsd-11-0-RC6:1.1.1.1 netbsd-11-0-RC5:1.1.1.1 netbsd-11-0-RC4:1.1.1.1 netbsd-11-0-RC3:1.1.1.1 gdb-17-1:1.1.1.2 netbsd-11-0-RC2:1.1.1.1 netbsd-11-0-RC1:1.1.1.1 gdb-16-3:1.1.1.2 perseant-exfatfs-base-20250801:1.1.1.1 netbsd-11:1.1.1.1.0.10 netbsd-11-base:1.1.1.1 netbsd-10-1-RELEASE:1.1.1.1 gdb-15-1:1.1.1.1 perseant-exfatfs-base-20240630:1.1.1.1 perseant-exfatfs:1.1.1.1.0.8 perseant-exfatfs-base:1.1.1.1 netbsd-10-0-RELEASE:1.1.1.1 netbsd-10-0-RC6:1.1.1.1 netbsd-10-0-RC5:1.1.1.1 netbsd-10-0-RC4:1.1.1.1 netbsd-10-0-RC3:1.1.1.1 netbsd-10-0-RC2:1.1.1.1 netbsd-10-0-RC1:1.1.1.1 gdb-13-2:1.1.1.1 netbsd-10:1.1.1.1.0.6 netbsd-10-base:1.1.1.1 cjep_sun2x-base1:1.1.1.1 cjep_sun2x:1.1.1.1.0.4 cjep_sun2x-base:1.1.1.1 cjep_staticlib_x-base1:1.1.1.1 cjep_staticlib_x:1.1.1.1.0.2 cjep_staticlib_x-base:1.1.1.1 GDB-11-0-50-20200914-git:1.1.1.1 FSF:1.1.1; locks; strict; comment @# @; 1.1 date 2020.09.15.01.43.49; author christos; state Exp; branches 1.1.1.1; next ; commitid N511ReXja24bg5oC; 1.1.1.1 date 2020.09.15.01.43.49; author christos; state Exp; branches; next 1.1.1.2; commitid N511ReXja24bg5oC; 1.1.1.2 date 2025.08.27.17.30.35; author christos; state Exp; branches; next ; commitid vgUAu9EQfEWNko8G; desc @@ 1.1 log @Initial revision @ text @ README for GDBserver & GDBreplay by Stu Grossman and Fred Fish Introduction: This is GDBserver, a remote server for Un*x-like systems. It can be used to control the execution of a program on a target system from a GDB on a different host. GDB and GDBserver communicate using the standard remote serial protocol. They communicate via either a serial line or a TCP connection. For more information about GDBserver, see the GDB manual: https://sourceware.org/gdb/current/onlinedocs/gdb/Remote-Protocol.html Usage (server (target) side): First, you need to have a copy of the program you want to debug put onto the target system. The program can be stripped to save space if needed, as GDBserver doesn't care about symbols. All symbol handling is taken care of by the GDB running on the host system. To use the server, you log on to the target system, and run the `gdbserver' program. You must tell it (a) how to communicate with GDB, (b) the name of your program, and (c) its arguments. The general syntax is: target> gdbserver COMM PROGRAM [ARGS ...] For example, using a serial port, you might say: target> gdbserver /dev/com1 emacs foo.txt This tells GDBserver to debug emacs with an argument of foo.txt, and to communicate with GDB via /dev/com1. GDBserver now waits patiently for the host GDB to communicate with it. To use a TCP connection, you could say: target> gdbserver host:2345 emacs foo.txt This says pretty much the same thing as the last example, except that we are going to communicate with the host GDB via TCP. The `host:2345' argument means that we are expecting to see a TCP connection to local TCP port 2345. (Currently, the `host' part is ignored.) You can choose any number you want for the port number as long as it does not conflict with any existing TCP ports on the target system. This same port number must be used in the host GDB's `target remote' command, which will be described shortly. Note that if you chose a port number that conflicts with another service, GDBserver will print an error message and exit. On some targets, GDBserver can also attach to running programs. This is accomplished via the --attach argument. The syntax is: target> gdbserver --attach COMM PID PID is the process ID of a currently running process. It isn't necessary to point GDBserver at a binary for the running process. Usage (host side): You need an unstripped copy of the target program on your host system, since GDB needs to examine it's symbol tables and such. Start up GDB as you normally would, with the target program as the first argument. (You may need to use the --baud option if the serial line is running at anything except 9600 baud.) Ie: `gdb TARGET-PROG', or `gdb --baud BAUD TARGET-PROG'. After that, the only new command you need to know about is `target remote'. It's argument is either a device name (usually a serial device, like `/dev/ttyb'), or a HOST:PORT descriptor. For example: (gdb) target remote /dev/ttyb communicates with the server via serial line /dev/ttyb, and: (gdb) target remote the-target:2345 communicates via a TCP connection to port 2345 on host `the-target', where you previously started up GDBserver with the same port number. Note that for TCP connections, you must start up GDBserver prior to using the `target remote' command, otherwise you may get an error that looks something like `Connection refused'. Building GDBserver: See the `configure.srv` file for the list of host triplets you can build GDBserver for. Building GDBserver for your host is very straightforward. If you build GDB natively on a host which GDBserver supports, it will be built automatically when you build GDB. You can also build just GDBserver: % mkdir obj % cd obj % path-to-toplevel-sources/configure --disable-gdb % make all-gdbserver (If you have a combined binutils+gdb tree, you may want to also disable other directories when configuring, e.g., binutils, gas, gold, gprof, and ld.) If you prefer to cross-compile to your target, then you can also build GDBserver that way. For example: % export CC=your-cross-compiler % path-to-topevel-sources/configure --disable-gdb % make all-gdbserver Using GDBreplay: A special hacked down version of GDBserver can be used to replay remote debug log files created by GDB. Before using the GDB "target" command to initiate a remote debug session, use "set remotelogfile " to tell GDB that you want to make a recording of the serial or tcp session. Note that when replaying the session, GDB communicates with GDBreplay via tcp, regardless of whether the original session was via a serial link or tcp. Once you are done with the remote debug session, start GDBreplay and tell it the name of the log file and the host and port number that GDB should connect to (typically the same as the host running GDB): $ gdbreplay logfile host:port Then start GDB (preferably in a different screen or window) and use the "target" command to connect to GDBreplay: (gdb) target remote host:port Repeat the same sequence of user commands to GDB that you gave in the original debug session. GDB should not be able to tell that it is talking to GDBreplay rather than a real target, all other things being equal. Note that GDBreplay echos the command lines to stderr, as well as the contents of the packets it sends and receives. The last command echoed by GDBreplay is the next command that needs to be typed to GDB to continue the session in sync with the original session. @ 1.1.1.1 log @Import head of gdb as of 2020-09-14 requested by Kamil 2020-07-24 Aaron Merey * configure: Rebuild. * configure.ac: Remove AC_DEBUGINFOD. 2020-07-04 Nick Clifton Binutils 2.35 branch created. 2020-04-21 Stephen Casner PR 25830 * configure.ac (noconfigdirs): Exclude gdb & gprof for pdp11. * configure: Rebuild. 2020-03-12 Tom Tromey * Makefile.in: Rebuild. * Makefile.def (gdbserver): Depend on gdbsupport. 2020-03-12 Tom Tromey * Makefile.in: Rebuild. * Makefile.def (gdbsupport): Don't depend on bfd. 2020-03-12 Tom Tromey * Makefile.in: Rebuild. * Makefile.def (gdbsupport): Depend on intl. 2020-02-17 Tom Tromey * configure: Rebuild. * configure.ac (configdirs): Add gnulib and gdbsupport when building gdbserver. 2020-02-14 Tom Tromey * Makefile.in: Rebuild. * Makefile.def: Make gdbserver require gnulib and libiberty. 2020-02-07 Tom Tromey Pedro Alves * src-release.sh (GDB_SUPPORT_DIRS): Add gdbserver. * gdbserver: New directory, moved from gdb/gdbserver. * configure.ac (host_tools): Add gdbserver. Only build gdbserver on certain systems. * Makefile.in, configure: Rebuild. * Makefile.def (host_modules, dependencies): Add gdbserver. * MAINTAINERS: Add gdbserver. 2020-01-28 Sergio Durigan Junior * src-release.sh (getver): Look for gdbsupport's create-version.sh script at the current directory if tool is "gdb". 2020-01-19 Simon Marchi * remote-sim.c (gdbsim_target::wait): Return sim_data->remote_sim_ptid instead of inferior_ptid. 2020-01-18 Nick Clifton Binutils 2.34 branch created. 2020-01-18 Nick Clifton Synchronize top level configure files with master version: 2020-01-01 Ben Elliston * config.guess: Update copyright years. * config.sub: Likewise. 2019-12-21 Ben Elliston * config.guess (set_cc_for_build): Prevent multiple calls by checking if $tmp is already set. We can't check CC_FOR_BUILD as the user may set it externally. Thanks to Torbjörn Granlund for the bug report. 2019-12-21 Torbjörn Granlund * config.guess (alpha:Linux:*:*): Guard against missing /proc/cpuinfo by redirecting standard error to /dev/null. 2019-09-12 Daniel Bittman * config.guess (*:Twizzler:*:*): New. * config.sub (-twizzler*): New. 2019-07-24 Ben Elliston * config.guess (mips:OSF1:*.*): Whitespace cleanup. 2019-06-30 Ben Elliston * config.sub (case $os): Match nsk* and powerunix. Don't later match nsk* and set os=nsk which removes the OS version number. 2019-06-30 Ben Elliston * config.sub: Recognise os108*. 2019-06-26 Ben Elliston * config.sub (hp300): Set $os to hpux. 2019-06-26 Ben Elliston * config.sub (vsta): Move into alphabetical order. 2019-06-10 Ben Elliston * config.guess (*:OS108:*:*): Recognise new OS. 2019-05-28 Ben Elliston * config.guess (*:Darwin:*:*): Run xcode-select to determine if a system compiler is installed. If not, do not run set_cc_for_build, as the default cc will open a dialog box asking to install Xcode. If no C compiler is available, guess based on uname -p and uname -m. 2019-05-28 Ben Elliston * config.guess (*:Darwin:*:*): Simplify UNAME_PROCESSOR. 2020-01-17 Simon Marchi * Makefile.def: Add dependencies of all-gdbsupport on all-bfd. * Makefile.in: Re-generate. 2020-01-14 Tom Tromey * src-release.sh (GDB_SUPPORT_DIRS): Add gdbsupport. * MAINTAINERS: Add gdbsupport. * configure: Rebuild. * configure.ac (configdirs): Add gdbsupport. * gdbsupport: New directory, move from gdb/gdbsupport. * Makefile.def (host_modules, dependencies): Add gnulib. * Makefile.in: Rebuild. 2020-01-09 Aaron Merey * config/debuginfod.m4: New file. Add macro AC_DEBUGINFOD. Adds new configure option --with-debuginfod. * configure: Regenerate. * configure.ac: Call AC_DEBUGINFOD. 2019-12-26 Christian Biesinger * .gitignore: Add perf.data and perf.data.old. 2019-10-17 Sergio Durigan Junior * src-release.sh (GDB_SUPPORT_DIRS): Add libctf. 2019-10-17 Alan Modra PR 29 * src-release.sh (getver): Replace "head -1" with "head -n 1". 2019-07-30 Nick Alcock * Makefile.def (host_modules): libctf is no longer no_install. * Makefile.in: Regenerated. 2019-07-13 Nick Alcock * Makefile.def (dependencies): all-ld depends on all-libctf. * Makefile.in: Regenerated. 2019-09-09 Phil Blundell binutils 2.33 branch created 2019-08-19 Tom Tromey * configure: Rebuild. * configure.ac: Add --with-static-standard-libraries. 2019-08-09 Nick Clifton * libiberty: Sync with gcc. Bring in: 2019-08-08 Martin Liska PR bootstrap/91352 * lrealpath.c (is_valid_fd): New function. 2019-07-24 Martin Liska PR lto/91228 * simple-object-elf.c (simple_object_elf_copy_lto_debug_sections): Find first '\0' starting from gnu_lto + 1. 2019-07-12 Ren Kimura * simple-object-elf.c (simple_object_elf_match): Check zero value shstrndx. This fixes a Bug 90924. 2019-07-22 Martin Liska * simple-object-elf.c (simple_object_elf_copy_lto_debug_sections): Do not search for gnu_lto_v1, but search for first '\0'. 2019-07-18 Eduard-Mihai Burtescu * cplus-dem.c: Include rust-demangle.h. * rust-demangle.c: Include rust-demangle.h. * rust-demangle.h: New file. 2019-05-31 Michael Forney * cp-demangle.c: Don't define CP_DYNAMIC_ARRAYS if __STDC_NO_VLA__ is non-zero. 2019-04-30 Ben L * d-demangle.c (dlang_parse_assocarray): Correctly handle error result. * testsuite/d-demangle-expected: Add testcase. * d-demangle.c (dlang_parse_tuple): Correctly handle error result. * testsuite/d-demangle-expected: Add testcase. * d-demangle.c (dlang_parse_structlit): Correctly handle error result. * testsuite/d-demangle-expected: Add testcase. * d-demangle.c (dlang_parse_arrayliteral): Correctly handle error result. * testsuite/d-demangle-expected: Add testcase. * d-demangle.c (dlang_parse_integer): Fix stack underflow. * testsuite/d-demangle-expected: Add testcase. * cp-demangle (d_print_comp_inner): Guard against a NULL 'typed_name'. * testsuite/demangle-expected: Add testcase. * cp-demangle.c (d_encoding): Guard against NULL return values from d_right (dc). * testsuite/demangle-expected: Add testcase. 2019-04-29 Ben L * cp-demangle.c (d_expression_1): Don't peek ahead unless the current char is valid. * testsuite/demangle-expected: Add testcase. 2019-04-10 Nick Clifton PR 89394 * cp-demangle.c (cplus_demangle_fill_name): Reject negative lengths. (d_count_templates_scopes): Replace num_templates and num_scopes parameters with a struct d_print_info pointer parameter. Adjust body of the function accordingly. Add recursion counter and check that the recursion limit is not reached. (d_print_init): Pass dpi parameter to d_count_templates_scopes. Reset recursion counter afterwards, unless the recursion limit was reached. 2019-07-13 Joel Brobecker * src-release (getver): If $tool/gdbsupport/create-version.sh exists, use that to determine the version number. 2019-06-21 Andreas Schwab * src-release.sh (GDB_SUPPORT_DIRS): Add gnulib. 2019-06-14 Tom Tromey * MAINTAINERS: Add gnulib. * gnulib: New directory, move from gdb/gnulib. * configure.ac (host_libs): Add gnulib. * configure: Rebuild. * Makefile.def (host_modules, dependencies): Add gnulib. * Makefile.in: Rebuild. 2019-06-03 Nick Clifton Revert: 2019-05-29 Nick Clifton * configure.ac (noconfigdirs): Add libctf if the target does not use the ELF file format. * configure: Regenerate. 2019-05-29 Nick Clifton * src-release.sh (do_proto_toplev): Add libctf to list of directories that can be disabled. 2019-05-29 Nick Clifton * configure.ac (noconfigdirs): Add libctf if the target does not use the ELF file format. * configure: Regenerate. 2019-05-28 Nick Alcock * Makefile.def (dependencies): configure-libctf depends on all-bfd and all its deps. * Makefile.in: Regenerated. 2019-05-28 Nick Alcock * MAINTAINERS: Add libctf. 2019-05-28 Nick Alcock * Makefile.def (host_modules): Add libctf. * Makefile.def (dependencies): Likewise. libctf depends on zlib, libiberty, and bfd. * Makefile.in: Regenerated. * configure.ac (host_libs): Add libctf. * configure: Regenerated. 2019-05-23 Jose E. Marchesi * config.guess: Synchronize with config project master sources. * config.sub: Likewise. * readline/support/config.guess: Likewise. * readline/support/config.sub: Likewise. 2019-04-10 Nick Clifton * libiberty: Sync with gcc. Bring in: 2019-04-10 Nick Clifton PR 89394 * cp-demangle.c (cplus_demangle_fill_name): Reject negative lengths. (d_count_templates_scopes): Replace num_templates and num_scopes parameters with a struct d_print_info pointer parameter. Adjust body of the function accordingly. Add recursion counter and check that the recursion limit is not reached. (d_print_init): Pass dpi parameter to d_count_templates_scopes. Reset recursion counter afterwards, unless the recursion limit was reached. 2018-06-24 Nick Clifton 2.32 branch created. 2019-01-14 Rainer Orth Merge from GCC: PR target/88535 * config.guess: Import upstream version 2019-01-03. * config.sub: Import upstream version 2019-01-01. 2019-01-10 Nick Clifton * libiberty: Sync with gcc. Bring in: 2019-01-09 Sandra Loosemore PR other/16615 * cp-demangle.c: Mechanically replace "can not" with "cannot". * floatformat.c: Likewise. * strerror.c: Likewise. 2018-12-22 Jason Merrill Remove support for demangling GCC 2.x era mangling schemes. * cplus-dem.c: Remove cplus_mangle_opname, cplus_demangle_opname, internal_cplus_demangle, and all subroutines. (libiberty_demanglers): Remove entries for ancient GNU (pre-3.0), Lucid, ARM, HP, and EDG demangling styles. (cplus_demangle): Remove 'work' variable. Don't call internal_cplus_demangle. 2019-01-03 Дилян Палаузов * configure.ac: Don't configure readline if --with-system-readline is used. * configure: Re-generate. @ text @@ 1.1.1.2 log @Import gdb 16.3; previous was 15.1 April 20th, 2025: GDB 16.3 Released! The latest version of GDB, version 16.3, is available for download. This is a corrective release over GDB 16.2, fixing the following issues: PR symtab/32309 ([gdb/symtab, fission] gdb/dwarf2/read.h:289: internal-error: version: Assertion `m_dwarf_version != 0' failed) PR corefiles/32441 (gdb segfaults when generating a core file if target_fileio_read_alloc fails) PR tui/32623 (TUI console window doesn't update while inferior is running) PR corefiles/32634 ([gdb/corefiles] segfault in gdb.arch/i386-biarch-core.exp) PR backtrace/32757 ("Assertion `stashed' failed" when inline frame #0 is duplicated) PR tdep/32770 ([gdb/tdep, i386] FAIL: gdb.reverse/recvmsg-reverse.exp: continue to breakpoint: marker2) PR gdb/32775 ([AArch64] gdbserver crashes on SVE/SME-enabled systems) PR record/32784 ([gdb/record, aarch64] Stack smashing detected in aarch64_record_asimd_load_store) PR tui/32797 (Escape sequences to only reset foreground or background color to default fail) PR gdb/32828 (gstack regression: missing file names and line numbers) See the NEWS file for a more complete and detailed list of what this release includes. February 1st, 2025: GDB 16.2 Released! The latest version of GDB, version 16.2, is available for download. This is a corrective release over GDB 16.1, fixing the following issues: PR build/32578 (cannot build GDB 16.1 out of tree when calling the configure script with a relative path) PR tui/32592 ([gdb/tui] internal error in tui-winsource.c:340:refresh_window) PR remote/32593 (Incompatibilities between GDB's and LLDB's 'x' packet implementation) PR build/32610 (Missing #include file in darwin_nat.c) See the NEWS file for a more complete and detailed list of what this release includes. January 18th, 2025: GDB 16.1 Released! The latest version of GDB, version 16.1, is available for download. This version of GDB includes the following changes and enhancements: record/replay support now available on loongarch*-linux* GDB now supports watchpoints for tagged data pointers. MTE (Memory Tagging Extension) debugging is now supported on AArch64 baremetal. New bash script gstack uses GDB to print stack traces of running processes. Enhanced breakpoint support For breakpoints that are created in the 'pending' state, any 'thread' or 'task' keywords are parsed at the time the breakpoint is created, rather than at the time the breakpoint becomes non-pending. Thread-specific breakpoints are only inserted into the program space in which the thread of interest is running. Enhanced Intel Processor Trace support Support for printing of asynchronous events Support for printing of ptwrite payloads Changed commands The "remove-symbol-file -a ADDRESS" command now accepts a full expression as the ADDRESS. The "show configuration" command now prints the version of GNU readline that GDB is using. The "maintenance print remote-registers" now provides an "Expedited" column indicating which registers were included in the last stop reply packet received by GDB. Various command taking filenames as argument now require file names to be quoted if the argument contains white spaces or quote characters. Python API changes New module gdb.missing_objfile that facilitates dealing with missing objfiles when opening a core-file. GDB commands to query, enable and disable handlers created using this API have also been added. New event gdb.tui_enabled. Added the gdb.Symbol.is_artificial attribute. New gdb.record.clear function to clear the trace data of the current recording. The 'signed' argument to gdb.Architecture.integer_type() will no longer accept non-bool types. The gdb.MICommand.installed property can only be set to True or False. The 'qualified' argument to gdb.Breakpoint constructor will no longer accept non-bool types. Debugger Adapter Protocol changes The "scopes" request will now return a scope holding global variables from the stack frame's compilation unit. The "scopes" request will return a "returnValue" scope holding the return value from the latest "stepOut" command, when appropriate. The "launch" and "attach" requests were rewritten in accordance with some clarifications to the spec. Now they can be sent at any time after the "initialized" event, but will not take effect (or send a response) until after the "configurationDone" request has been sent. The "variables" request will not return artificial symbols. Remote Protocol New remote packet: vFile:stat New remote packet: x addr,length Miscellaneous The Ada 'Object_Size attribute is now supported. Styling now available for line numbers, GDB commands and header lines of lists. It is now possible to turn the warning emitted when specifying a language that does not match the current frame off. For ARM targets, the offset of the pc in the jmp_buf has been fixed to match glibc 2.20 and later. This should only matter when not using libc probes. This may cause breakage when using an incompatible libc, like uclibc or newlib, or an older glibc. Deprecated or removed Support for QNX Neutrino has been removed Support for Nios II targets has been removed Support for Intel MPX has been removed See the NEWS file for a more complete and detailed list of what this release includes. December 29th, 2024: GDB 16 branch created The GDB 16 branch (gdb-16-branch) has been created. To check out a copy of the branch use: git clone --branch gdb-16-branch https://sourceware.org/git/binutils-gdb.git September 29th, 2024: GDB 15.2 Released! The latest version of GDB, version 15.2, is available for download. This is a minor corrective release over GDB 15.1, fixing the following issues: PR gdb/31727 (-exec-next fails in mingw (infrun.c:2794: internal-error: resume_1: Assertion `pc_in_thread_step_range (pc, tp)' failed)) PR c++/31900 (libstdc++-prettyprinters/debug.cc print redirected fails since gdb-14-branchpoint-2123-g4e417d7bb1c) PR python/31946 (sys.exit from Python no longer exits the GDB process) PR record/31971 (Loading a saved record file asserts if we try to execute the inferior) PR gdb/32005 (frv_current_sos doesn't set solib::lm_info) PR exp/32015 (GDB crashes while printing large D array) PR gdb/32025 (Fatal error when the disassemble command is interrupted with SIGINT) PR gdb/32143 ([15 Regression] arch/amd64.c:71: internal-error: amd64_create_target_description: Assertion `!is_x32' failed) PR symtab/32158 ([gdb/symtab] enum class enumerator has incorrect parent in cooked index) PR symtab/32160 ([gdb/symtab] Parent map: die parent or scope parent?) See the NEWS file for a more complete and detailed list of what this release includes. @ text @d128 5 a132 6 to GDBreplay rather than a real target, all other things being equal. As GDBreplay communicates with GDB, it outputs only the commands it expects from GDB. The --debug-logging option turns printing the remotelogfile to stderr on. GDBreplay then echos the command lines to stderr, as well as the contents of the packets it sends and receives. @