Sign in Join

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

Mailing lists / lazarus / 2010-04

Debugging code with interfaces

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Juha Manninen

Hi,

is there any known problem with debugging code that uses lots of interfaces? I use gdb with Lazarus under Linux.
I try to port ESS-Model class diagram program.
It has fancy interfaces like:

  IObjectModelListener = interface(IUnknown)
    ['{4CC11ED0-016F-4CC4-952E-E223340B1174}']
    procedure Change(Sender: TModelEntity);
  end;
  IBeforeObjectModelListener = interface(IObjectModelListener)
    ['{714C82A0-1098-11D4-B920-005004E9A134}']
  end;
  IAfterObjectModelListener = interface(IObjectModelListener)
    ['{714C82A1-1098-11D4-B920-005004E9A134}']
  end;

and then calls to QueryInterface:

           if L.QueryInterface(IBeforeObjectModelListener,Dum) = 0 then
             (L as IBeforeObjectModelListener).Change(nil);

When I try to debug some other problems, debugger hits a breakpoint correctly but the system (=Lazarus+gdb) freezes. It doesn't accept mouse clicks or key commands. Killing gdb helps, then Lazarus starts to respond again.

The strange thing is that I can step with F7 and F8 to the same breakpoint and it doesn't freeze. Apparently the interface code is correct. Only if I use F9 to reach the breakpoint then it freezes.

I am not sure if the problem is Interfaces. It was just my guess. Any ideas?

Regards,
Juha

Reply by email

Marc Weustink
to Juha Manninen

Juha Manninen wrote:
...

I am not sure if the problem is Interfaces. It was just my guess. Any ideas?

The only think I've seen is when stepping on
if Supports(ImgReader, ILazImageReader, LazReader)

the debugger jumps everywere, so I guessed the locations are created wrong.

Marc

Reply by email