Recent

Author Topic: debugger Lazarus ( Solved)  (Read 11124 times)

MVD

  • New Member
  • *
  • Posts: 23
debugger Lazarus ( Solved)
« on: September 15, 2017, 02:22:51 pm »
Hi, I am new in Lazarus and I maked a program that is working very well. My problem is that the debugger give me the same error all the time :
Debugger error

Ooops, the debugger entered the error state
Save your work now !

Hit Stop, and hope the best, we’re pulling the plug.

The debugger could not run the application.
This may be caused by missing debug info.
I am working in windows 10 and this happens with version 1.8.ORC4 and also with 1.6.4
GDB command "-exec-run"
returned the error :"msg="Error creating process
« Last Edit: September 21, 2017, 12:11:43 pm by MVD »

Thaddy

  • Hero Member
  • *****
  • Posts: 14197
  • Probably until I exterminate Putin.
Re: debugger Lazarus
« Reply #1 on: September 15, 2017, 05:01:37 pm »
You do not have GDB installed? Or a wrong version (bitness)
Install either mingw or cygwin/cygwin64 and select the gdb package.

But anyway: to run a debugger properly you must compile with debug info...
« Last Edit: September 15, 2017, 05:03:59 pm by Thaddy »
Specialize a type, not a var.

rvk

  • Hero Member
  • *****
  • Posts: 6110
Re: debugger Lazarus
« Reply #2 on: September 15, 2017, 05:13:47 pm »
You do not have GDB installed? Or a wrong version (bitness)
Install either mingw or cygwin/cygwin64 and select the gdb package.
Install GDB? For a Lazarus Windows installation?
I've never needed to do that. It always came with the standard install of 1.6.4 and 1.8.ORC4.
Only when compiling trunk, I needed to add the gdb.exe myself.

I am working in windows 10 and this happens with version 1.8.ORC4 and also with 1.6.4
It could be an antivirusscanner which is messing with you GDB. Try deactivating it.
Also check if you didn't screw up your configuration.
Check in Tools > Options > Debugger and see if the debugger is set correctly.

wp

  • Hero Member
  • *****
  • Posts: 11853
Re: debugger Lazarus
« Reply #3 on: September 15, 2017, 05:46:57 pm »
Yes, I know this... It is happening from time to time, sometimes I can ignore it, sometimes I can't. I know this is frustrating. Sometimes it helps for some time to reset the debugger. There's a command for it in the "Run" menu - add a shortcut to the EditorToolbar for convenience.

But quite often, when the debugger is behaving like this, I'll find a BIG bug in my program some time later, and after fixing it the debugger is silent. So, my feeling is: This is an indication of a hidden issue. Look for pointer or thread issues, be prepared for that hard-to-find stuff...

MVD

  • New Member
  • *
  • Posts: 23
Re: debugger Lazarus
« Reply #4 on: September 15, 2017, 06:12:06 pm »
ide options for debugger

rvk

  • Hero Member
  • *****
  • Posts: 6110
Re: debugger Lazarus
« Reply #5 on: September 15, 2017, 06:28:09 pm »
Do you have the same error if you create a new project with just one button and nothing else?

wp

  • Hero Member
  • *****
  • Posts: 11853
Re: debugger Lazarus
« Reply #6 on: September 15, 2017, 06:41:21 pm »
Ah, and I forgot: Recently I had the same issue again, and in this project's Options the "Type of debug info" was not at "Automatic (-g)" ("Compiler options" > "Debugging") - I can't remember which one- , and additionally the "Unit style" was set to "Smart linkable (-CX)" ("Compiler options" > "Compilation and Linking"). Resetting these made the debugger work again. Of course, I don't know if this is the root cause. But it is written somewhere in the wiki that the compiler settings for debug info can be harmful.

Also see this: http://wiki.freepascal.org/GDB_Debugger_Tips#gdb.exe_has_stopped_working

And try to compile a Win-32bit application, even on Win-64 bit.

MVD

  • New Member
  • *
  • Posts: 23
Re: debugger Lazarus
« Reply #7 on: September 16, 2017, 01:49:02 am »
 :D I rebuild a new project with the same components and the same code and now it is working. Where can I find some explication to work with the debugger. In another live I was playing with Delphi 6 but everything change a lot. Thanks for the help.

MVD

  • New Member
  • *
  • Posts: 23
