[Swan-dev] debugging our test runner

D. Hugh Redelmeier hugh at mimosa.com
Fri Feb 1 06:33:19 UTC 2019


I decided to take a poke at this since I had a hung run sitting around for 
24 or so hours.

How does one debug a running python program?

Googling tells me that it isn't easy.

<https://www.reddit.com/r/Python/comments/4dooqu/how_to_attachdebug_an_already_running_python/>

Some brave souls use gdb, thus they have to study the entrails of the
interpreter.  I'm not that desperate.

pdb can attach to a running program IF you installed breakpoints
before you ran it.  That doesn't count.

I also found PyDev:
<http://pydev.blogspot.com/2014/09/attaching-debugger-to-running-process.html>
Sounds good.

Then I found that it was part of Eclipse.  I've never used Eclipse
because it seems like a monster, but if the monster can eat bugs, why
not?

My computer and I thrashed about in eclipse for a while.  What a
treat.

The term from which I invoked eclipse got a message.  I didn't
preserve it.

Would anyone else have run eclipse from a terminal?  If not, how would
they see this message?

The message said that I needed to run a pkcon command to install
something for building a project.  When I issued the pkcon command
(sudoed, even though the message didn't suggest this), it wanted to
remove some packages, including anaconda.  No thanks!

I followed the blog post for running PyDev.  It took a lot of fumbling
to find where to tell it the location of the python interpreter.  It
was quite insistent that I set this but gave no assistance in locating
the setting.  Being a GUI, I am unlikely to remember how I did it.

I did try "help" but that did nothing.  I'm not complaining that it
didn't address my question, I'm complaining that it was a no-op!

Then the moment of truth.  Attach to the running program and look at a
traceback!

At which point it hit a bug and asked if I'd like to report it to
three or four different folks.  I said "sure".

Then the bug reporter failed in a couple of ways: It got some dbus
thing to time out and ask me (every few seconds) if I wanted to wait
or proceed.  And the bug reporter failing provoked another bug
reporter to come up.

I gave up.  What a shambles.


More information about the Swan-dev mailing list