dbgcon.py 812 B

12345678910111213141516171819202122232425262728
  1. # General constants for the debugger
  2. DBGSTATE_NOT_DEBUGGING = 0
  3. DBGSTATE_RUNNING = 1
  4. DBGSTATE_BREAK = 2
  5. DBGSTATE_QUITTING = 3 # Attempting to back out of the debug session.
  6. LINESTATE_CURRENT = 0x1 # This line is where we are stopped
  7. LINESTATE_BREAKPOINT = 0x2 # This line is a breakpoint
  8. LINESTATE_CALLSTACK = 0x4 # This line is in the callstack.
  9. OPT_HIDE = 'hide'
  10. OPT_STOP_EXCEPTIONS = 'stopatexceptions'
  11. import win32api, win32ui
  12. def DoGetOption(optsDict, optName, default):
  13. optsDict[optName] = win32ui.GetProfileVal("Debugger Options", optName, default)
  14. def LoadDebuggerOptions():
  15. opts = {}
  16. DoGetOption(opts, OPT_HIDE, 0)
  17. DoGetOption(opts, OPT_STOP_EXCEPTIONS, 1)
  18. return opts
  19. def SaveDebuggerOptions(opts):
  20. for key, val in opts.items():
  21. win32ui.WriteProfileVal("Debugger Options", key, val)