Re: GDB + ddemangle
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 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.
Re: GDB + ddemangle
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 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?
Re: GDB + ddemangle
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-announcewrote: 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
Re: GDB + ddemangle
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-announcewrote: 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.
Re: GDB + ddemangle
On Friday, 20 April 2018 at 17:55:12 UTC, Iain Buclaw wrote: On 20 April 2018 at 17:40, drug via Digitalmars-d-announcewrote: 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?
Re: GDB + ddemangle
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?
Re: GDB + ddemangle
On 20 April 2018 at 17:40, drug via Digitalmars-d-announcewrote: > 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.
Re: GDB + ddemangle
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.
Re: GDB + ddemangle
On 20 April 2018 at 14:54, drug via Digitalmars-d-announcewrote: > 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/rvoqllpimfskvlabp...@forum.dlang.org >> >> There are a few posts on the forum with some example usages: >> https://forum.dlang.org/search?q=%22demangle%3Ddlang%22=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'
Re: GDB + ddemangle
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/rvoqllpimfskvlabp...@forum.dlang.org There are a few posts on the forum with some example usages: https://forum.dlang.org/search?q=%22demangle%3Ddlang%22=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?
Re: GDB + ddemangle
On Friday, 20 April 2018 at 12:28:03 UTC, Basile B. wrote: On Friday, 20 April 2018 at 11:06:47 UTC, Mike Wey wrote: On 20-04-18 12:36, 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. It should be automatic when the executable is build with debugging info. `-g` it is not, clearly ;) The problem is that one also needs to process the compiler output in an IDE, so finally it doesn't change anything to anything
Re: GDB + ddemangle
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/rvoqllpimfskvlabp...@forum.dlang.org There are a few posts on the forum with some example usages: https://forum.dlang.org/search?q=%22demangle%3Ddlang%22=1 Mike
Re: GDB + ddemangle
On Friday, 20 April 2018 at 11:06:47 UTC, Mike Wey wrote: On 20-04-18 12:36, 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. It should be automatic when the executable is build with debugging info. `-g` it is not, clearly ;)
Re: GDB + ddemangle
20.04.2018 14:06, Mike Wey пишет: On 20-04-18 12:36, 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. It should be automatic when the executable is build with debugging info. `-g` is there a way to check feature availability? What version gdb should have etc?
Re: GDB + ddemangle
On 20-04-18 12:36, 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. It should be automatic when the executable is build with debugging info. `-g` -- Mike Wey
Re: GDB + ddemangle
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.
Re: GDB + ddemangle
On Friday, 20 April 2018 at 10:03:53 UTC, Joakim wrote: On Thursday, 19 April 2018 at 12:43:36 UTC, ANtlord wrote: Hello! I've written a piece of glue code that helps to debug D code using GDB. The code glues together GDB and ddmangle. Checkout the link https://github.com/ANtlord/gdb-ddemangle PRs are welcome! You are aware that gdb has built-in support for demangling D for 3-4 years now? I've been told this too, not so long ago, but actually i still feed GDB output with ddemangle too (for Coedit 'GDB commander' widget).
Re: GDB + ddemangle
On Thursday, 19 April 2018 at 12:43:36 UTC, ANtlord wrote: Hello! I've written a piece of glue code that helps to debug D code using GDB. The code glues together GDB and ddmangle. Checkout the link https://github.com/ANtlord/gdb-ddemangle PRs are welcome! You are aware that gdb has built-in support for demangling D for 3-4 years now? http://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git=search=HEAD=commit=ibuclaw I don't know if Iain got all his patches in, but it demangles a lot of symbols for me already. However, I just started using the new lldb package in Termux, and I do miss it there. Otherwise, lldb is very nice and much more stable for me on 64-bit ARM.
Re: GDB + ddemangle
On Thursday, 19 April 2018 at 12:43:36 UTC, ANtlord wrote: Hello! I've written a piece of glue code that helps to debug D code using GDB. The code glues together GDB and ddmangle. Checkout the link https://github.com/ANtlord/gdb-ddemangle PRs are welcome! Nice work.