Sign in Join

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

Mailing lists / lazarus / 2017-02

debugging interface method calls

12 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

David Emerson

Hi all,

It seems that when I am stepping through my code, when there is an interface function call, the debugger will not step into the function call.

Is there a way to make it step in?

Or maybe there is a limitation with GDB or lazarus or something?

Below is example code

Thanks!
~David.

program intf_debug;
{$mode objfpc}{$H+}
{$interfaces corba}

uses
classes,

   sysutils;
type
   i_test = interface
     ['{aa}']
     function do_test : boolean;
     end;
   t_test = class (tobject, i_test)
     function do_test : boolean;
     end;
function t_test.do_test: boolean;
   begin
     writeln ('hi');
     result := true;
   end;
var
   t : t_test;
   i : i_test;
begin
   t := t_test.create;
   t.do_test; // If I press F7 here, it steps into t_test.do_test
   supports (t, i_test, i);
   i.do_test; // F7 steps over, not into t_test.do_test
end.

Reply by email

Graeme Geldenhuys
to David Emerson
David Emerson wrote
It seems that when I am stepping through my code, when there is an interface function call, the debugger will not step into the function call. Is there a way to make it step in?

No, and that is very annoying indeed.

I believe I already reported it on Mantis some time ago, but can't seem to find the actual report now. Maybe it is worth adding a new Mantis report.

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email

Ondrej Pokorny
to Graeme Geldenhuys
Graeme Geldenhuys wrote 6 lines
On 2017-02-01 03:36, David Emerson via Lazarus wrote: > It seems that when I am stepping through my code, when there is an > interface function call, the debugger will not step into the function call. > > Is there a way to make it step in? No, and that is very annoying indeed.

Dwarf2 should support it, AFAIK.

Ondrej

Reply by email

David Emerson
to Graeme Geldenhuys: No, and that is very annoying indeed. I believe I already reported it on Mantis some time…
Graeme Geldenhuys wrote 15 lines
On 2017-02-01 03:36, David Emerson via Lazarus wrote: > It seems that when I am stepping through my code, when there is an > interface function call, the debugger will not step into the function call. > > Is there a way to make it step in? No, and that is very annoying indeed. I believe I already reported it on Mantis some time ago, but can't seem to find the actual report now. Maybe it is worth adding a new Mantis report. Regards, Graeme

Thanks! Too bad.

http://mantis.freepascal.org/view.php?id=30541

I guess I should try fpdebug!

~David

Reply by email

David Emerson
to Ondrej Pokorny: Dwarf2 should support it, AFAIK. Ondrej
Ondrej Pokorny wrote 12 lines
On 01.02.2017 10:16, Graeme Geldenhuys via Lazarus wrote: > On 2017-02-01 03:36, David Emerson via Lazarus wrote: >> It seems that when I am stepping through my code, when there is an >> interface function call, the debugger will not step into the function >> call. >> >> Is there a way to make it step in? > No, and that is very annoying indeed. Dwarf2 should support it, AFAIK. Ondrej

I tried all the debugging options: automatic; dwarf with sets; dwarf2; stabs; dwarf3 beta. None of them would step into the interface function call. fpc 3.0.0 / laz 1.6 / gdb 7.7.1

Reply by email

Ondrej Pokorny
to David Emerson
David Emerson wrote
I tried all the debugging options: automatic; dwarf with sets; dwarf2; stabs; dwarf3 beta. None of them would step into the interface function call. fpc 3.0.0 / laz 1.6 / gdb 7.7.1

I tested as well. I was able to step in with automatic Debugger options (not dwarf2). I use GDB from 1.4.2 - no idea what version it is.

Ondrej

Reply by email

Graeme Geldenhuys
to David Emerson: Thanks! Too bad. http://mantis.freepascal.org/view.php?id=30541 I guess I should try…
David Emerson wrote

Thanks - no idea how you found that. :)

You (or somebody else), please teach me how searching in Mantis works. The same goes for the Lazarus Forum. I can never find anything I search for - even with multiple combinations of words, + sign, quoted etc... Can it really be that hard. :-(

Regards,
Graeme

Reply by email

Ondrej Pokorny
to Graeme Geldenhuys: That was my hope too, but fpdebug is not supported on FreeBSD (what I use). It seems only…
Graeme Geldenhuys wrote
On 2017-02-01 20:27, David Emerson via Lazarus wrote: > I guess I should try fpdebug! That was my hope too, but fpdebug is not supported on FreeBSD (what I use). It seems only Linux and Windows is currently supported. :-/

Having a real pascal debugger would be the killer feature.

Do you know the state of fpDebug? Who does develop it? Do you? https://github.com/graemeg/fpdebug doesn't show much recent progress :(

Ondrej

Reply by email

David Emerson
to Graeme Geldenhuys: Thanks - no idea how you found that. :) You (or somebody else), please teach me how…
Graeme Geldenhuys wrote 10 lines
On 2017-02-01 20:27, David Emerson via Lazarus wrote: > > http://mantis.freepascal.org/view.php?id=30541 Thanks - no idea how you found that. :) You (or somebody else), please teach me how searching in Mantis works. The same goes for the Lazarus Forum. I can never find anything I search for - even with multiple combinations of words, + sign, quoted etc... Can it really be that hard. :-(

http://mantis.freepascal.org/view_all_bug_page.php

Click "Reporter" - top left of the grid
select name from ridiculous long list

fill in search box, I searched for interface step
click apply filter

~David

Reply by email

Graeme Geldenhuys
to Ondrej Pokorny: Having a real pascal debugger would be the killer feature. Do you know the state of…
Ondrej Pokorny wrote
Having a real pascal debugger would be the killer feature.

Indeed!

Do you know the state of fpDebug? Who does develop it? Do you? https://github.com/graemeg/fpdebug doesn't show much recent progress :(

The one on my github page is different to the one include with Lazarus sources. Yes, other "paid work" priorities has pulled me away from continuing my fpdebug project. Unfortunately the name conflict is a bit confusing too. Both share some code from a prior Duby Debugger project too.

I believe Joost and Martin are maintaining fpdebug included with Lazarus (<laz>/components/fpdebug/).

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email