Commit Graph

15 Commits

Author SHA1 Message Date
Alexandra Hájková
280cdb642b gdbreplay: Calculate the checksum if missing
Recalculate the checksum and replace whatever is at the end
of the packet with the newly calculated checksum. Then
replay the packet with the checksum added.

The motivation for this change is that I'd like to add a TCL test
which starts a communication with gdbsever setting the remotelog file.
Then, it modifies the remotelog, injects an error message instead of
the expected replay to some packet in order to test GDB reacts to
the error response properly.

Approved-By: Tom Tromey <tom@tromey.com>
2024-11-25 16:58:52 +01:00
Alexandra Hájková
0cb7f3a837 gdbreplay: Add --debug-logging option
As gdbreplay communicates with GDB, it outputs all the remote
protocol communication it reads from the remotelogfile to stderr.
This patch disables this behavior by default but adds the new
--debug-logging option which turns printing the packets
to stderr on again.

The motivation for this change is to make it possible to use
gdbreplay with TCL tests. Printing the whole remotelog file out
seems to overflow the expect cache wich causes gdbreplay to not
to get the packet its expects and results in going out of sync
with GDB. Other motivation is making communication between GDB
and gdbreplay faster as printing bigger remotelogfile takes
considerable amount of time.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Approved-By: Tom Tromey <tom@tromey.com>
2024-10-21 16:38:18 +02:00
Alexandra Hájková
32ffcd0737 gdbreplay: Use getopt_long to parse command line arguments
Approved-By: Tom Tromey <tom@tromey.com>
2024-10-21 16:38:09 +02:00
Simon Marchi
d9deb60b2e gdb, gdbserver, gdbsupport: use [[noreturn]] instead of ATTRIBUTE_NORETURN
C++ 11 has a built-in attribute for this, no need to use a compat macro.

Change-Id: I90e4220d26e8f3949d91761f8a13cd9c37da3875
Reviewed-by: Lancelot Six <lancelot.six@amd.com>
2024-07-16 18:30:45 -04:00
Simon Marchi
18d2988e5d gdb, gdbserver, gdbsupport: remove includes of early headers
Now that defs.h, server.h and common-defs.h are included via the
`-include` option, it is no longer necessary for source files to include
them.  Remove all the inclusions of these files I could find.  Update
the generation scripts where relevant.

Change-Id: Ia026cff269c1b7ae7386dd3619bc9bb6a5332837
Approved-By: Pedro Alves <pedro@palves.net>
2024-03-26 21:13:22 -04:00
Andrew Burgess
1d506c26d9 Update copyright year range in header of all files managed by GDB
This commit is the result of the following actions:

  - Running gdb/copyright.py to update all of the copyright headers to
    include 2024,

  - Manually updating a few files the copyright.py script told me to
    update, these files had copyright headers embedded within the
    file,

  - Regenerating gdbsupport/Makefile.in to refresh it's copyright
    date,

  - Using grep to find other files that still mentioned 2023.  If
    these files were updated last year from 2022 to 2023 then I've
    updated them this year to 2024.

I'm sure I've probably missed some dates.  Feel free to fix them up as
you spot them.
2024-01-12 15:49:57 +00:00
Joel Brobecker
e1ca55341c Update copyright year in help message of gdb, gdbserver, gdbreplay
This commit updates the copyright year displayed by gdb, gdbserver
and gdbreplay's help message from 2022 to 2023, as per our Start
of New Year procedure. The corresponding source files' copyright
header are also updated accordingly.
2023-01-01 17:01:15 +04:00
Joel Brobecker
4a94e36819 Automatic Copyright Year update after running gdb/copyright.py
This commit brings all the changes made by running gdb/copyright.py
as per GDB's Start of New Year Procedure.

For the avoidance of doubt, all changes in this commits were
performed by the script.
2022-01-01 19:13:23 +04:00
Joel Brobecker
dd10f20452 Update Copyright Year in gdb, gdbserver and gdbreplay version output
This commit changes the copyright year printed by gdb, gdbserver
and gdbreplay when printing the tool's version.
2022-01-01 19:13:22 +04:00
Pedro Alves
6cacd44948 Remove WinCE code from gdbreplay
gdbserver/ChangeLog:

	* gdbreplay.c [__MINGW32CE__] (COUNTOF, errno, strerror): Remove.
2021-04-13 22:18:24 +01:00
Tom Tromey
77fba254d9 Add stdio support to gdbreplay
I've been using gdbreplay to help debug an intermittent failure, and I
wanted it to be a little simpler to use.  This patch adds support for
"-" as the "address" argument.  With this patch you can do:

    (gdb) target remote | gdbreplay logfile -

... and not have to start gdbreplay in a separate shell.

2021-02-12  Tom Tromey  <tromey@adacore.com>

	* gdbreplay.cc (remote_desc): Remove.
	(remote_desc_in, remote_desc_out): New globals.
	(remote_close): Update.
	(remote_open): Handle "-".
	(remote_open): Update.
	(logchar): Log to stderr.
	(expect, play): Update.
2021-02-12 12:45:51 -07:00
Tom Tromey
c054dcd552 Minor constification in gdbreplay
I noticed a spot in gdbreplay where "const" could be used.

2021-02-12  Tom Tromey  <tromey@adacore.com>

	* gdbreplay.cc (remote_open): Constify.
2021-02-12 10:26:43 -07:00
Joel Brobecker
3666a04883 Update copyright year range in all GDB files
This commits the result of running gdb/copyright.py as per our Start
of New Year procedure...

gdb/ChangeLog

        Update copyright year range in copyright header of all GDB files.
2021-01-01 12:12:21 +04:00
Joel Brobecker
2b47c078fd Update copyright year in version message for gdb, gdbserver and gdbreplay
gdb/ChangeLog:

        * top.c (print_gdb_version): Update copyright year.

gdbserver/ChangeLog:

        * server.cc (gdbserver_version): Update copyright year.
        * gdbreplay.cc (gdbreplay_version): Likewise.
2021-01-01 11:53:14 +04:00
Simon Marchi
feacfcacaa gdbserver: rename source files to .cc
For the same reasons outlined in the previous patch, this patch renames
gdbserver source files to .cc.

I have moved the "-x c++" switch to only those rules that require it.

gdbserver/ChangeLog:

	* Makefile.in: Rename source files from .c to .cc.
	* %.c: Rename to %.cc.
	* configure.ac: Rename server.c to server.cc.
	* configure: Re-generate.
2020-02-13 16:27:51 -05:00