From d226e2a99f2f3deb655a2e32d36878f9504c68aa Mon Sep 17 00:00:00 2001 From: nnayo Date: Mon, 3 Mar 2014 14:55:19 +0100 Subject: [PATCH] fix gdb error message: Cannot remove breakpoints because program is no longer writable. --- simavr/sim/sim_gdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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]; } -- 2.39.5