Mercurial > repos > blastem
diff gdb_remote.c @ 2361:3350b3c8faa8
Initial implementation of VDP register write breakpoints
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 30 Oct 2023 00:07:56 -0700 |
parents | 8554751f17b5 |
children | 39a009aea113 |
line wrap: on
line diff
--- a/gdb_remote.c Sat Oct 28 16:04:58 2023 -0700 +++ b/gdb_remote.c Mon Oct 30 00:07:56 2023 -0700 @@ -227,6 +227,8 @@ bp_def *new_bp = malloc(sizeof(bp_def)); new_bp->next = root->breakpoints; new_bp->address = address; + new_bp->mask = 0xFFFFFF; + new_bp->type = BP_TYPE_CPU; new_bp->index = root->bp_index++; root->breakpoints = new_bp; gdb_send_command("OK"); @@ -241,7 +243,7 @@ if (type < '2') { uint32_t address = strtoul(command+3, NULL, 16); remove_breakpoint(context, address); - bp_def **found = find_breakpoint(&root->breakpoints, address); + bp_def **found = find_breakpoint(&root->breakpoints, address, BP_TYPE_CPU); if (*found) { bp_def * to_remove = *found; @@ -465,20 +467,20 @@ fatal_error("Could not find debug root for CPU %p\n", context); } if ((pc & 0xFFFFFF) == root->branch_t) { - bp_def ** f_bp = find_breakpoint(&root->breakpoints, root->branch_f); + bp_def ** f_bp = find_breakpoint(&root->breakpoints, root->branch_f, BP_TYPE_CPU); if (!*f_bp) { remove_breakpoint(context, root->branch_f); } root->branch_t = root->branch_f = 0; } else if((pc & 0xFFFFFF) == root->branch_f) { - bp_def ** t_bp = find_breakpoint(&root->breakpoints, root->branch_t); + bp_def ** t_bp = find_breakpoint(&root->breakpoints, root->branch_t, BP_TYPE_CPU); if (!*t_bp) { remove_breakpoint(context, root->branch_t); } root->branch_t = root->branch_f = 0; } //Check if this is a user set breakpoint, or just a temporary one - bp_def ** this_bp = find_breakpoint(&root->breakpoints, pc & 0xFFFFFF); + bp_def ** this_bp = find_breakpoint(&root->breakpoints, pc & 0xFFFFFF, BP_TYPE_CPU); if (!*this_bp) { remove_breakpoint(context, pc & 0xFFFFFF); }