November 04, 2021
Hi D community!

I'm here again, to describe what I've done during the seventh week of
Symmetry
Autumn of Code.

## LLVM/LLDB upstream status update

Some trivial changes about LLDB plugins got merged and a fix got raised
after
my investigation on https://bugs.llvm.org/show_bug.cgi?id=45856 .

I have some fresh news about the demangler being upstreamed. It appears
that
approval from official foundation members is not going forward, as
expected. At
this point, most of the code from libiberty got changed, at least on
the first
patches. This is unfortunate, but I'm going to do my best to push this
forward.
I have some experience with D demangling, so making a clean room
implementation
is not big of a deal, it is just time consuming.

Some of my considerations on this is to try to contact every single
contributor
in d-demangler.c file, which is roughly 5 contributors, but I still
need to
coordinate this with them and my mentor for the best option.

About the D plugin for LLDB, I also got news. They seems to accept new
language
plugins as long as there is enough maintainers. If someone wants to
volunteer
to co-maintain it, I would appreciate.

## DWARF Abbreviation refactor

I pushed the refactor I was working on in the past week. You can find
more
about it here: https://github.com/dlang/dmd/pull/13237 . I'm probably
going to
freeze this until I fix the other issues that have much more priority
and work
on this when DWARF behaviour is more consistent.

During the refactor I accidentally discovered a double free after
rebasing with
andrea's change and reported some ASAN issues I found suitable to
report:

- https://issues.dlang.org/show_bug.cgi?id=22450
- https://issues.dlang.org/show_bug.cgi?id=22451
- https://issues.dlang.org/show_bug.cgi?id=22452

## Fixed issues

### Delegates are now distinguishable

Previously, delegates was being generated with `_Delegate` naming and
now they
use the qualified name of the type, being something similar to `void
delegate()
@nogc`. You can find the patch and the associated issue here:

- https://issues.dlang.org/show_bug.cgi?id=22459
- https://github.com/dlang/dmd/pull/13241

### wchar_t reports incorrect DECL attributes

When a `wchar` is used, the typedef generated by the compiler reports a
dummy
filename and line declarations. I fixed this on:
- https://github.com/dlang/dmd/pull/13247
- https://issues.dlang.org/show_bug.cgi?id=22467

### dchar encoding is missing

When using `dchar` type, encoding is not correctly reported as UTF and
debuggers like LLDB doesn't show it properly. I fixed it on:
- https://issues.dlang.org/show_bug.cgi?id=22468
- https://github.com/dlang/dmd/pull/13254

During these various fixes, I ended up making the following trivial
minor
patches:

- https://github.com/dlang/dmd/pull/13240
- https://github.com/dlang/dmd/pull/13239
- https://github.com/dlang/dmd/pull/13246

## Other reported issues

I also reported the following issues:

- https://issues.dlang.org/show_bug.cgi?id=22469
- https://issues.dlang.org/show_bug.cgi?id=22471

## What is next?

I didn't have much time this week to make all the tasks I wanted to do,
which
was primarily fixing the compiler related issues. I'm currently in a
conference
and my productive is limited. I hope next week I can do a bit more
stuff and
hopefully fix most of the issues I have in mind to homogenize the DWARF
generation.

You can also read this on my blog, here: https://lsferreira.net/posts/d-saoc-2021-07/ .

-- 
Sincerely,
Luís Ferreira @ lsferreira.net



November 04, 2021
Awesome!

On Thursday, 4 November 2021 at 02:50:24 UTC, Luís Ferreira wrote:
> [...]
>
> About the D plugin for LLDB, I also got news. They seems to accept new
> language
> plugins as long as there is enough maintainers. If someone wants to
> volunteer
> to co-maintain it, I would appreciate.
>
> [...]

I would be interested in that as I have before created a D python plugin already and dug a little in dmd's debug symbol generation code. I don't really have experience with the LLDB code base though and the python plugin was rather made with trial and error as the documentation did not contain many examples. I also haven't contributed any code to any LLVM projects before and don't really know the code layout.

Would look at your code when you have it started first though.