Forum > Debugger

Debugger doesn't display range check errors

<< < (2/3) > >>

dg4fac:

--- Quote from: Martin_fr on May 12, 2022, 11:04:42 am ---"avr sim" => you have Win10 on AVR? or you are debugging an embedded target?
If you are using avr that is maintained by Christo. So I would have to notify him.

--- End quote ---

No, avr_sim is not a simulator for Lazarus code using Pascal language, but a simulator for AVR assembler language files only. avr_sim is a stand-alone simulator, written in Lazarus Pascal and distributed as Win and Lin 64-bit executable, that eats assembler source code files and simulates them on a PC or laptop. It produces Intel-Hex-Code only from the assembler source code, not from Pascal source code.
No need to notify Christo.
(Sidekick: I hate high-level-languages on AVRs, for me high-level languages on AVRs are like applying a bicycle instead of a Formula 1 racer car - or at least a Fiat 500 - to get forward. Highlevel lamguages produce more than 90% scrap code when converting it to assembler, I hate that, it is completely inappropriate.)


--- Quote from: Martin_fr on May 12, 2022, 11:04:42 am ---Also your 3rd picture shows "Debugger > General".
But what is set in "Debugger > Backend" ?

--- End quote ---

The backend is set to FpDebug. Do you need a screenshot as well?

In the meantime I have tested debugging in a new project. The properties and settings of the new project look exactly like in avr_sim. A forced exception works perfect, the debugger shows its correct message.  But not so in avr_sim: if I provoke an exception in avr_sim, the debugger window does not appear. It is like no exception is created.

brgs, gsc

dg4fac:
Hi.

Now it is getting even crazier. If I set debugging to Release (and remove all range checks), I get the added error message. Unfortunately I can't find out the source code line where this access exception occurred.

brgs, gsc

ccrause:

--- Quote from: dg4fac on May 12, 2022, 11:59:07 am ---No, avr_sim is not a simulator for Lazarus code using Pascal language, but a simulator for AVR assembler language files only.
--- End quote ---

I assume avr_sim refers to Gerd's AVR simulator?  If so, this is indeed a regular PC type application.  Since the source is available for download, can the OP please give exact steps on how to produce this specific range check error (for example open unit X, change value Y on line Z, compile, run then click on button A and observe crash...)?

Martin_fr:
Ok...


--- Quote ---The backend is set to FpDebug. Do you need a screenshot as well?
--- End quote ---
Nope, no screenshot.

But, ....

1) please also check in your "project options" on the page "Debugger" (below "Verschiedenes") => It should say "Use IDE default debugger".

2) In your "project options" > "language exceptions" ("Sprach Ausnahmen") => What entries do you have listed?
  Are any "run error ..." or "range check" listed?

3) When you debug, are there "little blue dots" in the editor's gutter?

4) Your code will stop at a breakpoint?

5a) 64 or 32 Bit Lazarus IDE installed?
5b) 64 or 32 Bit project (i.e. cross compiled to 32 bit)?

6) Do you have libraries (dll) written in Pascal? And is the failing code in such a library?

7) Does the debugger inform you if you run this?

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---type TFooExcept = class(Exception) a: byte; end;begin  raise TFooExcept.Create('123'); 

---- EDIT

8) Is some of your code in (a) package(s)?
  If so, open the package and ensure it is also compiled with dwarf debug info.

Martin_fr:

--- Quote from: dg4fac on May 12, 2022, 12:27:38 pm ---Now it is getting even crazier. If I set debugging to Release (and remove all range checks), I get the added error message. Unfortunately I can't find out the source code line where this access exception occurred.

--- End quote ---

That is the normal. If the range check is not stopped, then it often causes other errors.
An unfixed range-check can cause anything from
- nothing
- weird behaviour of the app (wrong (re-)action of any unrelated code in the app)
- access violation

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version