View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0021958LazarusDebuggerpublic2012-05-06 11:422013-09-03 12:07
ReporterAndrzej Borucki 
Assigned ToMartin Friebe 
PlatformOSOS Version
Product Version1.1 (SVN)Product Build 
Target VersionFixed in Version 
Summary0021958: review of "Run to cursor" (F4)
DescriptionProbably it is no debugger error but editor loses focus
TagsNo tags attached.
Fixed in Revision
Attached Filesxml file icon editoroptions.xml [^] (727 bytes) 2012-05-07 11:13
? file icon environmentoptions.xml1 [^] (13,168 bytes) 2012-05-07 11:15

- Relationships
has duplicate 0023106resolvedMarc Weustink Run to cursor (F4) not working 
related to 0022391resolvedMartin Friebe It often say this error when I start debugging or run to cursor 

-  Notes
Martin Friebe (manager)
2012-05-06 13:49

I can not reproduce (win vista 32 bit). Using F4 will go to the correct line, and the editor is focused.

- Are you using any dock manager?
- Exact revision of Lazarus, that you are using?
- Windows version
- FPC version

If you are *not* using a dock manager:
Please attach your EnvironmentOptions.xml and EditorOptions.xml (from lazarus config dir)

Andrzej Borucki (reporter)
2012-05-06 17:02

I don't know if I use dock manager, preferably not because Lazarus windows floats.
Lazarus 1.1 revision 37150
FPC 2.6.1
Windows XP OEM Home
File EnvironmentOptions.xml is in main directory but editoroptions.xml is in C:\lazarus\tools\install\linux\
Martin Friebe (manager)
2012-05-06 17:24
edited on: 2012-05-06 17:26

This environmentoptions is only the default template.

Please look at the "View" menu, there is an entry "IDE internals" > "About IDE"
It will tell you where your primary config path is ("C:\users and documents\....")
This folder will contain both files.

Do you have one or more source-editor windows open?
Can you find out which window is focused after F4?
Did you install any packages?

Do you use F4 to start the application, or to continue from a breakpoint?

Andrzej Borucki (reporter)
2012-05-07 11:23

I install some components: Indy10 and Virtual Tree but now I install again
Lazarus version: 1.1
Lazarus svn revision: 37150
I can't debug with with F4. Focus go to Messages ("Komunikaty" in Polish) window.
I attach today editoroptions.xml and environmentoptions.xml1 (I change name, bacause can't delete previously added file this name)

some questions:
- can I change temporary language of interface Lazarus to English to better communicate ?
- can I delete attached files this Issue?
Martin Friebe (manager)
2012-05-07 17:01
edited on: 2012-05-07 17:19

- Not sure about who can delete. (ask on mail list, please). I removed the wrong one.
- Language can be set in Tools/Options > Desktop
- The packages are ok. None of them should affect focus

1) Didn't answer:
Do you use F4 to start the application, or to continue from a breakpoint?

2) Try Tools/Options > Desktop > "Focus Messages after compilation" (2nd checkbox from bottom). It should not affect you, but try unchecking it anyway.

3) Can you reproduce with a new application.
Just a form and a button. Put 3 or 4 lines in the Button1Click handler ("Caption:='1';", "Caption:='2';" ...).
Set a breakpoint on the first line, hit the button. When reached the breakpoint, try to go 2 or 3 lines using F4

4) [edit] Does the focus work, if instead of F4 you set a breakpoint and use F9?

I still can not reproduce, I will try on my laptop later (which has XP)

Andrzej Borucki (reporter)
2012-05-07 21:12

1)Fortunately I can continue with F4 from a breakpoint, only can't start with it.
2)I can't start with F4 even when change "Focus Messages after compilation"
3)I can't start with F4 but can go to n-th line of Button1Click after stop on breakpoint in line 1.
But if it stop in line 1 of Button1Click and I press F4 in other method - line 1 in Button2Click then debugger stop in last line TControl.Click in (?)
4)Focus work

My diagnosis was wrong - it is no problem with focus, but debugger simply can't start with F4. But simple two-button program cause another problem - 3)
Martin Friebe (manager)
2012-05-07 22:00

