Python debugger, python editor

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Python debugger, python editor

Post by sgrogan »

Kunda1 wrote: Wed Jul 12, 2017 9:40 pm FYI latest rebased branch is at:
I was unsuccessful compiling on Win with VS2013

Code: Select all

Error	1	error C2144: syntax error : 'char' should be preceded by ';'	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	2	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	3	error C2144: syntax error : 'char' should be preceded by ';'	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	4	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	5	error C2144: syntax error : 'char' should be preceded by ';'	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	6	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	7	error C2144: syntax error : 'char' should be preceded by ';'	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	8	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	9	error C2144: syntax error : 'char' should be preceded by ';'	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	10	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	11	error C2144: syntax error : 'char' should be preceded by ';'	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	12	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	13	error C2144: syntax error : 'char' should be preceded by ';'	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	14	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	15	error C2144: syntax error : 'char' should be preceded by ';'	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	16	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	17	error C2144: syntax error : 'char' should be preceded by ';'	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	18	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	21	error C2090: function returns array	C:\Users\Chris\GitHub\FreeCAD\src\Gui\PythonCode.cpp	1487	1	FreeCADGui
Error	22	error C2528: '__iob_func' : pointer to reference is illegal	C:\Users\Chris\GitHub\FreeCAD\src\Gui\PythonCode.cpp	1487	1	FreeCADGui
Error	23	error C2090: function returns array	C:\Users\Chris\GitHub\FreeCAD\src\Gui\PythonCode.cpp	1488	1	FreeCADGui
Error	24	error C2528: '__iob_func' : pointer to reference is illegal	C:\Users\Chris\GitHub\FreeCAD\src\Gui\PythonCode.cpp	1488	1	FreeCADGui
Error	25	error C2664: 'int PySys_SetObject(char *,PyObject *)' : cannot convert argument 2 from 'PyObject ***' to 'PyObject *'	C:\Users\Chris\GitHub\FreeCAD\src\Gui\PythonCode.cpp	1494	1	FreeCADGui
Error	26	error C2664: 'int PySys_SetObject(char *,PyObject *)' : cannot convert argument 2 from 'PyObject ***' to 'PyObject *'	C:\Users\Chris\GitHub\FreeCAD\src\Gui\PythonCode.cpp	1495	1	FreeCADGui
Error	27	error C2440: 'initializing' : cannot convert from 'initializer-list' to 'QStringList'	C:\Users\Chris\GitHub\FreeCAD\src\Gui\PythonCode.cpp	1548	1	FreeCADGui
Error	28	error C2597: illegal reference to non-static member 'Gui::JediDebugProxy::ModuleName'	C:\Users\Chris\GitHub\FreeCAD\src\Gui\PythonCode.cpp	1670	1	FreeCADGui
Error	29	error C2144: syntax error : 'char' should be preceded by ';'	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	30	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	31	error C2144: syntax error : 'char' should be preceded by ';'	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	32	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	33	error C2144: syntax error : 'char' should be preceded by ';'	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	34	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	35	error C2440: 'initializing' : cannot convert from 'initializer-list' to 'QList<QChar>'	C:\Users\Chris\GitHub\FreeCAD\src\Gui\PythonEditor.cpp	1996	1	FreeCADGui
Error	36	error C2440: 'initializing' : cannot convert from 'initializer-list' to 'QList<QChar>'	C:\Users\Chris\GitHub\FreeCAD\src\Gui\PythonEditor.cpp	1997	1	FreeCADGui
Error	37	error C2144: syntax error : 'char' should be preceded by ';'	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Error	38	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\chris\github\freecad\src\gui\PythonCode.h	478	1	FreeCADGui
Sorry for the bad formatting
"fight the good fight"
wmayer
Founder
Posts: 20113
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Python debugger, python editor

Post by wmayer »

Code: Select all

// a callback module that proxies jedi debug info to JediInterpreter
extern "C" {
class JediDebugProxy : public Py::ExtensionModule<JediDebugProxy>
{
public:
    JediDebugProxy();

    virtual ~JediDebugProxy();
    static constexpr char *ModuleName = "_jedi_debug_proxy";
private:
    Py::Object proxy(const Py::Tuple &args);
};
The problem is the use of constexpr. Apparently this keyword was introduced with C++11 but has been extended with C++14 which VS2013 doesn't support.
mumme
Posts: 35
Joined: Sun Jun 21, 2015 4:52 pm

Re: Python debugger, python editor

Post by mumme »

wmayer wrote: Sat Jul 15, 2017 5:04 pm

Code: Select all

// a callback module that proxies jedi debug info to JediInterpreter
extern "C" {
class JediDebugProxy : public Py::ExtensionModule<JediDebugProxy>
{
public:
    JediDebugProxy();

    virtual ~JediDebugProxy();
    static constexpr char *ModuleName = "_jedi_debug_proxy";
private:
    Py::Object proxy(const Py::Tuple &args);
};
The problem is the use of constexpr. Apparently this keyword was introduced with C++11 but has been extended with C++14 which VS2013 doesn't support.
@sgrogan: Thank you for testing

@wmayer: Thank you for tracing it down

I just pushed a fix for it. Please test again.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Python debugger, python editor

Post by Kunda1 »

kkremitzki wrote:ping
@kkremitzki I opened a ticket on @mumme74's repo to ask about integrating one of your python console tracking tickets issue #2958 among the others listed under console. Unfortunately, mumme74 doesn't have much time to code the debugger so he's doing what he can before his work resumes. Just thought you should know.
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
ferranpujolcamins
Posts: 8
Joined: Sun Dec 16, 2018 3:43 pm

Re: Python debugger, python editor

Post by ferranpujolcamins »

I'm taking over at https://github.com/ferranpujolcamins/Fr ... itor_fixes

Thanks @mumme for the amazing work you've done so far. Let me know if you find time again and want to keep working on this.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Python debugger, python editor

Post by Kunda1 »

ferranpujolcamins wrote: Sun Jan 03, 2021 11:48 am I'm taking over at https://github.com/ferranpujolcamins/Fr ... itor_fixes

Thanks @mumme for the amazing work you've done so far. Let me know if you find time again and want to keep working on this.
This is great news! Even though we can hook vscode up to FreeCAD... an internal debugger would still serve as an awesome feature!
I see that it would also potentially push to improve the FreeCAD console/editor even further.
Thank you @ferranpujolcamins please keep us updated on your progress!

Edit: I've updated the OP of this thread to indicate that the project has been forked
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
Post Reply