compiler.gdb 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # create a breakpoint on `debugutils.enteringDebugSection`
  2. define enable_enteringDebugSection
  3. break -function enteringDebugSection
  4. # run these commands once breakpoint enteringDebugSection is hit
  5. command
  6. # enable all breakpoints and watchpoints
  7. enable
  8. # continue execution
  9. cont
  10. end
  11. end
  12. # create a breakpoint on `debugutils.exitingDebugSection` named exitingDebugSection
  13. define enable_exitingDebugSection
  14. break -function exitingDebugSection
  15. # run these commands once breakpoint exitingDebugSection is hit
  16. command
  17. # disable all breakpoints and watchpoints
  18. disable
  19. # but enable the enteringDebugSection breakpoint
  20. enable_enteringDebugSection
  21. # continue execution
  22. cont
  23. end
  24. end
  25. # some commands can't be set until the process is running, so set an entry breakpoint
  26. break -function NimMain
  27. # run these commands once breakpoint NimMain is hit
  28. command
  29. # disable all breakpoints and watchpoints
  30. disable
  31. # but enable the enteringDebugSection breakpoint
  32. enable_enteringDebugSection
  33. # no longer need this breakpoint
  34. delete -function NimMain
  35. # continue execution
  36. cont
  37. end