How to run the code step by step - debugger not working lazarus / 12-Debugger ---------------------------------------------------------------------- dotniet · 2009-10-28 15:44 Hi. I cannot  run the code step by step. In 'options' the debugger is set to gdb.exe and the program is there (on disk). When I set a brk point is shows a question mark, then when I run the program it the break point turns to a red 'x' sign. I have tried also to set back both "smart link" options but still not working. I need to do something special to debug my program? I have:    Lazarus 0.9.28 beta    Win XP - 32 bit ---------------------------------------------------------------------- Martin_fr · 2009-10-28 17:17 There are many possible reasons. The first 2 are unlikely, but for completness sake - in the options: there are 2 relevant fields. You mention you have at least set one of them). I assume you mean you set them both? debugger type, AND location of gdb.exe - The breakpoint is at a line of code, which is never called, and hence omitted from your source. I guess that is not likely to be the case. - You did not compile your app or the specific unit, with debug info If you compile your app, in the compiler option you must have debug info turned on. You may (optional) choose dwarf. You must *not* use strip on your compiled program You must not pack (upx) your compiled program You must not use a starter/launcher application (xterm) (run/run params) or the debugger will try to debug that instead If you include units from packages, (including lcl) debug info for those is only included, if the package was explicitly compiled with debug info too. ---------------------------------------------------------------------- oniriabot · 2009-10-29 12:36 Hello, I have the same problems. When I install Lazarus 0.9.26, I can debug my program step by step. When I install Lazarus 0.9.28, I can't. I have windows XP on my computer. I don't understand because I install Lazarus 0.9.26 on a folder and lazarus 0.9.28 in another and at this time, Lazarus 0.9.26 doesn't want to debug anything (gdb is launch if I see in task manager). I verified the folder of program -> it's the right folder So I doesn't understand why Ican't debug Thank you for your help Oniriabot ---------------------------------------------------------------------- Martin_fr · 2009-10-29 12:56 @oniriabot Does Lazarus show you breakpoints as ok? e.g the normal red dot? or do you also see the disabled breakpoints as dotniet writes: "When I set a break point is shows a question mark, then when I run the program it the break point turns to a red 'x' sign." ? If you have enabled breakpoints, you have a different problem. And I would suggest you start a new thread, otherwise people are less likely to see dotniet problem, and he has lower chances to get an answer. You may want to read: http://forum.lazarus.freepascal.org/index.php/topic,6635.msg36799.html if your problem is neither this (disabled brkpoints), nor that (exception) then open a new thread, and include the output of: Menu "View", "debug windows", "debug output" ----------------- @dotniet: One more: do *not* use "use external gdb debug symbols file (-Xg)" from the compiler-option dialog => it doesn't work check the size of your exe, it should be well over 10 MB (for a simple application) if nothing helps aslo include the "debug output" ---------------------------------------------------------------------- oniriabot · 2009-10-29 13:08 OK, I open a new thread but I found the solution : In Configuration - Option -debugger info, I use the lazarus 0.9.26's gdb and now, I can debug program step by step. I think there is a bug in gdb software because gdb for lazarus 0.9.26 is running and gdb for lazarus 0.9.28 doesn't debug. ---------------------------------------------------------------------- dotniet · 2009-10-30 13:43 Quote from: Martin_fr on October 28, 2009, 06:17:45 pmyou must have debug info turned on. Thanks!!! That was the problem. I came from Delphi. I was not aware that I need the debug info in exe. Thanks again. ---------------------------------------------------------------------- diducu · 2009-11-05 17:21 I cannot  run the code step by step. In 'options' the debugger is set to gdb.exe and the program is there (on disk). When I set a brk point is shows a question mark, then when I run the program it the break point turns to a red 'x' sign. I have tried also to set back both "smart link" options but still not working. I need to do something special to debug my program? I have:    Lazarus 0.9.28 beta    Win XP - 32 bit ---------------------------------------------------------------------- Martin_fr · 2009-11-05 17:35 Again it seems your program does not contain debug info. See my post at the top.. Also make sure you are NOT using an external debug symbol file. Check all the options in compiler-settings. BTW, the default for them is to be on, so you must have accidentally changed them. Or you are debugging3rd party code which may not have them ---------------------------------------------------------------------- oniriabot · 2009-11-05 17:57 I have the same problem. When I want to use Lazarus 0.9.28, I can't debug my software but with lazarus 0.9.26 I can. I add debug info in the soft, but gdb doesn't stop anywhere. With lazarus 0.9.26, I don't need to add something, it works fine but the new lazarus doesn't want to debug. Is it possible to see what gdb tell to lazarus like a verbose mode ? I can't understand what is the problem. I think, the new lazarus doesn't like french windows configuration but why ????