Recent

Author Topic: Lazarus source editor and assembler windows behaviour  (Read 2043 times)

lagprogramming

  • Sr. Member
  • ****
  • Posts: 405
Lazarus source editor and assembler windows behaviour
« on: July 08, 2023, 02:55:14 pm »
Lazarus team is preparing to release a new stable version. In linux-64, at least in lxde, there is a problem that appeared a couple of months ago and hasn't been reported and fixed.
Most of the times if you maximize both source editor and assembler windows and you debug by clicking the "Step into/over instruction" buttons, then the source editor window will appear on top of the assembler window. You have to click on the assembler window to bring it to front, click the "Step into/over instruction" button again, the source editor window appears again on top of the assembler window, bring the assembler window to front again and so on.
Using an "Always on top" desktop environment feature on the assembler window raises other problems.
I think it would be better if the sendtoback/bringtofront would be disabled, or at least add an option, something like a checkbox in the assembler window to disable this feature.
If the above explanation is not good enough I can record a video to show exactly what happens with these two windows.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus source editor and assembler windows behaviour
« Reply #1 on: July 08, 2023, 03:23:14 pm »
I think I understand...  (Though not sure, if you use Anchordocking, and if any of it is related to anchordocking)

But, I don't think the default behaviour should be changed.

"Step in" / "Step over" act on source lines. They result in the debugger stopping (on a line) in the Pascal source code. Therefore they should focus and bring to front the source window.

"Step ... instruction" acts on assemble code (but you may have to do many, for one line of Pascal). And they should focus and bring to front the asm Window.




Your situation as I understand it, is quite particular.

- You want to step Pascal code
- You want to see the assembler code relating to the current line of Pascal code
- You have overlapping Source/asm windows.

In fact, on the last item: Not just overlapping. But both maximized (leaving space for the main IDE bar), meaning you don't want to see the Pascal source at all.

As I said, the behaviour of normal stepping to go to the  source editor is essential. At least as default.

Stay on top seems like a natural solution. Except it affects other windows, and doesn't prevent focus.

Not sure how to best solve... need some brain storming.

If editor macros could wait for the debugger to finish the step, then you could have a macro to refocus the asm window, but even then it would flicker.


lagprogramming

  • Sr. Member
  • ****
  • Posts: 405
Re: Lazarus source editor and assembler windows behaviour
« Reply #2 on: July 08, 2023, 06:21:27 pm »
I've attached a video to this message.
I'm stepping in the assembler window. The source editor window pops up even though the pascal line remains the same and I don't see a benefit in that.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus source editor and assembler windows behaviour
« Reply #3 on: July 08, 2023, 06:42:38 pm »
Quote
clicking the "Step into/over instruction" buttons

My fault you mentioned the "... instruction" => but when I read button....

So yes, stepping asm, should stay in the asm window => that is a bug. Please open an issue.


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus source editor and assembler windows behaviour
« Reply #4 on: July 09, 2023, 08:23:13 pm »
Ok, just while looking at something else... The problem is there, and it comes down to total lack of implementation...
So you need to report an issue, or it might get forgotten.


Current behaviour is
* On key/button press
- sent the step... instruction command to the debugger
- open and focus the asm (this is only done for "... instruction" commands)

* On Command finishes (any step or run => i.e., on enter pause)
- if a source location exists (even if in the middle of a line) => focus the source editor


Problem is the command is async. So the 2nd part happens later in an event. And currently the debugger is unaware of what was the last command.
So it can't simple do "if command in ... then "


 

TinyPortal © 2005-2018