Forum > Editor

F8 - jump only to my code

<< < (2/4) > >>

Martin_fr:

--- Quote from: jcmontherock on August 03, 2022, 12:05:16 am ---In a similar way, how to avoid F8 from going to assembly part of instructions?

--- End quote ---

You mean when it hits an exception or run error?
Or are there other cases, where this happens?

Also, since you made your question explicitly about F8: Are there any cases where it happens with F8, but not with F7 or F9?
Or was the mention of F8 just an accident, and you meant the question for all cases of F7, F8 or F9?


There is no way to avoid the asm...
In some cases when this happens, it happens due to a bug.

1)
Check the stack window => if it does show (iirc limited to the top 30 entries) a stackframe that has sources => then the asm should not open at all.
Yet I know it does. It's a bug in that case.

2)
If the stack window does not show any entry with sources => then the IDE does have no source line to show.

It has 2 options (that I can think of)
- show the asm
- show a dialog: "The app stopped at an unknown location"

Would such a dialog really be better?

Mind, if you have an other idea what it could do, when it can not find out any source line ... well, please tell your idea.
But doing "nothing" is not an option. There must be some sort of info that the app paused.

Doing "nothing extra" could be an option, if an "app raised exception" dialog already gave the user the info....

In any case, if you are not aware: The IDE has an option to auto-close the asm window. If it pops open in the above case, and you continue with F9 (or anything that gets you back to sources) => the asm will be closed again.

Thaddy:

--- Quote from: jcmontherock on August 03, 2022, 12:05:16 am ---In a similar way, how to avoid F8 from going to assembly part of instructions?

--- End quote ---
If you want to debug the compiler itself or one of the standard libraries you need no compile everything with debug information.
Then you get what you want, but for beginners or intermediates it is not that straightforward, but doable.

Martin_fr:

--- Quote from: Thaddy on August 03, 2022, 02:59:29 pm ---If you want to debug the compiler itself or one of the standard libraries you need no compile everything with debug information.
Then you get what you want, but for beginners or intermediates it is not that straightforward, but doable.

--- End quote ---
In the context of the thread "stick to the users own (aka user-written) units only" (derived from the original post quote "the main unit"), and seeing no indication in jcmontherock's post that his post wasn't part of that context, how did we get to debugging - with full indent of the user - the RTL or FCL?

Or do you, @Thaddy, have information that he is indeed the author of any of those units? scnr.

Martin_fr:

--- Quote from: Nicole on August 02, 2022, 04:45:46 pm ---that the step F8 only stopped in the main unit.
--- End quote ---

--- Quote from: Martin_fr on August 02, 2022, 08:04:04 pm ---Is that when you use F8 to step from one paused line to the next line?
--- End quote ---

Just been struck by an idea...
(Though, it may not be your issue, since you did not mention a faulty "step in" / see below)

You wouldn't by any chance (still) be using the gdb backend?

Tools > Option :: Debugger > Debugger Backend.
=> That really should say ... "[FpDebug internal Dwarf-debugger]"

If you are using the GDB backend:
GDB (or at least many versions of it, not sure if fixed in the meantime) has an issue. This is either within gdb, or in some form triggered by the way FPC provides debug info.

This issue means, that on "step over" (F8), the debugger would sometimes perform a "step in". And that could be a "step in" to code in the LCL/FCL/RTL or elsewhere....

The gdb backend has a workaround for this, but it isn't enabled by default, because there is no way to know if the selected version of gdb, in combination with the configured fpc, and for the selected platform/target is actually exposing the issue....
The workaround can be enabled in the "debugger backend" setting for gdb. It is in the property grid under the name "FixIncorrectStepOver".

However, I would really recommend not to use the gdb backend, if possible.
You should change to the FpDebug backend.

New Lazarus installations actually default to FpDebug. But in case of an upgrade, it can happen that the old config is kept. Then the upgrade to FpDebug must be done by the user themself.

jcmontherock:
How do we do an update of fpDebug under Windows ?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version