Thread overview
DW_TAG_module experiment.
Feb 16, 2014
Iain Buclaw
Feb 16, 2014
Iain Buclaw
Feb 17, 2014
Iain Buclaw
Feb 18, 2014
Johannes Pfau
Feb 18, 2014
Iain Buclaw
Feb 18, 2014
Iain Buclaw
Feb 18, 2014
Iain Buclaw
Feb 18, 2014
Iain Buclaw
Feb 18, 2014
Iain Buclaw
Feb 21, 2014
Iain Buclaw
February 16, 2014
Hi all,

This weeks experiment is with actually building a NAMESPACE_DECL for D modules, and emitting them as DW_TAG_module in dwarf2out.c


https://github.com/D-Programming-GDC/GDC/commit/91a1863170431a37de473011c148f4927a2a3944


After some thought, I've decided it best not to set the NAMESPACE_DECL for symbols that are:

- Not declared with D linkage - !extern(D) symbols should be considered as part of the global namespace.
- Not D main.  This is important, as we don't want to break this fix in gdb: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=6377854769ea85f2dd38aac9a9b11fded61245f3


Johannes, I've only updated the 4.9.x patches. You may want to backport this after my gdb changes have been submitted and pushed into gdb-development (which will be the gdb-7.8 release).


Martin, not sure if you read these lists, but I am curious if you have don't something similar for DMD.

Regards,
Iain.
February 16, 2014
On Sunday, 16 February 2014 at 23:18:18 UTC, Iain Buclaw wrote:
>
> Martin, not sure if you read these lists, but I am curious if you have don't something similar for DMD.
>

s/don't/done/
February 17, 2014
On 16 February 2014 23:18, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
> Hi all,
>
> This weeks experiment is with actually building a NAMESPACE_DECL for D modules, and emitting them as DW_TAG_module in dwarf2out.c
>
>
> https://github.com/D-Programming-GDC/GDC/commit/91a1863170431a37de473011c148f4927a2a3944
>

Slight tweak in implementation after some testing in gdb.

https://github.com/D-Programming-GDC/GDC/commit/d4a39655bcac0750f3ad03e8ab7e2f0ad9260c35
February 18, 2014
Am Sun, 16 Feb 2014 23:18:17 +0000
schrieb "Iain Buclaw" <ibuclaw@gdcproject.org>:

> Hi all,
> 
> This weeks experiment is with actually building a NAMESPACE_DECL for D modules, and emitting them as DW_TAG_module in dwarf2out.c
> 
> 
> https://github.com/D-Programming-GDC/GDC/commit/91a1863170431a37de473011c148f4927a2a3944
> 
> 
Sounds great!

> 
> Johannes, I've only updated the 4.9.x patches. You may want to backport this after my gdb changes have been submitted and pushed into gdb-development (which will be the gdb-7.8 release).
> 

OK, will do.
BTW: Did you forget to commit some changes or is this stuff unfinished?
It broke the autotester* and I see the same errors when building GDC.

* https://d.puremagic.com/test-results/?projectid=2
February 18, 2014
On 18 February 2014 08:49, Johannes Pfau <nospam@example.com> wrote:
> Am Sun, 16 Feb 2014 23:18:17 +0000
> schrieb "Iain Buclaw" <ibuclaw@gdcproject.org>:
>
>> Hi all,
>>
>> This weeks experiment is with actually building a NAMESPACE_DECL for D modules, and emitting them as DW_TAG_module in dwarf2out.c
>>
>>
>> https://github.com/D-Programming-GDC/GDC/commit/91a1863170431a37de473011c148f4927a2a3944
>>
>>
> Sounds great!
>
>>
>> Johannes, I've only updated the 4.9.x patches. You may want to backport this after my gdb changes have been submitted and pushed into gdb-development (which will be the gdb-7.8 release).
>>
>
> OK, will do.
> BTW: Did you forget to commit some changes or is this stuff unfinished?
> It broke the autotester* and I see the same errors when building GDC.
>
> * https://d.puremagic.com/test-results/?projectid=2


Gah! Didn't see that one coming.  Do you know which commit broke it?
(I can do a quick bisect if not)

There are a couple more changes that I need to make to finish the transition.

