Back-tracing feature if an error happens lazarus / 6-IDE-CodeTools ---------------------------------------------------------------------- jshand2010 · 2012-03-18 00:08 it would be a great idea to include within the debugger or codetools a function that records everymove the the running application takes whether correct or error, so you can actually know where to go into your code to fix the problem. need more info, just ask. thanks again ---------------------------------------------------------------------- Martin_fr · 2012-03-18 00:40 Well recording every single move would be very very slow. Anyway Lazarus has a debugger, and that allows you to single step through parts of your app. How much do you know about debugging? 1) Make sure the debugger is set up correctly http://wiki.lazarus.freepascal.org/Debugger_Setup If you press F9, you should see blue dots on the lft side of the editor. 2) Set a breakpoint. Click the left side of the editor and a red dot appears Your app will stop whenever it reaches that point. You can single step using F7/F8 Look at the watches window, or use hints to inspect variables. Read about some limitations: http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Properties 3) There is plenty more. Please ask for more details ---------------------------------------------------------------------- Martin_fr · 2012-03-18 00:41 If you use 0.9.31 there is a "History" window in the debugger. It allows to take snapshots at breakpoints ---------------------------------------------------------------------- Leledumbo · 2012-03-18 12:39 Actually this is what -gl (almost) gives, only the information given is in the form of call stack. You could use TEventLog component to log every possible action, though this should only be activated during debug mode. ---------------------------------------------------------------------- jshand2010 · 2012-03-18 21:11 hi martin_fr, i do currently use the 0.9.31 version and i have never come across the history feature.  please tell me how to use it.  it may just save me a lot of time ---------------------------------------------------------------------- Martin_fr · 2012-03-18 21:51 Select from the view menu, "Debug windows" > History or ctrl-alt-H Note, it only records if you pause/break/single-step the app. (watches will be recorded if you pause long enough.) If the app runs un-interupted, then nothing is recorded. If you get an exception, then place breakpoints at points that may be of interest. In the break point properties you can set, that the breakpoint does not stop, but take a snapshot (including stack and watches), and you can inspect the data later. Codetool can "find references" of a symbol, so you can find places that call/access something