gdb_server: suggest user to prefer GDB extended mode

In case of GDB connection not using extended mode, issue a warning
message to suggest the user to switch using the extended mode.
Issue the message only once at each run of OpenOCD, to avoid too
much noise.
Update the documentation to suggest using extended mode.

Change-Id: I9326e84f748d5d7912d5a48f00f0fb541ca19221
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5311
Tested-by: jenkins
Reviewed-by: Karl Palsson <karlp@tweak.net.au>
This commit is contained in:
Antonio Borneo
2019-09-27 13:17:15 +02:00
parent 996ff5bcfc
commit e8cfdd4a72
2 changed files with 26 additions and 6 deletions

View File

@@ -3228,6 +3228,7 @@ static int gdb_input_inner(struct connection *connection)
int packet_size;
int retval;
struct gdb_connection *gdb_con = connection->priv;
static bool warn_use_ext;
target = get_target_from_connection(connection);
@@ -3304,6 +3305,12 @@ static int gdb_input_inner(struct connection *connection)
break;
case '?':
gdb_last_signal_packet(connection, packet, packet_size);
/* '?' is sent after the eventual '!' */
if (!warn_use_ext && !gdb_con->extended_protocol) {
warn_use_ext = true;
LOG_WARNING("Prefer GDB command \"target extended-remote %s\" instead of \"target remote %s\"",
connection->service->port, connection->service->port);
}
break;
case 'c':
case 's':