Fix watchpoint support
authorMichael Pratt <michael@pratt.im>
Sun, 19 Aug 2012 16:19:25 +0000 (12:19 -0400)
committerMichael Pratt <michael@pratt.im>
Sun, 19 Aug 2012 16:19:25 +0000 (12:19 -0400)
Setting of watchpoints was nested inside of a case statement, so it
would only run for that case, even though it supports all cases.

gdbserver/gdb-server.c

index ae06952bf83041f633803a7fd01a0b2393c511a4..e6368ea31be09a357306765de555c3c924cfa741 100644 (file)
@@ -1108,13 +1108,14 @@ int serve(stlink_t *sl, int port) {
                                                wf = WATCHREAD;
                                        } else {
                                                wf = WATCHACCESS;
-                                               if(add_data_watchpoint(sl, wf, addr, len) < 0) {
-                                                       reply = strdup("E00");
-                                               } else {
-                                                       reply = strdup("OK");
-                                                       break;
-                                               }
                                        }
+
+                    if(add_data_watchpoint(sl, wf, addr, len) < 0) {
+                        reply = strdup("E00");
+                    } else {
+                        reply = strdup("OK");
+                        break;
+                    }
                                }
 
                                default: