Author Topic: ThreadSearch 0.9 release (Windows only !!)  (Read 11337 times)

Offline dje

  • Lives here!
  • ****
  • Posts: 683
ThreadSearch 0.9 release (Windows only !!)
« on: September 16, 2007, 11:19:24 pm »
Hi all !

I'm not dead ! :)
I'm halh-proud to release ThreadSearch plugin 0.9, half only because this release works only on windows.
Linux behaviour concerning events management and GUI is quite different of Windows. As I don't know how much time I need to fix problems on Linux, I choose to deliver this windows only version.
It was supposed to be the 1.0 release but it will be once Linux part works.

Features :
  • multi-threaded "Search in files"
  • preview of the results (left single click on log window)
  • file open (left double click on log window)
  • check boxes instead of radio boxes to allow searches with both project and directories for example.
  • contextual menu "Find occurrences" to start a search in files with the word under cursor (can be activated or not)

Why ?
  • I am working on very big projects (700 Mo of cpp, h files) and text searches take up to 5 minutes. It is very frustrating being blocked because of the search. It is now possible to continue editing code during searches.
  • I do not like leaving the editor position to browse 'Search in files' resuts. There is now the 'Code preview' to do this with possibility to open the file at the right position.

What's new ?
New features :
  • ThreadSearch panel can be managed by the Messages notebook or the layout
  • Logger is either a wxListCtrl or a wxTreeCtrl (see pictures)
  • Code Preview can be hidden.
  • Massive rewrite of header/includes according to this post
  • plugin generation improvement
  • two target : one for debug and another for nightly. To use it, a cbplugin is generated in the ThreadSearch/plugin directory
  • Sash position saving
  • cbplugin improvement with C::B "extra files" evolution (Thanks to dmoore and Pecan for alternative proposition using XRC)

Bug fixes :
  • Copy/Paste operations now work (a VERY, VERY BIG THANKS to Pecan)
  • ThreadSearch panel is now displayed at search begin (still bugged for classic "Search in files", I'll submit a patch)
  • Possible reeantrance during uninstall protection (Thanks again to Pecan)
  • Missing toolbar tooltips are present (@Mario)

Installation :

Build
Extract the source code in src\plugins\contrib\ThreadSearch, open the CodeBlocks project and build it. The .cbplugin is generated in src\plugins\contrib\ThreadSearch\plugin and is ready for install.

User manual
Here is the wiki page (not updated)

Feel free to send feedbacks !  :)

Dje


[attachment deleted by admin]
« Last Edit: September 16, 2007, 11:49:23 pm by dje »

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: ThreadSearch 0.9 release (Windows only !!)
« Reply #1 on: September 16, 2007, 11:57:03 pm »
Great! :D waiting for the linux version too :)

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch 0.9 release (Windows only !!)
« Reply #2 on: September 17, 2007, 12:01:32 am »
So am I  :D !!
One month windows version works !!

But even if I'm not a Linux expert, I had other project to work on before...

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: ThreadSearch 0.9 release (Windows only !!)
« Reply #3 on: September 17, 2007, 02:15:37 am »
But even if I'm not a Linux expert, I had other project to work on before...

Is difficult sometimes, but you're gaining more knowledge everyday and thats a motivation.

Offline mariocup

  • Developer
  • Lives here!
  • *****
  • Posts: 587
Re: ThreadSearch 0.9 release (Windows only !!)
« Reply #4 on: September 17, 2007, 07:31:43 am »
Hi dje,

the TreeLogger looks cool. I will try the new version.

Thx for developing this plugin :D. I will update the documentation for the new features.

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch 0.9 release (Windows only !!)
« Reply #5 on: November 12, 2007, 01:55:17 pm »
Hi all !

Oh well... after the latest changes in the SDK this one seems pretty broken, unfortunately... :-(

Fear not. We 're here to help with the transition :).

Not enough time, too many problems...
As I didn't upgrade my environment for a long time and couldn't pay attention to the forums for a while, am I right with the following procedure ?
  • Upgrade GCC to 4.2.1
  • Upgrade wxWidgets to 2.8.6
  • Fix the problems  :wink:

Note: Linux problems are not fixed for now.

Dje

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: ThreadSearch 0.9 release (Windows only !!)
« Reply #6 on: November 12, 2007, 02:15:57 pm »
  • Upgrade GCC to 4.2.1
  • Upgrade wxWidgets to 2.8.6
  • Fix the problems  :wink:
You don't need to upgrade to gcc 4.2.1. The official C::B compiler is still 3.4.5. The other points are right. ;-)
Then the major issues are the usage of MessageLog as the logging system has changed. You should do a clean C::B checkout and try to compile TS with it and you'll see what I mean... ;-)
With regards, Morten.

Edit: Notice that SVN update *might* not work as there were also files removed from SVN. These file were remaining in my sandbox anyhow... "why-o-ever"...?!
« Last Edit: November 12, 2007, 02:22:09 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch 0.9 release (Windows only !!)
« Reply #7 on: November 15, 2007, 11:08:12 pm »
Hi all !

I'm working on the new logger interface integration.

I found these events in sdk_events used in main.cpp:
Code: [Select]
const wxEventType cbEVT_ADD_LOG_WINDOW = wxNewEventType();
const wxEventType cbEVT_REMOVE_LOG_WINDOW = wxNewEventType();
const wxEventType cbEVT_SWITCH_TO_LOG_WINDOW = wxNewEventType();
const wxEventType cbEVT_SHOW_LOG_MANAGER = wxNewEventType();
const wxEventType cbEVT_HIDE_LOG_MANAGER = wxNewEventType();
const wxEventType cbEVT_LOCK_LOG_MANAGER = wxNewEventType();
const wxEventType cbEVT_UNLOCK_LOG_MANAGER = wxNewEventType();

but I don't see any event to access the
Code: [Select]
void InfoPane::Show(size_t i)method.

As the previous version allows showing/hiding ThreadSearch Panel in the Messages notebook from the View menu, I'd like to implement it with new logger interface but I didn't find the right event to do it.

Any idea ?

Dje

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: ThreadSearch 0.9 release (Windows only !!)
« Reply #8 on: November 15, 2007, 11:23:48 pm »
but I don't see any event to access the
Code: [Select]
void InfoPane::Show(size_t i)method.

As the previous version allows showing/hiding ThreadSearch Panel in the Messages notebook from the View menu, I'd like to implement it with new logger interface but I didn't find the right event to do it.

Any idea ?

Dje

Use cbEVT_REMOVE_LOG_WINDOW and cbEVT_ADD_LOG_WINDOW.
Be patient!
This bug will be fixed soon...

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch 0.9 release (Windows only !!)
« Reply #9 on: November 16, 2007, 12:29:46 am »
Ok, thanks for the quick answer.

Dje

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch 0.9 release (Windows only !!)
« Reply #10 on: November 18, 2007, 10:21:44 am »
Hi all !

I have a linking problem...
Linking dynamic library: ..\..\..\devel\share\CodeBlocks\plugins\ThreadSearch.dll
..\..\..\.objs\plugins\contrib\ThreadSearch\ThreadSearchView.o: In function `ZN14BlockAllocatorI19CodeBlocksDockEventLj75ELb0EED1Ev':
C:/DevSofts/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_vector.h:(.rdata$_ZTV16ThreadSearchView[vtable for ThreadSearchView]+0x14): undefined reference to `ThreadSearchView::Append(wxString const&, Logger::level)'


In ThreadSearchView.h, I have
Code: [Select]
class ThreadSearchView: public Logger, public wxPanel {
public:
...
virtual void Append(const wxString& msg, Logger::level lv = info);
...
}

In ThreadSearchView.cpp, I have
Code: [Select]
void Append(const wxString& msg, Logger::level lv)
{
// In OnTmrListCtrlUpdate, the events sent by the worker thread replace
// this method. The ThreadSearchLoggerBase::OnThreadSearchEvent method
// is called.
}

I cleaned my project and rebuilt it but the problem remains.

SVN4640
GCC 3.4.5
Win XP SP2

The problem must be so obvious that I can't find it  :oops:
Thanks for any help !

Dje

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: ThreadSearch 0.9 release (Windows only !!)
« Reply #11 on: November 18, 2007, 04:44:18 pm »
In ThreadSearchView.cpp, I have
Code: [Select]
void Append(const wxString& msg, Logger::level lv)
{
// In OnTmrListCtrlUpdate, the events sent by the worker thread replace
// this method. The ThreadSearchLoggerBase::OnThreadSearchEvent method
// is called.
}
How about changing this to:
Code: [Select]
void ThreadSearchView::Append(const wxString& msg, Logger::level lv)
{
// In OnTmrListCtrlUpdate, the events sent by the worker thread replace
// this method. The ThreadSearchLoggerBase::OnThreadSearchEvent method
// is called.
}
??? ;-)
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch 0.9 release (Windows only !!)
« Reply #12 on: November 18, 2007, 05:01:59 pm »
I knew it was simple but couldn't find the trick, even giving the solution in te post !
Thanks Morten !

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch 0.9 release (Windows only !!)
« Reply #13 on: November 20, 2007, 09:43:20 pm »
Hi all !

This code worked before with wxWidgets 2.8.4 but not any more with 2.8.6.
The crash happens during the preview editor (cbStyledTextCtrl) creation.
I don't understand why, all parameters are OK:

Code: [Select]
#0 00000000 wxScintilla::Create(this=0x551ecb0, parent=0x55342f8, id=100, [email protected], [email protected], style=0, [email protected]) (C:/Dev/codeblocks/trunk/src/sdk/wxscintilla/src/wxscintilla.cpp:163)
#1 6C9FF93D wxScintilla::wxScintilla(this=0x551ecb0, parent=0x55342f8, id=100, [email protected], [email protected], style=0, [email protected]) (C:/Dev/codeblocks/trunk/src/sdk/wxscintilla/src/wxscintilla.cpp:147)
#2 00A97CDC cbStyledTextCtrl::cbStyledTextCtrl(this=0x551ecb0, pParent=0x55342f8, id=100, [email protected], [email protected], style=0) (C:/Dev/codeblocks/trunk/src/sdk/cbeditor.cpp:83)
#3 05E8DAAB ThreadSearchView::ThreadSearchView(this=0x5533708, [email protected]) (C:/Dev/codeblocks/trunk/src/plugins/contrib/ThreadSearch/ThreadSearchView.cpp:60)
#4 05E77417 ThreadSearch::OnAttach(this=0x53d9010) (C:/Dev/codeblocks/trunk/src/plugins/contrib/ThreadSearch/ThreadSearch.cpp:170)
#5 00AAE1CF cbPlugin::Attach(this=0x53d9010) (C:/Dev/codeblocks/trunk/src/sdk/cbplugin.cpp:66)
#6 00B674AD PluginManager::AttachPlugin(this=0x2f9b130, plugin=0x53d9010, ignoreSafeMode=false) (C:/Dev/codeblocks/trunk/src/sdk/pluginmanager.cpp:209)
#7 00B6FF87 PluginManager::LoadAllPlugins(this=0x2f9b130) (C:/Dev/codeblocks/trunk/src/sdk/pluginmanager.cpp:1115)
#8 0042E83E MainFrame::ScanForPlugins(this=0x25fda18) (C:/Dev/codeblocks/trunk/src/src/main.cpp:1025)
#9 00428810 MainFrame::MainFrame(this=0x25fda18, parent=0x0) (C:/Dev/codeblocks/trunk/src/src/main.cpp:537)
#10 00402213 CodeBlocksApp::InitFrame(this=0x2559838) (C:/Dev/codeblocks/trunk/src/src/app.cpp:349)
#11 00403A23 CodeBlocksApp::OnInit(this=0x2559838) (C:/Dev/codeblocks/trunk/src/src/app.cpp:510)
#12 00461BA4 wxAppConsole::CallOnInit(this=0x2559838) (C:/DevSofts/wxWidgets-2.8.6/include/wx/app.h:76)
#13 6274E4C9 wxEntryReal() (C:\DevSofts\wxWidgets-2.8.6\lib\gcc_dll\wxmsw28u_gcc_custom.dll:??)
#14 627D1D1C wxEntry() (C:\DevSofts\wxWidgets-2.8.6\lib\gcc_dll\wxmsw28u_gcc_custom.dll:??)
#15 0040179E WinMain(hInstance=0x400000, hPrevInstance=0x0, lpCmdLine=0x251f11 "", nCmdShow=10) (C:/Dev/codeblocks/trunk/src/src/app.cpp:287)
#16 0045E0EA main() (C:/Dev/codeblocks/trunk/src/include/logger.h:21)

