Sign in Join

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

Mailing lists / fpc-devel / 2009-12

dwarf debug info bugs

10 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Paul Ishenin

Hello, FPC developers' list.

Today I tried drawf on windows again and found some new bugs.

1) Gdb outpus the next strings for RTL units:

file="../objpas/classes/lists.inc",fullname="D:/programming/fpc/rtl/win32/../objpas/classes/lists.inc",line="600"

D:/programming/fpc/rtl/win32/../objpas/classes/lists.inc does not look good :)

2) <-exec-next> steps very strange in the procedures:

1. procedure OutputV(V: Variant);
2. begin
3.  WriteLn(V);
4. end;
5. var
6.  V: Variant;
7. begin
8.  V := 'Test';
9.  OutputV(V);
10. ...

- line 9: -exec-step
- line 3: -exec-next { Why line3 instead of line2? }
- line 4: -exec-next { correctly stepped to Line4 }
- line 3: -exec-next { Why we are back to Line3 ? }
- line 4: -exec-next { We are still inside the OuputV }
- line 10: { finally we can exit }

It is hard to debug something when stepping works non-reliable.

Stabs works more correctly here.

Best regards, Paul Ishenin.

Reply by email

Marc Weustink
to Paul Ishenin: Hello, FPC developers' list. Today I tried drawf on windows again and found some new…
Paul Ishenin wrote 11 lines
Hello, FPC developers' list. Today I tried drawf on windows again and found some new bugs. 1) Gdb outpus the next strings for RTL units: file="../objpas/classes/lists.inc",fullname="D:/programming/fpc/rtl/win32/../objpas/classes/lists.inc",line="600" D:/programming/fpc/rtl/win32/../objpas/classes/lists.inc does not look good :)

What's wrong with it ? it is a valid path and it points to the file

Marc

Reply by email

Paul Ishenin
to Marc Weustink
Marc Weustink wrote
> D:/programming/fpc/rtl/win32/../objpas/classes/lists.inc does not look > good :) What's wrong with it ? it is a valid path and it points to the file

My fault. Probably some lazarus bug prevents opening of the file.

Best regards,
Paul Ishenin.

Reply by email

Paul Ishenin
to Paul Ishenin: Hello, FPC developers' list. Today I tried drawf on windows again and found some new…
Paul Ishenin wrote
It is hard to debug something when stepping works non-reliable.

Marc has exmplained me why I have the strange stepping. It is due to internal try finally which is generated for variants.

I think the solution is to set the same line number for that try-finally nodes as for the variant itself.

Or as Marc suggested - skip generation of line info for the internal try blocks.

Best regards,
Paul Ishenin.

Reply by email

Paul Ishenin
to Paul Ishenin
Paul Ishenin wrote 12 lines
Paul Ishenin wrote: > It is hard to debug something when stepping works non-reliable. Marc has exmplained me why I have the strange stepping. It is due to internal try finally which is generated for variants. I think the solution is to set the same line number for that try-finally nodes as for the variant itself. Or as Marc suggested - skip generation of line info for the internal try blocks.

I made more tests and Variants are not related to the problem.

Then next simple application also has problems with stepping:
program project1;
{$mode objfpc}{$H+}
uses
  SysUtils, Classes;
var
  List: TList;
begin
  // you need to step into 2 times to be in the TList constructor. In
the constructor you will visit first and last lines 2 times
  List := TList.Create;
  List.Free;
end.

Best regards,
Paul Ishenin.

Reply by email

Jonas Maebe
to Paul Ishenin
Paul Ishenin wrote 22 lines
Paul Ishenin wrote: > Marc has exmplained me why I have the strange stepping. It is due to internal try finally which is generated for variants. > > I think the solution is to set the same line number for that try-finally nodes as for the variant itself. > > Or as Marc suggested - skip generation of line info for the internal try blocks. I made more tests and Variants are not related to the problem. Then next simple application also has problems with stepping: program project1; {$mode objfpc}{$H+} uses SysUtils, Classes; var List: TList; begin // you need to step into 2 times to be in the TList constructor. In the constructor you will visit first and last lines 2 times List := TList.Create; List.Free; end.

A constructor also has an implicit try/finally, so the fact that you visit the first and last lines twice is probably the same thing as with the variant. I cannot reproduce the need to "step into" twice on either Mac OS X/i386 or Linux/i386.

Jonas

Reply by email

Paul Ishenin
to Jonas Maebe
Jonas Maebe wrote
A constructor also has an implicit try/finally, so the fact that you visit the first and last lines twice is probably the same thing as with the variant. I cannot reproduce the need to "step into" twice on either Mac OS X/i386 or Linux/i386.

Probably this is something else. Maybe win32 only as I visit first and last for any routine I checked.

Best regards,
Paul Ishenin.

Reply by email