Python Debugging - pdb++ (python debugger plusplus)

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
Buddy Hy
Posts: 32
Joined: Sat Aug 31, 2019 11:30 am

Python Debugging - pdb++ (python debugger plusplus)

Post by Buddy Hy »

Hey Kunda1, I'm looking for the pdbpp code debugger but all I can find is the pdb module. Could you please supply a link to where we can download the pdbpp module?

Mod Edit: This thread was split from another thread because it was off-topic. The context of this thread started from the following youtube video on how to use pdb++

phpBB [video]
Last edited by Kunda1 on Mon Nov 04, 2019 7:03 pm, edited 1 time in total.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Python Debugging - pdb++ (python debugger plusplus)

Post by Kunda1 »

Buddy Hy wrote: Sat Sep 21, 2019 8:39 am Hey Kunda1, I'm looking for the pdbpp code debugger but all I can find is the pdb module. Could you please supply a link to where we can download the pdbpp module?
You can get it through pypi via pip or through your distribution installer (in Manjaro i use pacman to install it)
https://pypi.org/project/pdbpp/
https://github.com/pdbpp/pdbpp
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Buddy Hy
Posts: 32
Joined: Sat Aug 31, 2019 11:30 am

Re: Python Debugging - pdb++ (python debugger plusplus)

Post by Buddy Hy »

Awesome Kunda1, I've downloaded the zip file but GitHub doesn't properly detail how to install it - All it says is:
Installation

Since pdb++ is not a valid package name the package is named pdbpp:

$ pip install pdbpp

pdb++ is also available via conda:

$ conda install -c conda-forge pdbpp

Alternatively, you can just put pdb.py somewhere inside your PYTHONPATH.
So do I just replace pdb.py in 'FreeCAD\bin\lib\'?
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Python Debugging - pdb++ (python debugger plusplus)

Post by Kunda1 »

Buddy Hy wrote: Sun Sep 22, 2019 6:47 am Awesome Kunda1, I've downloaded the zip file but GitHub doesn't properly detail how to install it
Yea, their documentation is alarmingly sparse.
I haven't installed a python package manually in a while...
Is there are reason why you're not interested in using a package installer for python...
I'm not a python expert, FYI.
Alternatively, you can just put ``pdb.py`` somewhere inside your
``PYTHONPATH``.
So yea, it seems you can add the location of the pdbpp's pdb.py to the beggining of your PYTHONPATH environmental variable (not sure how to do this on Windows).

Once you install pdbpp it should of automagically become you new python debugger.

Here is a nice indepth page:
https://eecs485staff.github.io/p1-insta ... g-with-pdb

Follow these instructions, they should work.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Buddy Hy
Posts: 32
Joined: Sat Aug 31, 2019 11:30 am

Re: Python Debugging - pdb++ (python debugger plusplus)

Post by Buddy Hy »

I can't see a package installer for pdb++... I wonder if I downloaded the correct file?
Attachments
pdbpp-master.zip
(51.95 KiB) Downloaded 87 times
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Python Debugging - pdb++ (python debugger plusplus)

Post by Kunda1 »

Buddy Hy wrote: Sun Sep 22, 2019 11:12 pm
Did it work out ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Buddy Hy
Posts: 32
Joined: Sat Aug 31, 2019 11:30 am

Re: Python Debugging - pdb++ (python debugger plusplus)

Post by Buddy Hy »

Sorry Kunda, I can't remember exactly what I did any more - but I seem to remember that I didn't really need the debugger. Anyways I finished the project, so I suppose this thread can be closed.
Thanks to everyone who tried to help.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Python Debugging - pdb++ (python debugger plusplus)

Post by Kunda1 »

I was able to get pdbpp to work without the FreeCAD GUI invoked. Which is nice. I'll post instructions on how to do that. The problem really is that it's not possible to do the same when FC GUI is active.
See:
https://forum.freecadweb.org/viewtopic. ... 66#p345446
https://forum.freecadweb.org/viewtopic.php?f=8&t=40673
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Python Debugging - pdb++ (python debugger plusplus)

Post by sliptonic »

I've never really used pdb from within FreeCAD but I'm trying to up my debugging game.

I do a import pdb; pdb_set_trace() in the console and get the pdb prompt.
some of the commands work but behavior is strange. For instance, the short form of most commands does not work. c does not work but cont does.
h does not but help does.

If I use the help command, nothing else works after that point. Every command just re-runs help.
Once it's in this locked condition, the only way out I've found is to restart FreeCAD.

So I'm a total newbie here. What the heck am I doing wrong?


OS: Linux Mint 19.3 (i3/i3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20908 +6 (Git)
Build type: Unknown
Branch: (HEAD detached from upstream/pr/3410)
Hash: 07bd120fc8519fe8d0a0bff33861d4c1787138e1
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
Post Reply