First one I'm committing now is changing toPrettyChars() -> ident->string.  This is because in the debugger, it will represent: 'std.stdio.writeln' as: 'std.stdio.std.stdio.writeln'
February 18, 2014
On 18 February 2014 09:12, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
> On 18 February 2014 08:49, Johannes Pfau <nospam@example.com> wrote:
>> Am Sun, 16 Feb 2014 23:18:17 +0000
>> schrieb "Iain Buclaw" <ibuclaw@gdcproject.org>:
>>
>>> Hi all,
>>>
>>> This weeks experiment is with actually building a NAMESPACE_DECL for D modules, and emitting them as DW_TAG_module in dwarf2out.c
>>>
>>>
>>> https://github.com/D-Programming-GDC/GDC/commit/91a1863170431a37de473011c148f4927a2a3944
>>>
>>>
>> Sounds great!
>>
>>>
>>> Johannes, I've only updated the 4.9.x patches. You may want to backport this after my gdb changes have been submitted and pushed into gdb-development (which will be the gdb-7.8 release).
>>>
>>
>> OK, will do.
>> BTW: Did you forget to commit some changes or is this stuff unfinished?
>> It broke the autotester* and I see the same errors when building GDC.
>>
>> * https://d.puremagic.com/test-results/?projectid=2
>
>
> Gah! Didn't see that one coming.  Do you know which commit broke it?
> (I can do a quick bisect if not)
>

Apparently my recent changes didn't break the autotester...
February 18, 2014
On 18 February 2014 09:45, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
> On 18 February 2014 09:12, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
>> On 18 February 2014 08:49, Johannes Pfau <nospam@example.com> wrote:
>>> Am Sun, 16 Feb 2014 23:18:17 +0000
>>> schrieb "Iain Buclaw" <ibuclaw@gdcproject.org>:
>>>
>>>> Hi all,
>>>>
>>>> This weeks experiment is with actually building a NAMESPACE_DECL for D modules, and emitting them as DW_TAG_module in dwarf2out.c
>>>>
>>>>
>>>> https://github.com/D-Programming-GDC/GDC/commit/91a1863170431a37de473011c148f4927a2a3944
>>>>
>>>>
>>> Sounds great!
>>>
>>>>
>>>> Johannes, I've only updated the 4.9.x patches. You may want to backport this after my gdb changes have been submitted and pushed into gdb-development (which will be the gdb-7.8 release).
>>>>
>>>
>>> OK, will do.
>>> BTW: Did you forget to commit some changes or is this stuff unfinished?
>>> It broke the autotester* and I see the same errors when building GDC.
>>>
>>> * https://d.puremagic.com/test-results/?projectid=2
>>
>>
>> Gah! Didn't see that one coming.  Do you know which commit broke it?
>> (I can do a quick bisect if not)
>>
>
> Apparently my recent changes didn't break the autotester...

OK, I didn't clean the library directory correctly. 91a1863170431a37de473011c148f4927a2a3944 is to blame
February 18, 2014
On 18 February 2014 13:34, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
> On 18 February 2014 09:45, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
>> On 18 February 2014 09:12, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
>>> On 18 February 2014 08:49, Johannes Pfau <nospam@example.com> wrote:
>>>> Am Sun, 16 Feb 2014 23:18:17 +0000
>>>> schrieb "Iain Buclaw" <ibuclaw@gdcproject.org>:
>>>>
>>>>> Hi all,
>>>>>
>>>>> This weeks experiment is with actually building a NAMESPACE_DECL for D modules, and emitting them as DW_TAG_module in dwarf2out.c
>>>>>
>>>>>
>>>>> https://github.com/D-Programming-GDC/GDC/commit/91a1863170431a37de473011c148f4927a2a3944
>>>>>
>>>>>
>>>> Sounds great!
>>>>
>>>>>
>>>>> Johannes, I've only updated the 4.9.x patches. You may want to backport this after my gdb changes have been submitted and pushed into gdb-development (which will be the gdb-7.8 release).
>>>>>
>>>>
>>>> OK, will do.
>>>> BTW: Did you forget to commit some changes or is this stuff unfinished?
>>>> It broke the autotester* and I see the same errors when building GDC.
>>>>
>>>> * https://d.puremagic.com/test-results/?projectid=2
>>>
>>>
>>> Gah! Didn't see that one coming.  Do you know which commit broke it?
>>> (I can do a quick bisect if not)
>>>
>>
>> Apparently my recent changes didn't break the autotester...
>
> OK, I didn't clean the library directory correctly. 91a1863170431a37de473011c148f4927a2a3944 is to blame

