Sign in Join

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

Mailing lists / fpc-devel / 2013-10

question on dwarf2 info written by fpc 2.6.2

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Martin

Just curliousity, nothing of the below is in any way a problem. Only I would like to understand.

program project1;
var a: integer;
begin
   a:=1;
end.

generates for "a"
DW_TAG_variable
which points to (via DW_AT_type) DW_TAG_typedef which points to (via DW_AT_type) DW_TAG_base_type

Looking at the rtl source, you will see
     type Integer: longint;

"integer" is a declared type, of the build in (base type) longint.

DW_TAG_base_type has DW_AT_name = longint. That is expected

DW_TAG_typedef has DW_AT_name = longint. That I do *NOT* understand. DW_TAG_typedef stands for the definition of "Integer", or does it not? If it does, then should not the name be "integer"?

On the other hand
var a: longint;
generates the same. Why?

Reply by email

Paul Ishenin
to Martin

06.10.13, 3:08, Martin пишет:

On the other hand var a: longint; generates the same. Why?

Because Integer is an alias - inside compiler only the symbol is different for thise case and the definition is the same.

Best regards,
Paul Ishenin

Reply by email

Martin
to Paul Ishenin
Paul Ishenin wrote 8 lines
06.10.13, 3:08, Martin пишет: > On the other hand > var a: longint; > generates the same. Why? Because Integer is an alias - inside compiler only the symbol is different for thise case and the definition is the same.

Yes, I know, I even wrote.

Show quoted text 6 lines
DW_TAG_base_type has DW_AT_name = longint. That is expected DW_TAG_typedef has DW_AT_name = longint. That I do *NOT* understand. DW_TAG_typedef stands for the definition of "Integer", or does it not? If it does, then should not the name be "integer"?

DW_TAG_typedef indicates that integer is a defined type

type Integer: longint;

But then, why does it not as "integer" has name?

And why is it also present, if I use "var a: longint" ?

Reply by email