From: Manfred Steiner Date: Sun, 27 Nov 2022 17:51:54 +0000 (+0100) Subject: bugfix gdb (read of last flash location fails) X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=b20fcd5709c99524f3ec38483a70cf44eb6e2906;p=sx%2Fsimavr.git bugfix gdb (read of last flash location fails) --- diff --git a/simavr/sim/sim_gdb.c b/simavr/sim/sim_gdb.c index cd2196e..3989fc6 100644 --- a/simavr/sim/sim_gdb.c +++ b/simavr/sim/sim_gdb.c @@ -659,7 +659,7 @@ gdb_handle_command( uint8_t * src = NULL; /* GDB seems to also use 0x1800000 for sram ?!?! */ addr &= 0xffffff; - if (addr < avr->flashend) { + if (addr <= avr->flashend) { src = avr->flash + addr; } else if (addr >= 0x800000 && (addr - 0x800000) <= avr->ramend) { src = avr->data + addr - 0x800000;