Author Topic: Identifer not found at start of expression / debug  (Read 226 times)

BubikolRamios

  • Sr. Member
  • ****
  • Posts: 398
Identifer not found at start of expression / debug
« on: November 01, 2026, 06:59:25 am »
like:
Code: Pascal  [Select][+][-]
  1. for i := 0 to Length(shiftArray)-1 do
  2. begin
  3.   checkingPoint := Point(previousBlackPoint.x+shiftArray[i,0],previousBlackPoint.y + shiftArray[i,1]);
  4.   if checkingPoint = startBlackPoint then exit;
  5.   ....
  6. end;    
  7.  
Have break point somewhere within loop, pressing F9, it goes thru couple of 100 times, and I can check values in shiftArray , then at one point
at shiftArray  can't see anymore its values (also same thing at some other variables) --> Identifer not found at start of expression.

shiftArray is size 8 , and moving last element to first, deleting last , here and there within loop.

This thing is within recursive proc., and that proc nested within other proc,  if that has anything to do with it. Runs as intended otherwise.

Any clue ?
« Last Edit: November 01, 2026, 07:21:44 am by BubikolRamios »
lazarus 3.2-fpc-3.2.2-win32/win64

jamie

  • Hero Member
  • *****
  • Posts: 8072
Re: Identifer not found at start of expression / debug
« Reply #1 on: November 01, 2026, 11:08:45 pm »
I would guess that if you are re-cursing you most likely running out of Debug resources and hitting a predefined limit.

 Personally I try to avoid re-cursing.

Jamie
The only true wisdom is knowing you know nothing

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12820
  • Debugger - SynEdit - and more
    • wiki
Re: Identifer not found at start of expression / debug
« Reply #2 on: November 01, 2026, 11:35:32 pm »
Would need some more info...

First of all:
- Which debugger are you using?
   Menu: Tools > Options > Debugger backend => there is FpDebug, lldb(with FpDebug), gdb, ...
   (The exact choice depends on your OS).
- Your Lazarus version
- Your OS
- Your projects "Debug info" settings. Which version of DWARF?
- Did you compile with optimization on/off? -O- (off), -O1 or -O2 ?

How is the variable declared?
Are you in a nested procedure?

A recursion would not normally make the identifier "go away" => but if you exceed the stack (endless/deep recursion) then you get an error (wouldn't actually stop at the breakpoint).

Open the stack window (menu "View": Debug windows > Call Stack) => are you inside the function?

Also, if you are on the very first/last line odd things may happen.

Is there a try/except or try/finally block?
Inside finally blocks, issues may arise (shouldn't, but ....)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12820
  • Debugger - SynEdit - and more
    • wiki
Re: Identifer not found at start of expression / debug
« Reply #3 on: November 01, 2026, 11:43:00 pm »
If you are Windows/Linux with i386 or x86 => then FpDebug is recommended.
If you are Mac (aarch64) then LLDB(with FpDebug) is recommended.

If you use any other, consider trying that.

If you use this, consider testing with Lazarus 5.0RC1.

 

TinyPortal © 2005-2018