Re: debugger Lazarus
« Reply #8 on: September 16, 2017, 09:15:59 am »
 >:( now the debugger hangs and I see only a blank screen. Wen I test the compiler options I get 2 warnings. Can anyone explain those warnings.

MVD

  • New Member
  • *
  • Posts: 23
Re: debugger Lazarus
« Reply #9 on: September 16, 2017, 10:17:46 am »
I was reading in this forum and I decided to install the 32 bits version of Lazarus but the same problem.
When I run the program I see a blank window with some lines ( contours from panels and grid) and then the debugger hangs. I have to kill the Lazarus application in task manager and then with Lazarus closed my application pup up and works fine. For me it is a problem with the debugger.

wp

  • Hero Member
  • *****
  • Posts: 11853
Re: debugger Lazarus
« Reply #10 on: September 16, 2017, 10:40:24 am »
For me it is a problem with the debugger.
Almost certainly not...

You say you see "contours from panels and grid" - this looks like an LCL application. But further up, your screenshot shows warnings related to FreeVision units. These two do not come together, even there are units which have the same name. I fear your project is screwed up. Maybe you are mixing units which do not work together. If possible post your project (only non-compiler-generated files, all packed into a shared zip).

MVD

  • New Member
  • *
  • Posts: 23
Re: debugger Lazarus
« Reply #11 on: September 16, 2017, 06:00:09 pm »
Hi,
Thanks for helping.
At the end i got the solution, I installed the debugger gdb_77 (downloaded from internet) and I set the project options to
compiling and linking : "no optimization" in compiler options
debugging : "Dwarf with sets (-gw -godwrfsets)" in type of debug info.

When I run the program ( the exe file) there is always a black window that opens. When the program can not find a database or something else it is written in that window. How can I get rid of this?
To wp: It is a LCL application. The screenshot was made from  a test . Going in project options _ compiler options _ debugging and then the test button at the window bottom. I still get the same message.

wp

  • Hero Member
  • *****
  • Posts: 11853
Re: debugger Lazarus
« Reply #12 on: September 16, 2017, 06:12:29 pm »
When I run the program ( the exe file) there is always a black window that opens. When the program can not find a database or something else it is written in that window. How can I get rid of this?
There's probably a WriteLn somewhere in your code. For this to work with an LCL application the option "Win 32 gui application" in "Project options" > "Compiler Options" > "Config and Target" > box "Target-specific options" must be unchecked. Check this option in order to avoid the black console window. But you must remove the WriteLn instruction from your code otherwise your program will crash here. (Or replace the WriteLn by a DebugLn from unit LazLogger).

To wp: It is a LCL application. The screenshot was made from  a test . Going in project options _ compiler options _ debugging and then the test button at the window bottom. I still get the same message.
Thanks for these detailed instructions. I can confirm the same freevision-related warning in my system. I must confess that I never understood what this "Test" button is doing...
« Last Edit: September 17, 2017, 12:03:10 am by wp »

MVD

  • New Member
  • *
  • Posts: 23
Re: debugger Lazarus
« Reply #13 on: September 16, 2017, 09:29:18 pm »

When I run the program ( the exe file) there is always a black window that opens. When the program can not find a database or something else it is written in that window. How can I get rid of this?
There's probably a WriteLn somewhere in your code. For this to work in case of an LCL application the option "Win 32 gui application" in "Project options" > "Compiler Options" > "Config and Target" > box "Target-specific options" must be unchecked. Check this option in order to avoid the black console window. But you must remove the WriteLn instruction from your code otherwise your program will crash here. (Or replace the WriteLn by a DebugLn from unit LazLogger).

To wp: It is a LCL application. The screenshot was made from  a test . Going in project options _ compiler options _ debugging and then the test button at the window bottom. I still get the same message.
Thanks for these detailed instructions. I can confirm the same freevision-related warning in my system. I must confess that I never understood what this "Test" button is doing...

I have no writeLn in my code but I found  that new icons from the forms have to be loaded, if i let the Lazarus icons the program is created but I can not stop Lazarus or the debugger (very strange). When I use step into I could see that the problem was with the icon but I dont remember in which uses file. Thanks for the tip with the with WIN32, the black screen is gone. I am sorry for my English, it is a mixt from Google and what I learned fifty years ago.

 

TinyPortal © 2005-2018