Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/TD Debug Info    [ Add a report in this area ]  
Report #:  84849   Status: Open
"Blue dots" are misplaced for calls to System.Assert and other intrinsic routines [REGRESSION]
Project:  Delphi Build #:  14.0.3593.25826
Version:    14.0 Submitted By:   Blaise Thorn
Report Type:  Basic functionality failure Date Reported:  5/24/2010 3:05:31 AM
Severity:    Commonly encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   276815
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
Invoking some intrinsic routines (without the delimiting ";") causes the compiler to generate wrong debug information for source line numbers.

Compile the test case #1 in the IDE. The "blue dot" is placed on "else begin" instead of on "assert(false)".

This is a regression introduced either in Delphi 2009 or Delphi 2010.

Excerpt from the MAP file:
Line numbers for PROGRAM(bug.dpr) segment .itext
     2 0002:000000AC     3 0002:000000BC     4 0002:000000CB     6 0002:000000D4
     7 0002:000000EA     9 0002:000000F3
Steps to Reproduce:
// test case #1

var a: integer;
begin

a := random(100);

if a < 50 then


assert(false)

else begin    // this "blue dot" is wrong, it should be one line above


pinteger(a)^ := 0

end
end.

// test case #2

begin

try


readln        // placing ";" here fixes the problem

except

end
end.

// test case #3

begin

writeln;

writeln        // placing ";" here fixes the problem
end.
Workarounds
Append ";" where it is possible. Where it's not, introduce an additional compound statement (begin ... end).
Attachment
None
Comments

Tomohiro Takahashi at 5/24/2010 6:03:08 AM -
As a workaround, please try to add begin/end for if block as below.
------------
  if a < 50 then begin
    assert(false);
  end
  else begin
    pinteger(a)^ := 0
  end
------------

Server Response from: ETNACODE01