In this case, the two should be identical. Can you make a super simple example that still reproduce this issue so that we can confirm?
Consider the following program:
program minimal;
{$mode objfpc}{$H+}
uses {$IFDEF UNIX} {$IFDEF UseCThreads}
cthreads, {$ENDIF} {$ENDIF}
Classes { you can add units after this };
var
boolVar: boolean = True;
SomeVar: integer = 0;
begin
if boolVar then
SomeVar += 1
else
SomeVar := SomeVar - 1;
end.
When you debug this program it should start at
then:
and finally:
That is the expected behavior. BUT the current behavior is different at the second step. Instead of showing
it shows:
If you replace += with the full syntax SomeVar := SomeVar + 1 you will see the correct expected behavior.
Here is GDB output when using C operator:
13 if boolVar then
(gdb) n
15 else
(gdb)
17 end.
(gdb)
Here is GDB output *without* C operator:
13 if boolVar then
(gdb) n
14 SomeVar := SomeVar + 1
(gdb)
17 end.
(gdb)