This forum has been archived. All content is frozen. Please use KDE Discuss instead.

problem with python debugging

Tags: None
(comma "," separated)
adamc
KDE Developer
Posts
46
Karma
0

problem with python debugging

Mon May 20, 2019 5:07 pm
hi,
i downloaded KDevelop-5.3.2-x86_64.AppImage, because i wanted to try its python support. It's my first time using it since really long. Usually i'm a qtcreator user. I have python installed in the system and using anaconda in ~/bin/anaconda. I can start Kdevelop, and I can run python programs. Code completion and docs are there. I have only small styling problems due to my dark style.

However, debugging python does not work.

When I click on "Debug" in the toolbar, it seems that it switches to another perspective. I get a Debug pane on the bottom, in which i can see my launches. However, they are empty. The titles are "python3/path/to/my/code.py" (it looks like the space is missing). When I go to Run/Configure Launches, i see the python3 command, adding a space gets me "Sorry, debugging is only supported for Python 3.x applications". In Konsole I had
kdevelop.plugins.python.debugger: No environment profile specified, looks like a broken configuration, please check run configuration "New Script Application Launcher" . Using default environment profile.
, but the message disappeared after adding an execution directory and selecting the environment. Now it's still not working, but i have no message why. Or maybe it is working, but I don't see how (no console output of the script, no break point is visibly hit, i.e. no stack frame and no variables.

this is my test script:
Code: Select all
a = 4;
b = 3;
print(f"a + b = {a + b}")


update:
ok, I do see a stack frame:
#0 <module>()() at /home/user/blah/script.py:28


and I found the variable tab on the left showing 4 variables (__builtins__, __file__, __name__, and sys). But none of my own. Is there supposed to be a python console? I have only a normal one, and it says:
(base) user@host:~$ kdevelop! -s "{12345678-1337-abcd-a1b2-1337abcde123}"

Command 'kdevelop!' not found, but can be installed with:

sudo apt install kdevelop

(base) user@host:~$


looks to me like kdevelop couldn't find it's own process or something due to the app image.
adamc
KDE Developer
Posts
46
Karma
0

Re: problem with python debugging

Tue May 21, 2019 10:20 am
Ok, it actually does work.

however, there are some real problems on the last mile which make it look broken:
1. The perspective was switched to debug. However, the debugger toolbar was not shown.
2. The icon border was hidden, and it hides after every restart (the line number border as well). This hides the breakpoints and the stack pointer / currently executed line of code.
3. dark theme only: the stack pointer is almost invisible, in light mode it looks pixelated. most of the symbols look disabled and are also hardly visible.
4. No keyboard shortcut for continue. keyboard shortcuts for "step over" and "step into" collide with the editor's short cuts.

minor:
5. ui colours are mixed up between the settings and the view menus. there is a separate setting for code and debug view. so if i want to switch the whole ide from light to dark, i have to change it in 3 places.
6. All my schemes default to sans fonts, but I'm used to mono fonts and I've seen only one developer in my life using sans fonts. but in case your user base prefers sans fonts that is ok obviously :)

features:
7. an IPython console (following the debugger) would be awesome.

I really hope you will fix those things, as the product looks very good otherwise. Thanks for the work :)
airdrik
Registered Member
Posts
1854
Karma
5
OS

Re: problem with python debugging

Tue May 21, 2019 7:12 pm
Popping in briefly to comment on 6 and 7:

6) I'm probably the only developer (I've heard of) who prefers proportional fonts, but that's just me and I certainly wouldn't expect any editor/IDE to default to proportional fonts as I know I am vastly outnumbered. (also it's monospace (rigid conformity to a text grid) vs proportional (varying widths depending on the character) and serif (having extra little bars and features on each character) vs. sans serif (smooth and feature-less glyphs))

7) I agree!


airdrik, proud to be a member of KDE forums since 2008-Dec.
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: problem with python debugging

Tue May 21, 2019 9:37 pm
1. no idea about the toolbar, sorry; it should show
2. You can either toggle it with the shortcut, or enable it in the settings. If you do the latter, it stays on. I think it is on by default in newer versions for the reasons you mention, but it might be that you had started kate or so before and it still remembers the old times.3
3. Not sure if this is an issue specific to the appimage ...? I think the icons should adapt to the color scheme these days
4. You can configure shortcuts in settings -> configure shortcuts

Best,
Sven


I'm working on the KDevelop IDE.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell