About Debug in Harbour

116 views
Skip to first unread message

marcop...@gmail.com

unread,
Feb 24, 2026, 9:11:33 AMFeb 24
to Harbour Users
  Why, in Harbour, during debugging, does this small code snippet jump directly from the line if a = 1 to the line return, skipping the exit line when I step through the code using F8?

function main
clear
a = 1
altd()
do while .t.
   if a = 1
      exit
   endif
   a ++
enddo
return    

Przemyslaw Czerpak

unread,
Feb 24, 2026, 11:11:56 PMFeb 24
to harbou...@googlegroups.com
Hi,

Harbour optimizes generated PCODE, removes dummy jumps,
joins others, etc. If you do not like then use -kj compile time switch.
If you want to see the difference in generated code then use -gc2
compiler switch and compare generated C files, i.e.:
    harbour -ks -gc2 tst.prg

best regards,
Przemek


W dniu 24.02.2026 o 15:11, marcop...@gmail.com pisze:
return     --
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-users/317039c1-7005-4463-937e-7f4a57a5abcen%40googlegroups.com.

marcop...@gmail.com

unread,
Feb 25, 2026, 6:21:31 AMFeb 25
to Harbour Users
Thanks,
Reply all
Reply to author
Forward
0 new messages