April 20, 2018
20.04.2018 15:36, Mike Franklin пишет:
> On Friday, 20 April 2018 at 10:36:25 UTC, drug wrote:
>> 20.04.2018 13:03, Joakim пишет:
>>>
>>> You are aware that gdb has built-in support for demangling D for 3-4 years now?
>>>
>> But how to enable it? It doesn't work out of box at least for me.
> 
> I believe you enable it with `-demangle=dlang`
> 
> The original announcement is here: https://forum.dlang.org/post/rvoqllpimfskvlabprot@forum.dlang.org
> 
> There are a few posts on the forum with some example usages: https://forum.dlang.org/search?q=%22demangle%3Ddlang%22&page=1
> 
> Mike
thanks for reply! but gdb don't recognize this option - unknown option "--demangle=dlang"

```
$gdb --version
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
...
```

Or it is intended to work only using `objdump` etc?
April 20, 2018
On 20 April 2018 at 14:54, drug via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
> 20.04.2018 15:36, Mike Franklin пишет:
>
>> On Friday, 20 April 2018 at 10:36:25 UTC, drug wrote:
>>>
>>> 20.04.2018 13:03, Joakim пишет:
>>>>
>>>>
>>>> You are aware that gdb has built-in support for demangling D for 3-4 years now?
>>>>
>>> But how to enable it? It doesn't work out of box at least for me.
>>
>>
>> I believe you enable it with `-demangle=dlang`
>>
>> The original announcement is here: https://forum.dlang.org/post/rvoqllpimfskvlabprot@forum.dlang.org
>>
>> There are a few posts on the forum with some example usages: https://forum.dlang.org/search?q=%22demangle%3Ddlang%22&page=1
>>
>> Mike
>
> thanks for reply! but gdb don't recognize this option - unknown option "--demangle=dlang"
>
> ```
> $gdb --version
> GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
> Copyright (C) 2016 Free Software Foundation, Inc.
> ...
> ```
>
> Or it is intended to work only using `objdump` etc?


GDB auto-detects the language based on DW_LANG tag in the debug info.

If you are starting up gdb without a program to debug, you can
explicitly switch with: set lang d
Then try something like: demangle _D3fooFiZv

Or if you want it to start up in D mode: gdb -ex 'set lang d'

April 20, 2018
20.04.2018 16:49, Iain Buclaw пишет:
> 
> GDB auto-detects the language based on DW_LANG tag in the debug info.
> 
> If you are starting up gdb without a program to debug, you can
> explicitly switch with: set lang d
> Then try something like: demangle _D3fooFiZv
> 
> Or if you want it to start up in D mode: gdb -ex 'set lang d'
> 
it works, thank you. But not in all cases. For example when gdb stops on breakpoint it demangle, but if I do `bt` - backtrace isn't demangled.
April 20, 2018
On 20 April 2018 at 17:40, drug via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
> 20.04.2018 16:49, Iain Buclaw пишет:
>>
>>
>> GDB auto-detects the language based on DW_LANG tag in the debug info.
>>
>> If you are starting up gdb without a program to debug, you can
>> explicitly switch with: set lang d
>> Then try something like: demangle _D3fooFiZv
>>
>> Or if you want it to start up in D mode: gdb -ex 'set lang d'
>>
> it works, thank you. But not in all cases. For example when gdb stops on breakpoint it demangle, but if I do `bt` - backtrace isn't demangled.

Using a compiler that implements 2.077 or later (IIRC) probably won't, due to gdb being too old.  They broke ABI by introducing back referencing, no release of gdb supports that yet.

April 20, 2018
20.04.2018 20:55, Iain Buclaw пишет:
> 
> Using a compiler that implements 2.077 or later (IIRC) probably won't,
> due to gdb being too old.  They broke ABI by introducing back
> referencing, no release of gdb supports that yet.
> 
I see. Thanks for clarification.

