]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Improve vRun error reporting
authorPedro Alves <pedro@palves.net>
Fri, 26 Jan 2024 18:00:42 +0000 (18:00 +0000)
committerPedro Alves <pedro@palves.net>
Fri, 26 Apr 2024 20:22:47 +0000 (21:22 +0100)
commit33befefc3d6bf643af9b521e85feaeff0b06ee7b
tree9ea8ca9c1f7469ae982ae607f3076da58a2b1cce
parente6dad9621d1f3388dd291af53f8ce264d5107c6b
Improve vRun error reporting

After the previous commit, if starting the inferior process with "run"
(vRun packet) fails, GDBserver reports an error using the "E." textual
error packet.  On the GDB side, however, GDB doesn't yet do anything
with the textual error string.  This commit improves that.

This makes remote debugging output the same as native output, when
possible, another small step in the "local/remote parity" project.

E.g., before, against GNU/Linux GDBserver:

  (gdb) run
  Starting program: .../gdb.base/run-fail-twice/run-fail-twice.nox
  Running ".../gdb.base/run-fail-twice/run-fail-twice.nox" on the remote target failed

After, against GNU/Linux GDBserver (same as native):

  (gdb) run
  Starting program: .../gdb.base/run-fail-twice/run-fail-twice.nox
  During startup program exited with code 126.

To know whether we have a textual error message, extend packet_result
to carry that information.  While at it, convert packet_result to use
factory methods, and change its std::string parameter to a plain const
char *, as that it always what we have handy to pass to it.

Change-Id: Ib386f267522603f554b52a885b15229c9639e870
Approved-By: Tom Tromey <tom@tromey.com>
gdb/remote.c