Recent

Author Topic: After installing my new design package Lazarus stopped running.  (Read 2902 times)

dmitryb

  • New Member
  • *
  • Posts: 35
Hi All
I wrote my new Design package and tried to install it into the Lazarus IDE (Windows).

After installing it Lazarus stopped running.

On run it appears and immediately disappears from the windows task list.

What can I do?

Best regards
Dmitriy Bolshakov
« Last Edit: April 15, 2014, 11:25:14 pm by dmitryb »

engkin

  • Hero Member
  • *****
  • Posts: 2513
Re: After installing my new design package Lazarus stopped running.
« Reply #1 on: April 15, 2014, 10:07:36 pm »
In your Lazarus folder there is a copy of your previous executable. Make another copy of it and use it to start Lazarus.

dmitryb

  • New Member
  • *
  • Posts: 35
Re: After installing my new design package Lazarus stopped running.
« Reply #2 on: April 15, 2014, 10:17:19 pm »
Thank you.

I run lazarus.old.exe and removed my 'bad' package from the installed packages.
lazarus.exe runs now.
But how can I debug what is wrong with my package?
I think a problem is in the procedure Register.
« Last Edit: April 15, 2014, 10:20:15 pm by dmitryb »

Blaazen

  • Hero Member
  • *****
  • Posts: 2782
  • POKE 54296,15
    • Eye-Candy Controls
Re: After installing my new design package Lazarus stopped running.
« Reply #3 on: April 15, 2014, 10:36:10 pm »
We can't say until we can look to the code.
But procedure Register only adds component + icon to the palette, it can hardly crash Lazarus.

You can try to add units of your package to a new project and create component at run-time (via code). You can add to your code:
Code: [Select]
DebugLn('some message'); to suspicious places and watch output.
« Last Edit: April 15, 2014, 10:39:53 pm by Blaazen »
Lazarus 2.1.0 r61214:62238 FPC 3.3.1 r40507 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

engkin

  • Hero Member
  • *****
  • Posts: 2513
Re: After installing my new design package Lazarus stopped running.
« Reply #4 on: April 15, 2014, 10:52:51 pm »
You can open Lazarus project just like any other project. See here

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5706
    • wiki
Re: After installing my new design package Lazarus stopped running.
« Reply #5 on: April 15, 2014, 10:58:18 pm »
You can debug the IDE, by opening the project ide/lazarus.lpi and then run with F9

You may want to specify an alternative -primary-config-path in "run params" (run menu), but it is not necessary.

Note that unlike other projects, before running with F9, you must ensure you did rebuild the IDE (but do not restart it)
Check that the rebuild replaced the lazarus.exe. In very rare cases it may create a lazarus.new.exe (if previous debugging failed really bad, and locked the exe)

Also ensure that your package has debug info, and that you add debug info ( -gw ) in "Configure build lazarus"

I advice to make your own copy of lazarus.exe, because eventually the lazarus.old.exe may be overridden with a bad copy too.

dmitryb

  • New Member
  • *
  • Posts: 35
Re: After installing my new design package Lazarus stopped running.
« Reply #6 on: April 15, 2014, 11:24:49 pm »

I created new project and added all files of my package to it.
On run I got error in the initialization part of one of the modules.
I fixed it
  {$IFDEF FPC}
  if Screen.Cursors[Result] = 0 then
  {$ELSE}
  if Screen.Cursors[Result] = Screen.Cursors[crArrow] then
  {$ENDIF}

and after that new package started to work in IDE.

By the way in Lazarus Screen.Cursors[Unexisted Cursor] returns 0, but not Screen.Cursors[crArrow] like in Delphi

But thank you for tip about debugging IDE under other IDE.