Author Topic: Python Debugger  (Read 80667 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Python Debugger
« Reply #30 on: September 21, 2012, 08:45:08 am »
I create the patch by Git, but it's size over the post maximum
You can pastebin it somewhere or you can post it in the patch tracker.
By the way - have you tried to zip it?
« Last Edit: September 21, 2012, 08:50:27 am by oBFusCATed »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Falldog

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Python Debugger
« Reply #31 on: September 21, 2012, 12:28:27 pm »
I create the patch by Git, but it's size over the post maximum
You can pastebin it somewhere or you can post it in the patch tracker.
By the way - have you tried to zip it?

Quote

Dear oBFusCATed,
you are so smart!
Thanks! XD

The patch include some python files, I don't know how to pack it for run-time use
Current stage, only can run in fix path of rpdb2.py (Please modify the EXECUTE_CMD macro in PyDebugger.cpp)
Non-finish work : watch children, and thread list

[attachment deleted by admin]

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Python Debugger
« Reply #32 on: September 21, 2012, 03:25:58 pm »
I haven't run it yet, but looking at the patch this looks very nice indeed! Some nice clean up of my ugly code too :)

One minor question is why not use something like XMLRPC instead of socket libs to make the remote calls back and forth a bit cleaner? (Built into python, a few options for C++, but nothing wxWidgets specific, I guess). I have some experimental code for a python interpreter around that uses XMLRPC.

This one looks like it has a simple API: http://xmlrpc-c.sourceforge.net/example-code.php
« Last Edit: September 21, 2012, 03:33:33 pm by dmoore »

Offline Falldog

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Python Debugger
« Reply #33 on: September 21, 2012, 04:51:13 pm »
I haven't run it yet, but looking at the patch this looks very nice indeed! Some nice clean up of my ugly code too :)

One minor question is why not use something like XMLRPC instead of socket libs to make the remote calls back and forth a bit cleaner? (Built into python, a few options for C++, but nothing wxWidgets specific, I guess). I have some experimental code for a python interpreter around that uses XMLRPC.

This one looks like it has a simple API: http://xmlrpc-c.sourceforge.net/example-code.php
ya, you look at the good point,
I implement it in short term way,
maybe json or XMLRPC is good way in future.
I would like to use json (because I am not familiar with XMLRPC ...)
I had use json to handle socket related communication, and python had good support and easy with it

On the other, I am wondering about performance of current implementation in socket,
Maybe use pipe is better!?

And... may I use the open source code(like rpdb2 or JsonCpp) directly in CB?
I am not sure the licence is okay...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Python Debugger
« Reply #34 on: September 21, 2012, 07:55:45 pm »
And... may I use the open source code(like rpdb2 or JsonCpp) directly in CB?
I am not sure the licence is okay...
It depends on the future goals for the plugin. If you'd want to add it to our repo minimizing the dependencies should be your priority. Otherwise you can use whatever you want.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Python Debugger
« Reply #35 on: September 21, 2012, 08:54:01 pm »
And... may I use the open source code(like rpdb2 or JsonCpp) directly in CB?
I am not sure the licence is okay...
It depends on the future goals for the plugin. If you'd want to add it to our repo minimizing the dependencies should be your priority. Otherwise you can use whatever you want.

If we plan to add more support for python (e.g. code completion) then it might make more sense to do stuff outside of contrib and then use whatever dependencies we need to get the job done efficiently. The fortran plugin, which is maintained in an external repo but linked to contrib might be a good model for what to do here. I suspect that C/C++ will always be the core focus of mainline C::B development.

I don't think licenses of the libs we've mentioned should be an issue. They are all MIT/BSD.

On the other, I am wondering about performance of current implementation in socket,
Maybe use pipe is better!?

I doubt it would make all that much difference for this application, but I don't know for sure. Can jsonrpc be configured to use a pipe instead of socket? (something like this)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Python Debugger
« Reply #36 on: September 21, 2012, 09:32:04 pm »
I suppose having more languages supported in the main repo is better in terms of designing things.
I've not tried the fortran stuff, but I'm sure it does some hacks or duplicates features that are C/C++ only.

At the place I work most of the software is a mix of c++ and python, so getting python support integrated
in the IDE will be good for me. No matter I don't like python too much.

About the code-completion: We have to thing how to make an API for different languages or implementations.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Python Debugger
« Reply #37 on: September 21, 2012, 09:51:10 pm »
I suppose having more languages supported in the main repo is better in terms of designing things.
I've not tried the fortran stuff, but I'm sure it does some hacks or duplicates features that are C/C++ only.

good point

Quote
About the code-completion: We have to thing how to make an API for different languages or implementations.

Yes. Would require something analogous to your debugger work, I guess. Alternatively, we could just find some way to add language modules to the current codecompletion plugin.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Python Debugger
« Reply #38 on: September 21, 2012, 10:03:31 pm »
Alternatively, we could just find some way to add language modules to the current codecompletion plugin.
But then you'll need to implement plugins inside the CC plugin, which doesn't sound nice. If it is common code or UI it should be move in the SDK.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Python Debugger
« Reply #39 on: September 21, 2012, 10:24:04 pm »
At the place I work most of the software is a mix of c++ and python, so getting python support integrated
in the IDE will be good for me. No matter I don't like python too much.
No, its quite nice separated. The last separation missing comes with the patch of danslemi nobody takes care of: To make indention become a plugin. I wonder wy nobody says "please commit!". I did - because this one of the last pieces missing for being able to support several languages and having separated their "specialities" just nice...

Please vote for danselmi - its all I can say...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Python Debugger
« Reply #40 on: September 21, 2012, 10:45:08 pm »
Morten: How they separate the codecompletion? There is no API for the symbol browser, nor for the toolbar, nor for the auto complete list...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Python Debugger
« Reply #41 on: September 22, 2012, 12:17:42 am »
I just thought I would mention, as there was some talk of possibly needing to parse JSON, that wxJSON has worked quite well when I have used it.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Python Debugger
« Reply #42 on: September 22, 2012, 12:41:40 am »
a) use cb::shared_ptr everywhere
b) declare simple typedefs instead of defining the pointers as static class members (typedef cb::shared_ptr<cbWatch> cbWatchPtr)
c) do it more like the old C::B/wx way: pass around regular pointers.
I've switched all the code to cb::shared_ptr. Probably the plugin will fail to build, so it will need some fixing. Both gdb plugins have been fixed.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Falldog

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Python Debugger
« Reply #43 on: September 22, 2012, 01:47:17 am »
I doubt it would make all that much difference for this application, but I don't know for sure. Can jsonrpc be configured to use a pipe instead of socket? (something like this)

It seem to use socket for rpc, no matter in json or xml
I would like to implement in simple communication by socket or pipe? (just read/write). and message data structure in json
It maybe work!? ::)

Offline Falldog

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Python Debugger
« Reply #44 on: September 22, 2012, 01:50:23 am »
I just thought I would mention, as there was some talk of possibly needing to parse JSON, that wxJSON has worked quite well when I have used it.

it's good news for using wxJson in CB, it seem not merge in wxWidgets core
I should add these files directly in project!?