Recent

Author Topic: Click Run twice before a project runs?  (Read 25046 times)

Hansaplast

  • Hero Member
  • *****
  • Posts: 783
  • Tweaking4All.com
    • Tweaking4All
Click Run twice before a project runs?
« on: January 02, 2011, 07:48:59 pm »
After being away from Lazarus for quite a while now, I decided to pick it up again and see what progress has been made in these past months (I'm very impressed by the changes - great work!).

I sure hope this is not something obvious; I find myself in the situation where nothing happens (except for compiling) when I click the "Run" option from the "Run" menu.
Clicking it a second time does then execute the project.
Am I overlooking something? Is this by design?

This happen each and every time when I want to test run my project, even in the same session. I tried both the stable version (0.9.28) and the nightly build version (0.9.31 of 2011-01-01) for MacOS X (FPC 2.4.2 on that last one).

Note:
It seems to happen under Windows as well (Windows 7 64-bit, 32-bit version of Lazarus/FPC, nightly build and stable version - Yes, I'd rather use the 64-bit version but Synapse won't compile in the 64 bit environment, missing "BaseUnix").

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Click Run twice before a project runs?
« Reply #1 on: January 02, 2011, 08:46:58 pm »
I sure hope this is not something obvious; I find myself in the situation where nothing happens (except for compiling) when I click the "Run" option from the "Run" menu.
Clicking it a second time does then execute the project.
Am I overlooking something? Is this by design?

You might want to report this as a bug.

Normally the very first time you run a project with OS X, it will take two runs because the first run creates the .app bundle and for some reason does not run the app.

Debugging inside Lazarus is completely broken on my Mac, but I usually debug outside the IDE anyway. What version of gdb do you have? I'm using the 6.3 that's included with Xcode - I haven't found a newer version for Mac yet.

Thanks.

-Phil

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12430
  • Debugger - SynEdit - and more
    • wiki
Re: Click Run twice before a project runs?
« Reply #2 on: January 02, 2011, 09:25:07 pm »
you can google for MacPorts gdb, there is a version 7.1.

But I have no idea if it works any better. For starters, it seems to have issues with the app bundle, you must either create the app wityhout bundle, or specify the actual app inside the bundle as executable....

Otherwhise, what Mac? intel or ppc? 32 or 64 bit?

I recently got confirmation from some Mac users on Intel 64 bit that they could now run an app in the IDE debug (and 32 Intel seems fine too).
That is a few things were fixed early December...

If not: What error msg?
What is the output in "Debug Output" window.

Compile the IDE with the following symb0ols defined
  DBG_VERBOSE
  DBGMI_QUEUE_DEBUG
that is -dDBG_VERBOSE -dDBGMI_QUEUE_DEBUG

And then start Lazarus from console or with --debug-log, so you get all the extra output. (it may be a lot, so better run it into a logfile)

If the IDE debug session seems to hang for no good reason at all, try
  -dDBG_WITH_TIMEOUT
BUT, note this (timeout) is alpha at best. Only use it, if really needed.

-------
As for Windows 64 bit.
Yes there are known issues, => the problem is to get a good version of gdb. You want to read this report:
http://bugs.freepascal.org/view.php?id=15587


Hansaplast

  • Hero Member
  • *****
  • Posts: 783
  • Tweaking4All.com
    • Tweaking4All
Re: Click Run twice before a project runs?
« Reply #3 on: January 02, 2011, 11:52:28 pm »
Thanks Guys for the replies :)

I didn't think about the 64-bit issue or the gdb since it happened on Windows and MacOS.

I mainly work on Mac (today);

I'm running Intel, 64 bit (I assume), MacOS X 10.6.5, 2x 2.8Ghz Quad-Core Xeon Mac pro (3,1).
I downloaded and installed the latest Xcode release 3.2.4 before installing Lazarus/FPC.
I tried the stable release (where SynEdit crashes with an Access Violation), then the nightly build of 1-1-2011.

When I click "run", the first time, the messages window only shows "Project "test" successfully built". When I click again, it shows the same message, and the debugger pops up with the message "Debugger error - Ooops, the debugger entered the error state Save your work now !", and when I click OK the application starts as if nothing went wrong.

