Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int md::debug_cmd_minus_break(int n_args, char **args)
- {
- uint32_t addr;
- int index = -1;
- printf("remove bp\n");
- if (args[0][0] == '#') { // remove by index
- if (strlen(args[0]) < 2) {
- printf("parse error\n");
- return (1);
- }
- index = atoi(args[0]+1);
- if ((index < 0) || (index >= MAX_BREAKPOINTS)) {
- printf("breakpoint out of range\n");
- return (1);
- }
- if (debug_bp_m68k[index] == -1) {
- printf("breakpoint not set\n");
- return (1);
- }
- } else {
- errno = 0;
- addr = strtoll(args[0], NULL, 0);
- if (errno) {
- printf("parse error\n");
- return (1);
- }
- index = debug_find_bp_m68k(addr);
- }
- printf("debug: index = %d\n", index);
- // if we get here, index is populated with a valid bp to rm
- // therefore, shift everything down one
- memmove(&debug_bp_m68k[index+1], &debug_bp_m68k[index], MAX_BREAKPOINTS - index);
- debug_bp_m68k[MAX_BREAKPOINTS - 1] = -1; // disable last slot
- return (1);
- }
Add Comment
Please, Sign In to add comment