For debugging http://forums.codeblocks.org/index.php/topic,19618.0.html (http://forums.codeblocks.org/index.php/topic,19618.0.html), I decided to do like this : http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows#Compile_Code::Blocks (http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows#Compile_Code::Blocks), i.e. building C::B from C::B.
1) what should go in the "cb" global variable ?
2) what should go in the "wx" global variable ?
3) Whatever I do, I end up with no plugins loaded, and a very basic C::B http://imgur.com/BAESn3k (http://imgur.com/BAESn3k)
4) Seems like in ConfigManager::InitPaths() the wxStandardPaths stuff always return "/" :
$ ./codeblocks --debug-log --multiple-instance -ns -ni -v -p debug --prefix="/home/gwr/Src/C-C++/codeblocks/svn9916/trunk/src/devel"
> ConfigManager::InitPaths()
config_folder :/
home_folder :/
app_path :/
res_path :.
> MainFrame::ScanForPlugins()
Plugin resource not found: .zip
Invalid manifest file for: ofl
Loaded 1 plugins
Scanning for plugins - global in /plugins
...
5) Ended up with a savage replacement
void MainFrame::ScanForPlugins()
{
m_ScanningForPlugins = true;
m_PluginIDsMap.clear();
PluginManager* m_PluginManager = Manager::Get()->GetPluginManager();
printf("> MainFrame::ScanForPlugins()\n");
// user paths first
//wxString path = ConfigManager::GetPluginsFolder(false);
//printf(" Scanning for plugins - user [%s]\n", path.wx_str());
//int count = m_PluginManager->ScanForPlugins(path);
wxString path;
path.assign((const wxChar*)"/home/gwr/Src/C-C++/codeblocks/svn9857/trunk/src/devel/share/codeblocks/plugins");
printf(" Scanning for plugins - user [%s]\n", path.wx_str());
int count = m_PluginManager->ScanForPlugins(path);
Got it.
I had an old file called "ofl.so" ( surely an old test for http://forums.codeblocks.org/index.php/topic,19618.0.html (http://forums.codeblocks.org/index.php/topic,19618.0.html) ) in "/home/gwr/.codeblocks/share/codeblocks/plugins" that C::B tried to load :
bool PluginManager::LoadPlugin(const wxString& pluginName)
{
...
m_pCurrentlyLoadingLib = LibLoader::LoadLibrary(pluginName);
...
}
What is interesting is that after the LoadLibrary call on the dummy file ofl.so, there is apparently a memory write that resets ConfigManager::config_folder & co :
before : http://imgur.com/AaycWMO (http://imgur.com/AaycWMO)
after : http://imgur.com/OEEUIAT (http://imgur.com/OEEUIAT)
( Notice the ConfigManager::config_folder wxString reseted to "" )
Digging further, the switch is done in pluginmanager.cpp :
namespace LibLoader
{
...
inline wxDynamicLibrary* LoadLibrary(const wxString& filename)
{
...
it->second.lib->Load(filename); <= memory overwrite here
...
}
...
};
Which leads finally to obscure casts in
/usr/include/c++/4.7/bits/move.h
and
/usr/include/c++/4.7/bits/stl_tree.h
Removed dummy ofl.so file and all is OK now.
Thanks for having answered.