Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Python Debugger

<< < (13/15) > >>

MortenMacFly:

--- Quote from: dmoore on October 14, 2012, 04:43:26 pm ---If you want, Morten, I can setup a python area of my berlios SVN repo (a tidy up of my trunk is long overdue) that C::B can pull from. This would be a combination of several plugins (embedded interpreter, code completion, debugger), but I guess I could combine them into a single C::B project with multiple plugin targets?

--- End quote ---
As you like. I would leave them separated, unless they share some code base. Embedding external repos, or even sub-path's of repos is easy. So we can also embed only "http://svn.repo.com/trunk/sub/folder", if desired. Make up your mind and let me know when the time has come.

oBFusCATed:
For the python debugger or any other debugger my preference would be to integrate it/them directly in the repo, when they are ready to be used by normal people.
A path like src/plugins/debuggers/ sounds great to me :)

Falldog:

--- Quote from: dmoore on October 14, 2012, 05:22:51 pm ---Ok, I briefly tested this one. You should add a post build step to the project to copy the python files to the right place. You also missed XRC file in your zip command on Linux.

BTW, using  wxString rpdb_wrap_path = ConfigManager::GetDataFolder() + _T("/python/PyDebugger/rpdb_wrap.py");, you should test GetDataFolder with true and false. Depending on the setup, the python files could be installed to a global or local place.

I didn't have time to make these fixes myself, but I will take another look later. I did successfully compile the project.

--- End quote ---

hi dmoore,
thanks for your review

1. I did forgot add XRC into zip command in Linux
    Does the zip file should include extra files? It seem only need be included in zip only when install the plugin?
2. I doesn't familiar with ConfigManager::GetDataFolder(bool global), does you mean plugin extra files may be installed at local or global place after setup. So I need to test it with true/false to make sure the file exist?
sample code like:
     wxFileName rpdb_wrap_file_global( ConfigManager::GetDataFolder(true) + _T("/python/PyDebugger/rpdb_wrap.py") );
     wxFileName rpdb_wrap_file_local( ConfigManager::GetDataFolder(false) + _T("/python/PyDebugger/rpdb_wrap.py") );
     wxString rpdb_file_path;
     if(rpdb_wrap_file_global.FileExists()) rpdb_file_path = rpdb_wrap_file_global.GetFullPath();
     else if(rpdb_wrap_file_local.FileExists()) rpdb_file_path = rpdb_wrap_file_local.GetFullPath();
3. I compile project in windows will successful, but compile in Linux will treat warning as error, should I add some definition for Linux project to avoid the warning as error?
   Or I should fix all warning... ???, (most of the warning come from external library wxJson)

dmoore:

--- Quote from: Falldog on October 16, 2012, 02:40:08 am ---1. I did forgot add XRC into zip command in Linux
    Does the zip file should include extra files? It seem only need be included in zip only when install the plugin?

--- End quote ---

No not for extra files.You only need to pack the extra files when you package everything into a cbplugin (but still not in the resources zip, but in the cbplugin zip itself). If you are manually installing to devel, just make sure to copy those extra files across as well as a post build step.


--- Quote ---2. I doesn't familiar with ConfigManager::GetDataFolder(bool global), does you mean plugin extra files may be installed at local or global place after setup. So I need to test it with true/false to make sure the file exist?
sample code like:
    wxFileName rpdb_wrap_file_global( ConfigManager::GetDataFolder(true) + _T("/python/PyDebugger/rpdb_wrap.py") );
     wxFileName rpdb_wrap_file_local( ConfigManager::GetDataFolder(false) + _T("/python/PyDebugger/rpdb_wrap.py") );
     wxString rpdb_file_path;
     if(rpdb_wrap_file_global.FileExists()) rpdb_file_path = rpdb_wrap_file_global.GetFullPath();
     else if(rpdb_wrap_file_local.FileExists()) rpdb_file_path = rpdb_wrap_file_local.GetFullPath();

--- End quote ---

Yes, though I think it should probably prefer the local to global.


--- Quote ---3. I compile project in windows will successful, but compile in Linux will treat warning as error, should I add some definition for Linux project to avoid the warning as error?
   Or I should fix all warning... ???,

--- End quote ---

I didn't have this problem on Linux. Do you somehow have treat warnings as errors set?


--- Quote ---(most of the warning come from external library wxJson)

--- End quote ---

Thinking more about this. I noticed that rpdb2 uses an XMLRPC server for the communication between the command line debugger and the debuggee. That means you could bypass the command line debugger and communicate directly with the debuggee from the plugin using XMLRPC, which would probably give better performance.

I have XMLRPC set up and  working pretty nicely for the Python Code Completion plugin. A couple of modules takes care of all the grunt work (xmlrpc_embedder and XmlRpcEvents) and they could easily be deployed as a shared lib for the debugger as well. XMLRPC has the advantage of being built into python. I don't personally care about the distinction between XML and Json -- it's just an implementation detail. (I could even make the rpc module capable of supporting either)

Alpha:

--- Quote from: dmoore on October 14, 2012, 05:22:51 pm ---BTW, using  wxString rpdb_wrap_path = ConfigManager::GetDataFolder() + _T("/python/PyDebugger/rpdb_wrap.py");, you should test GetDataFolder with true and false. Depending on the setup, the python files could be installed to a global or local place.

--- End quote ---
Just an implementation note: I believe the preferred function is ConfigManager::GetFolder(SearchDirs dir) - so ConfigManager::GetFolder(sdDataUser) and ConfigManager::GetFolder(sdDataGlobal) would be used (which makes the purpose of the command a little more readable).

Edit: or even better:

--- Code: ---wxString rpdb_file_path = ConfigManager::LocateDataFile(_T("python/PyDebugger/rpdb_wrap.py"), sdDataUser | sdDataGlobal);
if (rpdb_file_path.IsEmpty())
{
    // error, file not found
}

--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version