DebugLn doesn't output lazarus / 12-Debugger ---------------------------------------------------------------------- msdobrescu · 2009-08-02 09:40 Hello, I'm sure it is not the first time somebody asks this, but I couldn't find a solution anywhere, no matter how google-ing I've been doing. I've tried to debug the docking component of lazarus and I used DebugLn. I have Windows Vista x64/x86 and I use lazarus for win32, x86 version. I have tried to set debug-log, it creates the file, but the DebugLn seems to be hopeless. No output in the log file or console (I've built  lazarus with console app option too). What shoud I do in order to have this feature working? Thanks in advance, Mike ---------------------------------------------------------------------- Vincent Snijders · 2009-08-02 11:12 Did you do as described in the FAQ? How did you set "debug-log". ---------------------------------------------------------------------- msdobrescu · 2009-08-02 12:25 I have set it as in the FAQ and it logs in the file I've set using this parameter. The log file is created and debug info is done there, made by the environment, but not my DebugLn I have set in the application. Also, when I use console as described in the FAQ, the same info is logged, except my DebugLn... Is there a specific setup of the project also? ---------------------------------------------------------------------- Vincent Snijders · 2009-08-02 12:32 Not that I know. I have no idea why your debugln's are ignored. Are you sure it is executed? ---------------------------------------------------------------------- msdobrescu · 2009-08-02 13:08 How could I test that? I have put one in one button's OnClick event. I've put a breakpoint there. The program stops on that line. I execute the line. Nothing is logged. (in the console or file - the file is accessible after I close lazarus) It goes to the next line of code.. ---------------------------------------------------------------------- Vincent Snijders · 2009-08-02 13:22 step into it. ---------------------------------------------------------------------- msdobrescu · 2009-08-02 13:34 Here: if not Assigned(DebugText) then exit; DebugText is not assigned. ---------------------------------------------------------------------- Vincent Snijders · 2009-08-02 13:39 Then you need to find out, why it DebugText is not initialized. ---------------------------------------------------------------------- msdobrescu · 2009-08-02 13:48 Although the degug file is created and used by ide, the initialization method GetDebugFileName of LCLProc unit sees no parameters. Paramcount has no value >= 1. So it ignores the parameter --debug-log, I guess. I'll investigate further. ---------------------------------------------------------------------- Vincent Snijders · 2009-08-02 14:00 Maybe you run this in the IDE. There is a bug in gdb, that it doesn't accept the command line parameters. ---------------------------------------------------------------------- msdobrescu · 2009-08-02 14:18 Indeed, I run it in the IDE. ---------------------------------------------------------------------- Vincent Snijders · 2009-08-02 14:25 On second thought, the problem was with setting the environment variables. Using command line parameters works correctly. ---------------------------------------------------------------------- msdobrescu · 2009-08-02 14:31 I've tried that too, with the same results. ---------------------------------------------------------------------- Vincent Snijders · 2009-08-02 16:44 How did you set the command line parameters and what exact parameters did you use? ---------------------------------------------------------------------- msdobrescu · 2009-08-02 17:43 I think I have found the issue somehow. Setting the project setting of the log file as run parameter makes DebugLn working. That unit initialization sees the application's params, not lazarus'. If I have to use DebugLn in the LDockTree unit, for example, I set the debug log to the test application and rebuild lazarus. Weird, but effective. I don't understand why changing some lcl unit is not enough (without building the IDE again and again). ---------------------------------------------------------------------- Vincent Snijders · 2009-08-02 18:19 If you change the LDockTree unit, you need to recompile the LCL to make that change effective. ---------------------------------------------------------------------- msdobrescu · 2009-08-02 18:29 How would I compile LCL only, without impact on IDE? ---------------------------------------------------------------------- Vincent Snijders · 2009-08-02 19:55 Tools -> Configure Build Lazarus -> Quick Build Options -> Build LCL. ---------------------------------------------------------------------- msdobrescu · 2009-08-02 20:09 Great! Thank you so much!