Forum > Debugger

Debugger doesn't display range check errors

(1/3) > >>

dg4fac:
Hi.

I am working with Lazarus 2.2.0 under Win10. While always working very fine, I now realize that the debugger does not work. I am getting range check errors, and the debugger doesn't provide any hints on the reasons. And I have all debug options activated!

I provoked a range check error by accessing an array out of its bounds. The range-check-error-message appears. But if I abort the program execution the debugger does not allow to locate the line where it occurred. It is simply missing the option to locate the last executed line.

What can be wrong here? With that the debugger is not useful.

brgs, gsc

Martin_fr:
Works fine for me. Could you share more details please?

See my screen captures. (the order is wrong, the lower picture comes first)

1) Debugger Exception Notification
The line is already there.

2) After pressing "Break"
Line is indicated / Stack has info.

- I used "Dwarf with sets", but it should be the same when using just Dwarf, or Dwarf-3.
- I tested with -O1 => but other settings should work. Though for debugging "no opt" is the best.

It also works (I tested) if I do not use "sysutils".
The difference should be, that if you "continue" on the "Run Error", then with SysUtils you additionally get an Exception (the exception can also be caught by your code using "try except end". The run-error does not trigger this)


Please check under Tools > Debugger > Backend: Are you using FpDebug?

If you have "inlined" code, you may want to try and disable this for the unit in question. "{$INLINE off}"

Martin_fr:
Just adding one other note:

It is possible, depending on how FPC was compiled, that the "FPC_BREAK" procedure "hides" the caller.

That is the stack window will be missing one entry. in case of my example this would be the line "Foo" => then you only see the caller of code that triggers the error.

This is a known issue, but there is currently no fix.

dg4fac:
Hi.


--- Quote from: Martin_fr on May 11, 2022, 08:27:59 pm ---Works fine for me. Could you share more details please?
--- End quote ---

Here are my debugger entries.

I dont get a message like yours. The range check error window occurs. If I press Abort, the progam is killed and is completely removed, no error message appears any more. If I press continue, the program continues, again without any debugger infos.


--- Quote from: Martin_fr on May 11, 2022, 08:27:59 pm ---It also works (I tested) if I do not use "sysutils".
The difference should be, that if you "continue" on the "Run Error", then with SysUtils you additionally get an Exception (the exception can also be caught by your
code using "try except end". The run-error does not trigger this)

--- End quote ---

All my units use sysutils. No exeption occurs.


--- Quote from: Martin_fr on May 11, 2022, 08:27:59 pm ---Please check under Tools > Debugger > Backend: Are you using FpDebug?

--- End quote ---

Yes.


--- Quote ---If you have "inlined" code, you may want to try and disable this for the unit in question. "{$INLINE off}"

--- End quote ---

No inline code used.

brgs, gsc

Martin_fr:
"avr sim" => you have Win10 on AVR? or you are debugging an embedded target?

Also your 3rd picture shows "Debugger > General".
But what is set in "Debugger > Backend" ?


If you are using avr that is maintained by Christo. So I would have to notify him.

Navigation

[0] Message Index

[#] Next page

Go to full version