changeset 2208:3809a0bd680e

Fix a couple of Z80 debugger issues
author Michael Pavone <pavone@retrodev.com>
date Sat, 27 Aug 2022 22:02:09 -0700
parents de3d20e58555
children 92dc3e24f309
files debug.c
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/debug.c	Sat Aug 27 17:35:28 2022 -0700
+++ b/debug.c	Sat Aug 27 22:02:09 2022 -0700
@@ -2765,7 +2765,7 @@
 			*out = context->regs[Z80_H];
 		} else if (name[1] == '\'' && !name[2]) {
 			*out = context->alt_regs[Z80_H];
-		} else if (tolower(name[1]) == 'e') {
+		} else if (tolower(name[1]) == 'l') {
 			if (!name[2]) {
 				*out = context->regs[Z80_H] << 8 | context->regs[Z80_L];
 			} else if (name[2] == '\'' && !name[3]) {
@@ -3180,7 +3180,16 @@
 				(*this_bp)->condition = NULL;
 			}
 		}
-		printf("Z80 Breakpoint %d hit\n", (*this_bp)->index);
+		int debugging = 1;
+		for (uint32_t i = 0; debugging && i < (*this_bp)->num_commands; i++)
+		{
+			debugging = run_command(root, (*this_bp)->commands + i);
+		}
+		if (debugging) {
+			printf("Z80 Breakpoint %d hit\n", (*this_bp)->index);
+		} else {
+			return context;
+		}
 	} else {
 		zremove_breakpoint(context, address);
 	}