This is an automated email from Gerrit.

"Ian Thompson <ia...@cadence.com>" just uploaded a new patch set to Gerrit, 
which you can find at https://review.openocd.org/c/openocd/+/7102

-- gerrit

commit af75954b1daae3bf8d91a5f5f84d8dac76021fc7
Author: Ian Thompson <ia...@cadence.com>
Date:   Mon Aug 1 15:22:32 2022 -0700

    gdb_server: add "not supported" Z-packet reply
    
    GDB remote serial protocol specifies breakpoint/watchpoint packet responses 
can be an empty string to indicate the specified breakpoint type is not 
supported.  Add support for this response alongside existing "OK", "E NN" 
replies.
    
    Signed-off-by: Ian Thompson <ia...@cadence.com>
    Change-Id: Iaf6280e4c936eb95a92bc80cc74d451ebb328dc3

diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c
index 2e6c7304dd..b7c2d7ac4c 100644
--- a/src/server/gdb_server.c
+++ b/src/server/gdb_server.c
@@ -1770,7 +1770,10 @@ static int gdb_breakpoint_watchpoint_packet(struct 
connection *connection,
                case 1:
                        if (packet[0] == 'Z') {
                                retval = breakpoint_add(target, address, size, 
bp_type);
-                               if (retval != ERROR_OK) {
+                               if (retval == ERROR_TARGET_INVALID) {
+                                       /* Send empty reply to report that 
breakpoints of this type are not supported */
+                                       gdb_put_packet(connection, "", 0);
+                               } else if (retval != ERROR_OK) {
                                        retval = gdb_error(connection, retval);
                                        if (retval != ERROR_OK)
                                                return retval;
@@ -1787,7 +1790,10 @@ static int gdb_breakpoint_watchpoint_packet(struct 
connection *connection,
                {
                        if (packet[0] == 'Z') {
                                retval = watchpoint_add(target, address, size, 
wp_type, 0, 0xffffffffu);
-                               if (retval != ERROR_OK) {
+                               if (retval == ERROR_TARGET_INVALID) {
+                                       /* Send empty reply to report that 
breakpoints of this type are not supported */
+                                       gdb_put_packet(connection, "", 0);
+                               } else if (retval != ERROR_OK) {
                                        retval = gdb_error(connection, retval);
                                        if (retval != ERROR_OK)
                                                return retval;

-- 

Reply via email to