Sign in Join

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

Mailing lists / fpc-devel / 2011-01

Attn Joost: the ampersand in dwarf for var-param

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Martin

I just noticed, a (good) change in dwarf 2, fpc trunk (ot I believe I noticed)

in dwarf2, var param (param by ref) where encoded with an &

procedure a(var Foo: TObject):

ptype Foo
type = &TFOO = class : public TOBJECT

whatis Foo
type = &TFoo

Today, I looked at it, and the ampersands are gone?

In Dwarf they where never there, in dwarf the var-param alwas behaved like normal var (you would never noticed the extra pointer layer) => seems dwarf caught up?

Martin

Reply by email

Martin
to Martin

Been to quick...
Found the answer

Revision: 16683
Author: joost
Date: 14:49:20, 02 January 2011
Message:
* Dwarf: Hide the implicit pointer from a function-parameter which is passed
by reference, and dereference the (hidden) pointer in the DW_AT_location block. This solves problems with function parameters defined as 'var' ----
Modified : /trunk/compiler/dbgdwarf.pas

--------------------------
But it seems that now, even in dwarf-3 objects are treated as pointer again? (I can happily live with that. I just want to know)

Martin wrote 23 lines
I just noticed, a (good) change in dwarf 2, fpc trunk (ot I believe I noticed) in dwarf2, var param (param by ref) where encoded with an & procedure a(var Foo: TObject): ptype Foo type = &TFOO = class : public TOBJECT whatis Foo type = &TFoo Today, I looked at it, and the ampersands are gone? In Dwarf they where never there, in dwarf the var-param alwas behaved like normal var (you would never noticed the extra pointer layer) => seems dwarf caught up? Martin _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Joost van der Sluis
to Martin
Martin wrote
Been to quick... Found the answer

I though you'd noticed this earlier. I also wrote it in one of the mails last week?

But it seems that now, even in dwarf-3 objects are treated as pointer again? (I can happily live with that. I just want to know)

Yes, that was the (final?) conclusion from the discussion with you and Jonas. It is also why I said you were too fast with your tests, because I still had to change this.

Note that there will be more changes. Now effectively the Dwarf-2 code for writing object-info is used for Dwarf 3 also. But there were some additions in them old Dwarf-3 code, that I have to re-implement. (In such a way that as much as possible code is shared between Dwarf-2 and Dwarf-3)

Joost.

Reply by email

Martin
to Joost van der Sluis
Joost van der Sluis wrote 5 lines
On Fri, 2011-01-14 at 21:27 +0000, Martin wrote: > Been to quick... > Found the answer I though you'd noticed this earlier. I also wrote it in one of the mails last week?

Seems I have missed that, sorry.
Anyway, that is good news...

Show quoted text 5 lines
> But it seems that now, even in dwarf-3 objects are treated as pointer > again? (I can happily live with that. I just want to know) Yes, that was the (final?) conclusion from the discussion with you and Jonas. It is also why I said you were too fast with your tests, because I still had to change this.

That is also good news.

Especially since I found a better way to distinguish between var

   a: TObject;
   b: ^TObject;

in order to display the correct data in the IDE.
And the new way (once implemented) will also work if the debug info is mixed dwarf/stabs

ptype a^
ptype b^

will return correct (note the ^ in front of TObject) a^: ~"type = TObject = class : ....
b^: ~"type = ^TObject = class : .....

And that is the same for all kind of debug infos :)

And with luck, that will work with the Mac 6.3.50 as well (because 6.3.50 cannot do "whatis TObject" => and current IDE wants that...)

Show quoted text 5 lines
Note that there will be more changes. Now effectively the Dwarf-2 code for writing object-info is used for Dwarf 3 also. But there were some additions in them old Dwarf-3 code, that I have to re-implement. (In such a way that as much as possible code is shared between Dwarf-2 and Dwarf-3)

I will start filling in reports...

Have you sen the RunGdbmi app next to my test? It allows you to run a set of gbd instructions to the same application, with different debuggers[1], different compilers[1], and different gw/gs settings, and see all the result at once.

[1] assuming you use gdblist.txt and fpclist.txt files

The advantage is, you see the actual gdb output, instead of what the IDE does with it....

Martin

Reply by email