gdb_server: Fix confusing warning when entering noack mode 95/1895/3
authorAnton Kolesov <anton.kolesov@synopsys.com>
Wed, 22 Jan 2014 16:18:56 +0000 (20:18 +0400)
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>
Thu, 6 Feb 2014 22:20:29 +0000 (22:20 +0000)
commite4125d136c72b1225c4547e670db102f88cf6efc
tree66218154ac1542f04a92b989590ea3955c17b10c
parent32c4c18045599ddfed36f52b276166ce932b1bf7
gdb_server: Fix confusing warning when entering noack mode

Comment in gdb_server code mistakenly attributed constant warnings
about unexpected acknowledgement to the ACK packet sent by GDB when
establishing connection. However that is not the case, OpenOCD
gdb_server is handling this packet correctly without an warnings. This
warning instead was caused by the ACK packet which GDB sends right after
going into noack mode. Because OpenOCD gdb_server is already in noack
mode at this state, it emits warning about it. This is a documented GDB
behaviour
(https://sourceware.org/gdb/onlinedocs/gdb/Packet-Acknowledgment.html)
so there is no reason to scare users with warnings in this case.

This patch basically introduces two-level noack mode: after receiving
QStartNoAckMode gdb_server will set noack_mode to 1, then it will
receive this last ACK packet, but instead of printing a warning,
noack_mode will be increased to 2. Should there be any other ACK packets
after that, they will be properly reported by warning. All other code
that relies on noack_mode checks it for "!= 0", so there will be no
difference if it is 1 or 2.

Change-Id: I0e9c57fd93293bfe010390db2f3f161528b11d86
Signed-off-by: Anton Kolesov <anton.kolesov@synopsys.com>
Reviewed-on: http://openocd.zylin.com/1895
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
src/server/gdb_server.c

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)