Indeed. This is currently the "expected" behaviour (though I agree, few people might really expect this).
And maybe all it needs is documentation?

F4 issues gdb command "until <location>".
And this is limited to be within the current frame. That is it should only break, if the location is reached while the app is in the SAME stack-frame, as when the command was issued. Or if you leave that frame (to the parent frame).

It does not stop, if the location is reached, while in a recursive call. This can be very useful.

Of course that means, if used in start-up, it is impossible to reach the location. Because the location can and will only be reached, while in nested function calls (and that will not break)

Same for using it in other procedures.

So the current behaviour certainly is worth keeping.

It means, that the current implementation, allowing to start an ap with F4 is wrong (because it makes no sense)

If it is possible to *reliably* detect cases where the caret is not in the same procedure, then it could ask. (maybe optional/configurable)

I set the issue to feature-request.
Andrzej Borucki (reporter)
2012-05-08 00:25

Thanks for explaining.
I thought previously that will be good if F4 would be the same as temporal breakpoint, but checking frame is useful in recursive call. F8 is similar?
I note one more strange behaviour of debugger: If I debug I can debug FreePascal libraries, for example if have Button1.Caption:='1' F7 step into TControl.SetText.
But not always..
I can't go into TList.Create or TList.Add
Martin Friebe (manager)
2012-05-08 01:05

For questions please use the mail list or forum.

You might want to read here about your question:,16873.msg92335.html#msg92335 [^]

- Issue History
Date Modified Username Field Change
2012-05-06 11:42 Andrzej Borucki New Issue
2012-05-06 11:42 Andrzej Borucki Widgetset => Win32/Win64
2012-05-06 13:49 Martin Friebe LazTarget => -
2012-05-06 13:49 Martin Friebe Note Added: 0059306
2012-05-06 13:49 Martin Friebe Assigned To => Martin Friebe
2012-05-06 13:49 Martin Friebe Status new => feedback
2012-05-06 13:52 Martin Friebe Summary Run to cursor (F4) not works => Editor looses focus on Run to cursor (F4)
2012-05-06 16:58 Andrzej Borucki File Added: environmentoptions.xml
2012-05-06 17:02 Andrzej Borucki Note Added: 0059312
2012-05-06 17:24 Martin Friebe Note Added: 0059314
2012-05-06 17:26 Martin Friebe Note Edited: 0059314
2012-05-07 11:13 Andrzej Borucki File Added: editoroptions.xml
2012-05-07 11:15 Andrzej Borucki File Added: environmentoptions.xml1
2012-05-07 11:23 Andrzej Borucki Note Added: 0059346
2012-05-07 16:52 Martin Friebe File Deleted: environmentoptions.xml
2012-05-07 17:01 Martin Friebe Note Added: 0059356
2012-05-07 17:19 Martin Friebe Note Edited: 0059356
2012-05-07 21:12 Andrzej Borucki Note Added: 0059367
2012-05-07 22:00 Martin Friebe LazTarget - => post 1.2
2012-05-07 22:00 Martin Friebe Widgetset Win32/Win64 =>
2012-05-07 22:00 Martin Friebe Note Added: 0059370
2012-05-07 22:00 Martin Friebe Severity minor => feature
2012-05-07 22:00 Martin Friebe Status feedback => assigned
2012-05-07 22:00 Martin Friebe Summary Editor looses focus on Run to cursor (F4) => review of "Run to cursor" (F4)
2012-05-08 00:25 Andrzej Borucki Note Added: 0059373
2012-05-08 01:05 Martin Friebe Note Added: 0059374
2012-07-08 02:42 Martin Friebe Relationship added related to 0022391
2012-10-11 00:21 Martin Friebe Project Packages => Lazarus
2012-10-11 00:21 Martin Friebe Category - => Debugger
2012-10-11 00:23 Martin Friebe Relationship added has duplicate 0023106
2013-09-03 12:07 Martin Friebe LazTarget post 1.2 => 1.4

MantisBT 1.2.12[^]
Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker