On Fri, Nov 15, 2013 at 2:21 AM, Tommaso Cucinotta <tomm...@lyx.org> wrote: > > > 1. Just out of curiosity I found two types of dispatch, > lyx::dispatch(FuncRequest) and another one simply dispatch(FuncRequest) > what's the difference between them? > > excellent question, guess the FindAndReplace, inheriting DockView, > inheriting Dialog, calls the Dialog::dispatch(), which is implemented in a > very complicated way in Dialog.cpp: > > void Dialog::dispatch(FuncRequest const & fr) const > { > lyx::dispatch(fr); > } > >From the LyX.cpp i got the dispatch function like this: void dispatch(FuncRequest const & action) { LAPPERR(theApp()); return theApp()->dispatch(action); } I understood that it calls dispatch() something from the theApp() class(/function ?) But looking at the Dialog.h file, the dispatch function is already defined in namespace lyx and in it's definition(in Dialog.cpp) it calls again itself using lyx::dispatch(fr). I'm not getting which function definiton does it finally jump to.
Not sure if you like to use a complex IDE environment that tracks method > calls, or vi extensions that navigate you through definitions and uses of > symbols, but in case you don't, then find & grep are your friends, namely: > > grep -r -Hn 'whatever' * > find . -name '*.cpp' -exec grep -Hn 'whatever' {} \; > > I actually just use sublime text 3 editor don't know any IDE for such big projects, have just used Eclipse CDT IDE. What IDE do you use for debugging and tracking method calls as they are called for line by line debugging? > Does this answer your question ? If also when you do "Find Next" you don't > see anything on the terminal, then either you used the wrong syntax for > "./src/lyx -dbg find", or you didn't configure with --enable-debug and > *re-compiled* LyX from the top dir. > Not completely, I did find all the lines with Debug::FIND which get's written to terminal on invoking find and replace based actions. As my starting exercise I decided to trace down simple find and replace box invoked via Ctrl + F(and not the Advanced Find and Replace via Ctrl+Shift+F). I did use the same commands as specified but just found the following initialization lines on terminal: Setting debug level to find Debugging `find' (Find and replace mechanism) Anyway I'll trace the Advanced Find and Replace stuff which gave me much debugging information on terminal. -- Ankit Shah