Aren't plugins for gdb like subj more simple way to extend dlang support in gdb then?
April 25, 2018
On Friday, 20 April 2018 at 17:55:12 UTC, Iain Buclaw wrote:
> On 20 April 2018 at 17:40, drug via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
>
> Using a compiler that implements 2.077 or later (IIRC) probably won't, due to gdb being too old.  They broke ABI by introducing back referencing, no release of gdb supports that yet.

I launched gdb with command `gdb -ex 'set lang d' test` disabling my plugin and I don't see demangling anywhere. Source file is compiled with command `dmd -g test.d`

DMD 2.079
GDB 8.1

Did I miss something?
April 25, 2018
On Wednesday, 25 April 2018 at 05:09:28 UTC, ANtlord wrote:
> On Friday, 20 April 2018 at 17:55:12 UTC, Iain Buclaw wrote:
>> On 20 April 2018 at 17:40, drug via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
>>
>> Using a compiler that implements 2.077 or later (IIRC) probably won't, due to gdb being too old.  They broke ABI by introducing back referencing, no release of gdb supports that yet.
>
> I launched gdb with command `gdb -ex 'set lang d' test` disabling my plugin and I don't see demangling anywhere. Source file is compiled with command `dmd -g test.d`
>
> DMD 2.079
> GDB 8.1
>
> Did I miss something?

Yes, read two posts back, by Iain.
April 25, 2018
On Wednesday, 25 April 2018 at 05:12:37 UTC, Joakim wrote:
> On Wednesday, 25 April 2018 at 05:09:28 UTC, ANtlord wrote:
>> On Friday, 20 April 2018 at 17:55:12 UTC, Iain Buclaw wrote:
>>> On 20 April 2018 at 17:40, drug via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
>>>
>>> Using a compiler that implements 2.077 or later (IIRC) probably won't, due to gdb being too old.  They broke ABI by introducing back referencing, no release of gdb supports that yet.
>>
>> I launched gdb with command `gdb -ex 'set lang d' test` disabling my plugin and I don't see demangling anywhere. Source file is compiled with command `dmd -g test.d`
>>
>> DMD 2.079
>> GDB 8.1
>>
>> Did I miss something?
>
> Yes, read two posts back, by Iain.

My bad. I wasn't aware on the morning. I mess the sentence
> They broke ABI by introducing back referencing, no release of gdb supports that yet
April 26, 2019
On Friday, 20 April 2018 at 17:55:12 UTC, Iain Buclaw wrote:
> On 20 April 2018 at 17:40, drug via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
>> 20.04.2018 16:49, Iain Buclaw пишет:
>>>[...]
>> it works, thank you. But not in all cases. For example when gdb stops on breakpoint it demangle, but if I do `bt` - backtrace isn't demangled.
>
> Using a compiler that implements 2.077 or later (IIRC) probably won't, due to gdb being too old.  They broke ABI by introducing back referencing, no release of gdb supports that yet.

This stays broken after 1 year. How do we fix this?
April 27, 2019
On Friday, 26 April 2019 at 07:08:45 UTC, Arun Chandrasekaran wrote:
> On Friday, 20 April 2018 at 17:55:12 UTC, Iain Buclaw wrote:
>> On 20 April 2018 at 17:40, drug via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
>>> 20.04.2018 16:49, Iain Buclaw пишет:
>>>>[...]
>>> it works, thank you. But not in all cases. For example when gdb stops on breakpoint it demangle, but if I do `bt` - backtrace isn't demangled.
>>
>> Using a compiler that implements 2.077 or later (IIRC) probably won't, due to gdb being too old.  They broke ABI by introducing back referencing, no release of gdb supports that yet.
>
> This stays broken after 1 year. How do we fix this?

I recognize your name from IRC, where you posted a related question yesterday.
The person in charge for D in GDB had answered:

The problem is that the mangling scheme has changed (to produce shorter mangles). Demangling will be eventually supported when D will be in GCC for good (GCC 10) and then he would port the demangling from GCC to GDB.

So for now demangling of D in GDB only work if the binary is compiled with a very old version of the compiler, i.e prior to the new mangling method.
1 2
Next ›   Last »