As soon as I modify anything in the source and try to run the app again, the same repeats.

Note: if something goes wrong in the code I wrote, the messages window work correctly (message, line, etc).

Laksen

  • Hero Member
  • *****
  • Posts: 802
    • J-Software
Re: Click Run twice before a project runs?
« Reply #4 on: January 03, 2011, 12:15:58 am »
I've noticed this too lately, on win32

This is probably a regression somewhere

Hansaplast

  • Hero Member
  • *****
  • Posts: 783
  • Tweaking4All.com
    • Tweaking4All
Re: Click Run twice before a project runs?
« Reply #5 on: January 03, 2011, 12:42:10 am »
Good to know I'm not the only one experiencing this :)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12430
  • Debugger - SynEdit - and more
    • wiki
Re: Click Run twice before a project runs?
« Reply #6 on: January 03, 2011, 01:27:33 pm »
As for the "need to run twice". I have no idea.

As for the "entered error state":
Please submit the requested log files. (for each cpu/os on which this is experienced)
Otherwise it will be impossible to help....

Also please report:
- fpc version
- compiled with stabs or dwarf? (-gw or -gs)?
=> Try both anyway.

Hansaplast

  • Hero Member
  • *****
  • Posts: 783
  • Tweaking4All.com
    • Tweaking4All
Re: Click Run twice before a project runs?
« Reply #7 on: January 04, 2011, 05:32:00 am »
I'll focus on MacOS (10.6.5/Intel):

FPC 2.4.2

I hate to sound dumb but I'm not quite sure what stabs/dwarf stands for.
I'm using the default settings (for everything).
Debugger: /usr/bin/gdb, GNU debugger (gdb).
LCL Widget Type: carbon

I tried recompiling the IDE with the options "-dDBG_VERBOSE -dDBGMI_QUEUE_DEBUG" but it fails to do so:

/Developer/lazarus/examples/notebku.pp(87,19) Error: Identifier not found "PageCount"
/Developer/lazarus/examples/notebku.pp(104,19) Error: Identifier not found "PageCount"
/Developer/lazarus/examples/notebku.pp(304,13) Error: identifier idents no member "ShowTabs"
/Developer/lazarus/examples/notebku.pp(304,39) Error: identifier idents no member "ShowTabs"
/Developer/lazarus/examples/notebku.pp(305,17) Error: identifier idents no member "ShowTabs"
/Developer/lazarus/examples/notebku.pp(330,16) Error: identifier idents no member "TabPosition"
/Developer/lazarus/examples/notebku.pp(331,16) Error: identifier idents no member "TabPosition"
/Developer/lazarus/examples/notebku.pp(332,21) Error: identifier idents no member "TabPosition"
/Developer/lazarus/examples/notebku.pp(333,16) Error: identifier idents no member "TabPosition"
/Developer/lazarus/examples/notebku.pp(334,21) Error: identifier idents no member "TabPosition"
/Developer/lazarus/examples/notebku.pp(335,16) Error: identifier idents no member "TabPosition"
/Developer/lazarus/examples/notebku.pp(336,21) Error: identifier idents no member "TabPosition"
/Developer/lazarus/examples/notebku.pp(337,16) Error: identifier idents no member "TabPosition"
/Developer/lazarus/examples/notebku.pp(343) Fatal: There were 13 errors compiling module, stopping


Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: Click Run twice before a project runs?
« Reply #8 on: January 04, 2011, 07:54:47 am »
Revert to r28849 until http://bugs.freepascal.org/view.php?id=18375 has been fixed.

Hansaplast

  • Hero Member
  • *****
  • Posts: 783
  • Tweaking4All.com
    • Tweaking4All
Re: Click Run twice before a project runs?
« Reply #9 on: January 04, 2011, 05:19:39 pm »
Thanks Vincent :)

Not sure how to revert to r28849, but for now I can live with a minor inconvenience until the bug is fixed in a future nightly build.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12430
  • Debugger - SynEdit - and more
    • wiki
Re: Click Run twice before a project runs?
« Reply #10 on: January 04, 2011, 05:49:52 pm »
Try rebuild without examples.

stabs/dwarf => see project/compiler options, the "linker" page.

