Recent

Author Topic: Can't get "step over" to work  (Read 3791 times)

gagutman@uci.edu

  • Newbie
  • Posts: 5
Can't get "step over" to work
« on: April 23, 2014, 07:51:26 pm »
I can't get F7 or F8 to behave as I expect, if I type either one once my console window opens, a second hit causes the program to run to completion as if I had typed CTL-F9.  The F4 (run to cursor) option is not available.  I'm running Lazarus 1.2.0/FPC 2.6.6 under W7/32

I've used the TP and FPC IDEs for a long time, but I'm having a real struggle getting started in Lazarus, will appreciate any guidance.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Can't get "step over" to work
« Reply #1 on: April 23, 2014, 08:01:52 pm »
Stepping to start a not yet running program does not work.

It will stop at the main entry point, which is not in your source..

You need to set a breakpoint on the first line that you want to stop, and once you reached that line, you will be able to step.


gagutman@uci.edu

  • Newbie
  • Posts: 5
Re: Can't get "step over" to work
« Reply #2 on: April 23, 2014, 08:29:35 pm »
Thanks, that works - and "F4" now appears,.  Just out of curiosity, is there a reason one can't start a program that way?  By the way, I don't see the Menu/Environment tab that had been mentioned in several posts I saw when I was looking through the forum.  Should I be seeing this?

Funny thing - after I posted my original message I played with the default program that comes up as "New Project", I added a Writeln statement between Begin and End and found that F8 (or maybe F7, I can't remember which), started the program exactly as as I had expected, stepping sequentially through the three lines (Begin, Writeln, End).  I was logging back onto the Forum to report that when I found your (prompt!) reply.  But now I can't duplicate that behavior.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Can't get "step over" to work
« Reply #3 on: April 23, 2014, 08:53:00 pm »
It is a missing feature.

It is not always that simple to find the first line of a program. (In some cases it does work, bot more often it does not (yet))

And for GUI apps it makes little sense, because it would stop in the automatically generated code, in the project (form/application creation).


Note: F4 only works within the current procedure.

 

TinyPortal © 2005-2018