Guest User

Untitled

a guest
Jun 23rd, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. int md::debug_cmd_minus_break(int n_args, char **args)
  2. {
  3. uint32_t addr;
  4. int index = -1;
  5.  
  6. printf("remove bp\n");
  7.  
  8. if (args[0][0] == '#') { // remove by index
  9.  
  10. if (strlen(args[0]) < 2) {
  11. printf("parse error\n");
  12. return (1);
  13. }
  14.  
  15. index = atoi(args[0]+1);
  16.  
  17. if ((index < 0) || (index >= MAX_BREAKPOINTS)) {
  18. printf("breakpoint out of range\n");
  19. return (1);
  20. }
  21.  
  22. if (debug_bp_m68k[index] == -1) {
  23. printf("breakpoint not set\n");
  24. return (1);
  25. }
  26. } else {
  27. errno = 0;
  28. addr = strtoll(args[0], NULL, 0);
  29. if (errno) {
  30. printf("parse error\n");
  31. return (1);
  32. }
  33. index = debug_find_bp_m68k(addr);
  34. }
  35.  
  36. printf("debug: index = %d\n", index);
  37.  
  38. // if we get here, index is populated with a valid bp to rm
  39. // therefore, shift everything down one
  40. memmove(&debug_bp_m68k[index+1], &debug_bp_m68k[index], MAX_BREAKPOINTS - index);
  41. debug_bp_m68k[MAX_BREAKPOINTS - 1] = -1; // disable last slot
  42.  
  43. return (1);
  44. }
Add Comment
Please, Sign In to add comment