crash happens in
Quote
bool wxScintilla::Create (wxWindow *parent,
                          wxWindowID id,
                          const wxPoint& pos,
                          const wxSize& size,
                          long style,
                          const wxString& name) {
#ifdef __WXMAC__
    style |= wxVSCROLL | wxHSCROLL;
#endif
    if (!wxControl::Create (parent, id, pos, size,
                            style | wxWANTS_CHARS | wxCLIP_CHILDREN,
                            wxDefaultValidator, name)) {
        return false;
    }
    ...
}

where wxControl::Create returns false.
As a result, m_swx is not allocated in contructor and the fisrt call results in a memory violation.
Does anyone have an idea concerning this crash (wxWidgets code reading didn't gave me the answer) ?
I have to build wxWidgets dll in debug and rebuild all C::B apps/plugin.

Dje

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: ThreadSearch 0.9 release (Windows only !!)
« Reply #14 on: November 21, 2007, 08:30:10 am »
Does anyone have an idea concerning this crash (wxWidgets code reading didn't gave me the answer) ?
I could offer to give a try. I am using a newer wxScintilla release within C::B. Maybe it has already been fixed?! You might want to send me the sources to give it a try...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch 0.9 release (Windows only !!)
« Reply #15 on: November 21, 2007, 09:22:53 am »
OK Morten, thanks. I send the sources tonight.
First try since plugin loading fails...

Dje

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch 0.9 release (Windows only !!)
« Reply #16 on: November 29, 2007, 11:38:12 pm »
Hi all !

Great progress in new Logger integration (thanks Morten !)

A last problem remains...
When I want to remove the panel from the Messages notebook, I use the following code:
Code: [Select]
CodeBlocksLogEvent evt(cbEVT_REMOVE_LOG_WINDOW, this);
Manager::Get()->GetAppWindow()->ProcessEvent(evt);

I just want to remove the Logger from the notebook but my logger is deleted when event is processed !
With previous behaviour, it was just removed...

Is there any way to remove Logger without deletion ?
If that's not the case, is it possible to add a boolean to the event to tell if Logger should be deleted ?

Dje

Offline The-Kenny

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: ThreadSearch 0.9 release (Windows only !!)
« Reply #17 on: November 29, 2007, 11:51:30 pm »
Ohm... every time I try to install the plugin for windows I get the error
Quote
Scanning for plugins in C:\Programme\Codeblocks/share/codeblocks/plugins
C:\Programme\Codeblocks/share/codeblocks/plugins/ThreadSearch.dll: not loaded (missing symbols?)

I get the same error with the ShellExtension Plugin.

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch 0.9 release (Windows only !!)
« Reply #18 on: November 30, 2007, 12:07:50 am »
Hi !

The ThreadSearch plugin does not load any more since new Logging system integration.
Windows version will be released soon (as soon as Logger deletion is solved).
I hope the same for Linux...

Dje

Offline krgh

  • Single posting newcomer
  • *
  • Posts: 7
Re: ThreadSearch 0.9 release (Windows only !!)
« Reply #19 on: December 10, 2007, 03:53:59 am »
Hi,

Thanks for the wondefull Plugin. But since recently, i am having few erros with this and i am not able to use Threadsearch Plugin.
I am using Codeblocks snapshot version CB_20071206_rev4711_win32 with mingwm10_gcc421 and wxmsw28u_gcc_cb_wx287.
Whenever i try to install threadsearch plugin i get below error

C:\Editors\Code Blocks/share/codeblocks/plugins/ThreadSearch.dll: not loaded (missing symbols?).


I use CB to work on ARM Compillers but this doesnt allow me to recompile the source. Please let me know how to recompile the code with some other toolchain.

TIA

Regards
Gururaja

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch 0.9 release (Windows only !!)
« Reply #20 on: December 10, 2007, 09:43:29 am »
Hi !

Quote
Thanks for the wondefull Plugin
:D :D Thanks !  :D :D

In fact, in previous post :
Hi !

The ThreadSearch plugin does not load any more since new Logging system integration.
Windows version will be released soon (as soon as Logger deletion is solved).
I hope the same for Linux...

Dje
New logger system appeared at rev 4606. It can not be used any more.
I am working on it.
I hope Windows version will be available at the end of the week.
Then I'll work on Linux issues.

Dje