Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2016-02

debug info for nested procedures

3 messages · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin
procedure TForm1.FormCreate(Sender: TObject);
   var   i: Integer;
   procedure foo;
   begin       i := i + 1;      end;
begin
   i := 11;
   foo;
   Caption := IntToStr(i);
end;

it appears that fpc now adds explicit debug info for "i" in the nested procedure (dwarf and stabs)?
And when using dwarf also drop $parentfp ? (still there for stabs)

However I tested with gdb (win 32 bit 7.7.1 and 7.10) and both displayed a wrong value.
Is there any gdb that can display this?

http://forum.lazarus.freepascal.org/index.php/topic,31095.msg201654.html#msg201654

Reply by email

Martin
procedure TForm1.FormCreate(Sender: TObject);
   var   i: Integer;
   procedure foo;
   begin       i := i + 1;      end;
begin
   i := 11;
   foo;
   Caption := IntToStr(i);
end;

it appears that fpc now adds explicit debug info for "i" in the nested procedure (dwarf and stabs)?
And when using dwarf also drop $parentfp ? (still there for stabs)

However I tested with gdb (win 32 bit 7.7.1 and 7.10) and both displayed a wrong value.
Is there any gdb that can display this?

http://forum.lazarus.freepascal.org/index.php/topic,31095.msg201654.html#msg201654

Reply by email

Martin
to Martin: procedure TForm1.FormCreate(Sender: TObject); var i: Integer; procedure foo; begin …

Please ignore the below. "i" was a bad choice for testing. There may be a global var somewhere.

works fine, when the variable name is not used elsewhere.

Martin wrote 25 lines
procedure TForm1.FormCreate(Sender: TObject); var i: Integer; procedure foo; begin i := i + 1; end; begin i := 11; foo; Caption := IntToStr(i); end; it appears that fpc now adds explicit debug info for "i" in the nested procedure (dwarf and stabs)? And when using dwarf also drop $parentfp ? (still there for stabs) However I tested with gdb (win 32 bit 7.7.1 and 7.10) and both displayed a wrong value. Is there any gdb that can display this? http://forum.lazarus.freepascal.org/index.php/topic,31095.msg201654.html#msg201654 _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email