You can select what debug info to add to your project. (Obviously debugging only works, if you have any info at all.

there is "-g" (stabs) or "-gs" (dwarf).

Do not strip and do not use external symbols

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Click Run twice before a project runs?
« Reply #11 on: January 04, 2011, 08:01:31 pm »
you can google for MacPorts gdb, there is a version 7.1.

But I have no idea if it works any better. For starters, it seems to have issues with the app bundle, you must either create the app wityhout bundle, or specify the actual app inside the bundle as executable....

Otherwhise, what Mac? intel or ppc? 32 or 64 bit?

I recently got confirmation from some Mac users on Intel 64 bit that they could now run an app in the IDE debug (and 32 Intel seems fine too).
That is a few things were fixed early December...

If not: What error msg?

I figured it wasn't just me...

I have Intel Mac, 10.6, it boots into 64-bit, although Lazarus and its apps of course are only 32-bit.

I did an SVN switch to the 0.9.29 fixes branch, per Vincent's request, so if any trunk fixes have not been merged, then I won't see them.

The debugger starts - I can see that in Activity Monitor, but nothing appears. And shutting it down is difficult. Usually requires a force quit of Lazarus within Activity Monitor.

Debugging outside of Lazarus works fine both for Carbon app bundles and GTK2 non-bundles.

Thanks.

-Phil

Hansaplast

  • Hero Member
  • *****
  • Posts: 783
  • Tweaking4All.com
    • Tweaking4All
Re: Click Run twice before a project runs?
« Reply #12 on: January 07, 2011, 06:34:28 am »
Try rebuild without examples.

stabs/dwarf => see project/compiler options, the "linker" page.

You can select what debug info to add to your project. (Obviously debugging only works, if you have any info at all.

there is "-g" (stabs) or "-gs" (dwarf).

Do not strip and do not use external symbols

I have to admit that this is all a little over my head, the IDE seems to want to compile after removing the examples, until it bumps on a missing dependency. I (probably not a good thing) removed the dependency and the IDE compiled.

I tried to run the project again and the same things happens again. I attached the debug output ... not sure if it helps (forgive me for not being very knowledgeable).

Note:

- I'm on MacOS X v10.6.6 since this morning, which also update XCode to 3.2.5.
- I lost my "Messages" window - I guess I should download the latest nightly build and see how that works for me.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12430
  • Debugger - SynEdit - and more
    • wiki
Re: Click Run twice before a project runs?
« Reply #13 on: January 07, 2011, 01:28:27 pm »

I tried to run the project again and the same things happens again. I attached the debug output ... not sure if it helps (forgive me for not being very knowledgeable).


The same means "debugger entered error state" ?

Unfortunately there is nothing in the debug output that helps.

Also you should open the debug output window *before* you press run. Otherwise it will be incomplete (it is missing a whole lot of the startup)

Only thing I can see is, that it showed the blue dots for unit1, and the continued running. The last thing gdb said, was that the app was running.

----
Actually on a second look. It seems there is something, but I really have no idea what to make out of it....

It seems you gdb totally messes up it's output.
At startup the IDE sets an internal breakpoint, which gets hit. That's all working. When the breakpoint is hit, gdb outputs some info.
Now from the output it does look like gdb is holding back some of the output, and prints it at a random later time.
Which of course means it isn't expected.

However from the debug output I can not tell if that leads to the error, or is unrelated....
Or maybe even is a problem of TMemo, and doesn't even happen for real....

----
the only way to find anything is to recompile the IDE with
-dDBG_VERBOSE -dDBGMI_QUEUE_DEBUG

and start the IDE with --debug-log=file

and then to zip and attach that log file

Hansaplast

  • Hero Member
  • *****
  • Posts: 783
  • Tweaking4All.com
    • Tweaking4All
Re: Click Run twice before a project runs?
« Reply #14 on: January 07, 2011, 08:09:38 pm »
The same means "debugger entered error state" ?

yes it does ...

I'll try a new nightly build this weekend, and let you know what happens.
Thanks for more insight in the debugger :)

FYI:
- I did not add any breakpoints
- Yes the app runs just fine
- Still need to click Run twice

 

TinyPortal © 2005-2018