1

I understand mechanically from here:

I can use C-x C-q to disable read-only mode on the python file I am debugging. I can then make changes and use run to restart the debugger.

However, I find that when I do this, whenever I edit the file that I am debugging, I am faced with the following error:

That’s all folks.... exited abnormally with code 1

How can I make changes to a file I am debugging and then re-run it without the debugger crashing? My read is that the file is read-only for a reason, and when I modify it while pdb is running I invite disaster---but this suggests to me there is an approved way to do this correctly. What is it?

Mittenchops
  • 289
  • 1
  • 8

1 Answers1

2

The thing is, the pdb debugger has the file loaded, so when you are editing the file (or buffer), it doesn't change it in the memory of the debugger, so it will ignore the changes until you call it again.

This issue is more related to the debugger itself, realgud it's just making sure of the file consistency, so it doesn't make too much sense to edit it in that scenario.

Still, there is probably a way to "hot reload" the debugger and get back to the pdb previous stage, but it's not implemented.

Fermin MF
  • 635
  • 3
  • 8
  • Is realgud uniquely not capable of this? Are other debugger backends that do this more easily? – Mittenchops Nov 03 '20 at 21:27
  • 1
    I'm not aware of any other debugger capable of this, still, you can try it with the Melpa package dap-mode, that has a python backend available – Fermin MF Nov 03 '20 at 21:50