Didn't update d_finish_compilation.
February 18, 2014
On 18 February 2014 14:22, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
> On 18 February 2014 13:34, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
>> On 18 February 2014 09:45, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
>>> On 18 February 2014 09:12, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
>>>> On 18 February 2014 08:49, Johannes Pfau <nospam@example.com> wrote:
>>>>> Am Sun, 16 Feb 2014 23:18:17 +0000
>>>>> schrieb "Iain Buclaw" <ibuclaw@gdcproject.org>:
>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> This weeks experiment is with actually building a NAMESPACE_DECL for D modules, and emitting them as DW_TAG_module in dwarf2out.c
>>>>>>
>>>>>>
>>>>>> https://github.com/D-Programming-GDC/GDC/commit/91a1863170431a37de473011c148f4927a2a3944
>>>>>>
>>>>>>
>>>>> Sounds great!
>>>>>
>>>>>>
>>>>>> Johannes, I've only updated the 4.9.x patches. You may want to backport this after my gdb changes have been submitted and pushed into gdb-development (which will be the gdb-7.8 release).
>>>>>>
>>>>>
>>>>> OK, will do.
>>>>> BTW: Did you forget to commit some changes or is this stuff unfinished?
>>>>> It broke the autotester* and I see the same errors when building GDC.
>>>>>
>>>>> * https://d.puremagic.com/test-results/?projectid=2
>>>>
>>>>
>>>> Gah! Didn't see that one coming.  Do you know which commit broke it?
>>>> (I can do a quick bisect if not)
>>>>
>>>
>>> Apparently my recent changes didn't break the autotester...
>>
>> OK, I didn't clean the library directory correctly. 91a1863170431a37de473011c148f4927a2a3944 is to blame
>
> Didn't update d_finish_compilation.


Should be passing now....

https://github.com/D-Programming-GDC/GDC/commit/1a9ee141dcd815d3e3cda2ecb63bdef528611946
February 21, 2014
On 18 February 2014 15:08, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
> On 18 February 2014 14:22, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
>> On 18 February 2014 13:34, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
>>> On 18 February 2014 09:45, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
>>>> On 18 February 2014 09:12, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
>>>>> On 18 February 2014 08:49, Johannes Pfau <nospam@example.com> wrote:
>>>>>> Am Sun, 16 Feb 2014 23:18:17 +0000
>>>>>> schrieb "Iain Buclaw" <ibuclaw@gdcproject.org>:
>>>>>>
>>>>>>> Hi all,
>>>>>>>
>>>>>>> This weeks experiment is with actually building a NAMESPACE_DECL for D modules, and emitting them as DW_TAG_module in dwarf2out.c
>>>>>>>
>>>>>>>
>>>>>>> https://github.com/D-Programming-GDC/GDC/commit/91a1863170431a37de473011c148f4927a2a3944
>>>>>>>
>>>>>>>
>>>>>> Sounds great!
>>>>>>
>>>>>>>
>>>>>>> Johannes, I've only updated the 4.9.x patches. You may want to backport this after my gdb changes have been submitted and pushed into gdb-development (which will be the gdb-7.8 release).
>>>>>>>
>>>>>>
>>>>>> OK, will do.
>>>>>> BTW: Did you forget to commit some changes or is this stuff unfinished?
>>>>>> It broke the autotester* and I see the same errors when building GDC.
>>>>>>
>>>>>> * https://d.puremagic.com/test-results/?projectid=2
>>>>>
>>>>>
>>>>> Gah! Didn't see that one coming.  Do you know which commit broke it?
>>>>> (I can do a quick bisect if not)
>>>>>
>>>>
>>>> Apparently my recent changes didn't break the autotester...
>>>
>>> OK, I didn't clean the library directory correctly. 91a1863170431a37de473011c148f4927a2a3944 is to blame
>>
>> Didn't update d_finish_compilation.
>
>
> Should be passing now....
>
> https://github.com/D-Programming-GDC/GDC/commit/1a9ee141dcd815d3e3cda2ecb63bdef528611946


Got some more quick changes incoming:

1. Use the ModuleDeclaration location to set the NAMESPACE_DECL
location - currently this is always line 1 of the file.
2. Set DECL_EXTERNAL on NAMESPACE_DECL's if we are not compiling the module.
3. Emit DW_TAG_imported_module on ImportStatement's.

Regards
Iain.