Dwarf Stabs,line info not correct for line with "begin"
Original Reporter info from Mantis: Martin @martin_frb
-
Reporter name: Martin Friebe
Original Reporter info from Mantis: Martin @martin_frb
- Reporter name: Martin Friebe
Description:
This appears to happen for dwarf and stabs, with and with external linker.
with the code below, line info is generated for the "begin" line (of TestMe).
At least "-symbol-list-lines p" does return info for that line.
However when single stepping the debugger will not stop on this line (a breakpoint will stop on the next line too)
Uncommenting the line "s := s +'a'" and it will work as expected.
Though even with the line commented (when the debugger does not stop on this line), code is generated for that line. From the assembler:
# [project1.lpr]
# [6] begin
pushl %ebp
movl %esp,%ebp
subl $48,%esp
movl %ebx,-48(%ebp)
# Var s located at ebp-4
movl %eax,-4(%ebp)
call FPC_ANSISTR_INCR_REF
.stabn 68,0,7,.Ll2 - P$PROJECT1_TESTME$ANSISTRING
.Ll2:
# [7] writeln(s);
leal -16(%ebp),%ecx
The problem occurs too with simplier code
procedure TestMe;
begin
writeln(1);
end;
But even this code has assembler instructions for the "begin" line.
Checking the disassembler of the actual produced exe, shows that the code was not inlined.
Additional information:
program project1;
{$mode objfpc}{$H+}
procedure TestMe(s: string);
begin
writeln(s);
//s:= s+'a';
end;
begin
TestMe('aa');
readln;
end.
Mantis conversion info:
- Mantis ID: 19466
- OS: win
- OS Build: vista
- Platform: w32
- Version: 2.5.1
- Monitored by: » Cyrax (Cyrax)