Mercurial > repos > blastem
comparison 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 |
comparison
equal
deleted
inserted
replaced
2360:053ba4551c62 | 2361:3350b3c8faa8 |
---|---|
225 uint32_t address = strtoul(command+3, NULL, 16); | 225 uint32_t address = strtoul(command+3, NULL, 16); |
226 insert_breakpoint(context, address, gdb_debug_enter); | 226 insert_breakpoint(context, address, gdb_debug_enter); |
227 bp_def *new_bp = malloc(sizeof(bp_def)); | 227 bp_def *new_bp = malloc(sizeof(bp_def)); |
228 new_bp->next = root->breakpoints; | 228 new_bp->next = root->breakpoints; |
229 new_bp->address = address; | 229 new_bp->address = address; |
230 new_bp->mask = 0xFFFFFF; | |
231 new_bp->type = BP_TYPE_CPU; | |
230 new_bp->index = root->bp_index++; | 232 new_bp->index = root->bp_index++; |
231 root->breakpoints = new_bp; | 233 root->breakpoints = new_bp; |
232 gdb_send_command("OK"); | 234 gdb_send_command("OK"); |
233 } else { | 235 } else { |
234 //watchpoints are not currently supported | 236 //watchpoints are not currently supported |
239 case 'z': { | 241 case 'z': { |
240 uint8_t type = command[1]; | 242 uint8_t type = command[1]; |
241 if (type < '2') { | 243 if (type < '2') { |
242 uint32_t address = strtoul(command+3, NULL, 16); | 244 uint32_t address = strtoul(command+3, NULL, 16); |
243 remove_breakpoint(context, address); | 245 remove_breakpoint(context, address); |
244 bp_def **found = find_breakpoint(&root->breakpoints, address); | 246 bp_def **found = find_breakpoint(&root->breakpoints, address, BP_TYPE_CPU); |
245 if (*found) | 247 if (*found) |
246 { | 248 { |
247 bp_def * to_remove = *found; | 249 bp_def * to_remove = *found; |
248 *found = to_remove->next; | 250 *found = to_remove->next; |
249 free(to_remove); | 251 free(to_remove); |
463 debug_root *root = find_root(context); | 465 debug_root *root = find_root(context); |
464 if (!root) { | 466 if (!root) { |
465 fatal_error("Could not find debug root for CPU %p\n", context); | 467 fatal_error("Could not find debug root for CPU %p\n", context); |
466 } | 468 } |
467 if ((pc & 0xFFFFFF) == root->branch_t) { | 469 if ((pc & 0xFFFFFF) == root->branch_t) { |
468 bp_def ** f_bp = find_breakpoint(&root->breakpoints, root->branch_f); | 470 bp_def ** f_bp = find_breakpoint(&root->breakpoints, root->branch_f, BP_TYPE_CPU); |
469 if (!*f_bp) { | 471 if (!*f_bp) { |
470 remove_breakpoint(context, root->branch_f); | 472 remove_breakpoint(context, root->branch_f); |
471 } | 473 } |
472 root->branch_t = root->branch_f = 0; | 474 root->branch_t = root->branch_f = 0; |
473 } else if((pc & 0xFFFFFF) == root->branch_f) { | 475 } else if((pc & 0xFFFFFF) == root->branch_f) { |
474 bp_def ** t_bp = find_breakpoint(&root->breakpoints, root->branch_t); | 476 bp_def ** t_bp = find_breakpoint(&root->breakpoints, root->branch_t, BP_TYPE_CPU); |
475 if (!*t_bp) { | 477 if (!*t_bp) { |
476 remove_breakpoint(context, root->branch_t); | 478 remove_breakpoint(context, root->branch_t); |
477 } | 479 } |
478 root->branch_t = root->branch_f = 0; | 480 root->branch_t = root->branch_f = 0; |
479 } | 481 } |
480 //Check if this is a user set breakpoint, or just a temporary one | 482 //Check if this is a user set breakpoint, or just a temporary one |
481 bp_def ** this_bp = find_breakpoint(&root->breakpoints, pc & 0xFFFFFF); | 483 bp_def ** this_bp = find_breakpoint(&root->breakpoints, pc & 0xFFFFFF, BP_TYPE_CPU); |
482 if (!*this_bp) { | 484 if (!*this_bp) { |
483 remove_breakpoint(context, pc & 0xFFFFFF); | 485 remove_breakpoint(context, pc & 0xFFFFFF); |
484 } | 486 } |
485 resume_pc = pc; | 487 resume_pc = pc; |
486 cont = 0; | 488 cont = 0; |