From: nnayo Date: Mon, 3 Mar 2014 13:55:19 +0000 (+0100) Subject: fix gdb error message: Cannot remove breakpoints because program is no longer writable. X-Git-Tag: v1.2~20^2 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=d226e2a99f2f3deb655a2e32d36878f9504c68aa;p=sx%2Fsimavr.git fix gdb error message: Cannot remove breakpoints because program is no longer writable. --- diff --git a/simavr/sim/sim_gdb.c b/simavr/sim/sim_gdb.c index 95ca3b3..80be31a 100644 --- a/simavr/sim/sim_gdb.c +++ b/simavr/sim/sim_gdb.c @@ -127,8 +127,8 @@ gdb_watch_add_or_update( w->len++; - /* Make space for new element. */ - for (int j = i + 1; j < w->len; j++) { + /* Make space for new element, moving old ones from the end. */ + for (int j = w->len; j > i; j--) { w->points[j] = w->points[j - 1]; }