digitalmars.D - I have a patch to let lldb demangle D symbols ; help welcome to
- Timothee Cour (11/11) Feb 26 2018 https://github.com/llvm-mirror/lldb/pull/3
- timotheecour (5/18) Feb 27 2018 Specifically, the issue I'm facing is:
- =?UTF-8?B?THXDrXM=?= Marques (4/25) Mar 01 2018 Thanks for working on this. I'll try to look into this in the
- Timothee Cour (5/31) Mar 01 2018 yes, I've fixed the issue with crashes on large symbols using a
- =?UTF-8?B?THXDrXM=?= Marques (5/8) Mar 06 2018 What version of LLVM did you base it on? On my LLVM fork for
- Johan Engelen (5/9) Mar 06 2018 LLDB and LLVM need to be version synchronized. Did you checkout
- Johan Engelen (3/11) Mar 06 2018 I'm pretty sure Timothee based his patch onto LLDB/LLVM trunk.
- Timothee Cour (15/31) Mar 08 2018 indeed, I would not support something that requires rewriting demangle
- Jacob Carlborg (5/18) Mar 01 2018 This is great work.
- =?UTF-8?B?THXDrXM=?= Marques (6/9) Mar 05 2018 Ok, I started looking into this now. I hadn't realized that you
- Jacob Carlborg (10/20) Mar 05 2018 Seems like they prefer a shared library and not rewriting it in
- =?UTF-8?B?THXDrXM=?= Marques (6/7) Mar 09 2018 dtools seems to rely on the old import visibility behavior and
- Timothee Cour (4/12) Mar 09 2018 updated build instructions, see
- =?UTF-8?B?THXDrXM=?= Marques (20/23) Mar 12 2018 I put a writeln in lldbd_demangle and I see it's demangling about
- =?UTF-8?B?THXDrXM=?= Marques (3/8) Mar 12 2018 (BTW, if I commented out the plugin path setting I would get an
- Timothee Cour (5/15) Mar 12 2018 quite likely, try to compile with ldc or with latest dmd (2.079, which
- =?UTF-8?B?THXDrXM=?= Marques (3/8) Mar 13 2018 Yeah, that works. I'll be trying it more thoroughly and report
- =?UTF-8?B?THXDrXM=?= Marques (2/5) Mar 13 2018 Even with DMD 2.079 the frame locals don't show up... LDC FTW!
- Timothee Cour (3/9) Mar 14 2018 fixed ; thanks for reporting!
- Timothee Cour (5/11) Mar 14 2018 confirmed, `fr v` shows frame locals for a binary built with ldc but not...
https://github.com/llvm-mirror/lldb/pull/3 + https://github.com/timotheecour/dtools/blob/master/dtools/lldbdplugin.d on OSX, it works great except when encountering large symbols which cause segfault when GC does a collection (triggered inside core.demangle.demangle); Help is welcome to improve that (or more generally to improve D support in lldb, which I started in https://github.com/llvm-mirror/lldb/pull/3) NOTE: lldb doesn't accept github PR's but easier to work with PR's for whoever wants to help on tha in the meantime
Feb 26 2018
On Tuesday, 27 February 2018 at 05:28:41 UTC, Timothee Cour wrote:https://github.com/llvm-mirror/lldb/pull/3 + https://github.com/timotheecour/dtools/blob/master/dtools/lldbdplugin.d on OSX, it works great except when encountering large symbols which cause segfault when GC does a collection (triggered inside core.demangle.demangle); Help is welcome to improve that (or more generally to improve D support in lldb, which I started in https://github.com/llvm-mirror/lldb/pull/3) NOTE: lldb doesn't accept github PR's but easier to work with PR's for whoever wants to help on tha in the meantimeSpecifically, the issue I'm facing is: https://github.com/timotheecour/dtools/issues/2 (a crash occurs when _d_arraysetlengthiT is called) any help would be greatly appreciated
Feb 27 2018
On Tuesday, 27 February 2018 at 11:23:02 UTC, timotheecour wrote:On Tuesday, 27 February 2018 at 05:28:41 UTC, Timothee Cour wrote:Thanks for working on this. I'll try to look into this in the next few days. (If you have further progress on this please provide an update here).https://github.com/llvm-mirror/lldb/pull/3 + https://github.com/timotheecour/dtools/blob/master/dtools/lldbdplugin.d on OSX, it works great except when encountering large symbols which cause segfault when GC does a collection (triggered inside core.demangle.demangle); Help is welcome to improve that (or more generally to improve D support in lldb, which I started in https://github.com/llvm-mirror/lldb/pull/3) NOTE: lldb doesn't accept github PR's but easier to work with PR's for whoever wants to help on tha in the meantimeSpecifically, the issue I'm facing is: https://github.com/timotheecour/dtools/issues/2 (a crash occurs when _d_arraysetlengthiT is called) any help would be greatly appreciated
Mar 01 2018
yes, I've fixed the issue with crashes on large symbols using a patched `demangle` ; will update code soon; but feel free to take a look at lldb side of things On Thu, Mar 1, 2018 at 12:23 PM, Luís Marques via Digitalmars-d <digitalmars-d puremagic.com> wrote:On Tuesday, 27 February 2018 at 11:23:02 UTC, timotheecour wrote:On Tuesday, 27 February 2018 at 05:28:41 UTC, Timothee Cour wrote:Thanks for working on this. I'll try to look into this in the next few days. (If you have further progress on this please provide an update here).https://github.com/llvm-mirror/lldb/pull/3 + https://github.com/timotheecour/dtools/blob/master/dtools/lldbdplugin.d on OSX, it works great except when encountering large symbols which cause segfault when GC does a collection (triggered inside core.demangle.demangle); Help is welcome to improve that (or more generally to improve D support in lldb, which I started in https://github.com/llvm-mirror/lldb/pull/3) NOTE: lldb doesn't accept github PR's but easier to work with PR's for whoever wants to help on tha in the meantimeSpecifically, the issue I'm facing is: https://github.com/timotheecour/dtools/issues/2 (a crash occurs when _d_arraysetlengthiT is called) any help would be greatly appreciated
Mar 01 2018
On Friday, 2 March 2018 at 00:17:13 UTC, Timothee Cour wrote:yes, I've fixed the issue with crashes on large symbols using a patched `demangle` ; will update code soon; but feel free to take a look at lldb side of thingsWhat version of LLVM did you base it on? On my LLVM fork for RISC-V and MSP430 work it doesn't build (no llvm/Support/DJB.h) and on the latest stable, 5.0.1, cmake fails to configure (Unknown CMake command "add_llvm_install_targets").
Mar 06 2018
On Tuesday, 6 March 2018 at 18:19:13 UTC, Luís Marques wrote:On my LLVM fork for RISC-V and MSP430 work it doesn't build (no llvm/Support/DJB.h) and on the latest stable, 5.0.1, cmake fails to configure (Unknown CMake command "add_llvm_install_targets").LLDB and LLVM need to be version synchronized. Did you checkout LLVM and LLDB both from their respective same-named release branches? -Johan
Mar 06 2018
On Tuesday, 6 March 2018 at 20:25:10 UTC, Johan Engelen wrote:On Tuesday, 6 March 2018 at 18:19:13 UTC, Luís Marques wrote:I'm pretty sure Timothee based his patch onto LLDB/LLVM trunk. -JohanOn my LLVM fork for RISC-V and MSP430 work it doesn't build (no llvm/Support/DJB.h) and on the latest stable, 5.0.1, cmake fails to configure (Unknown CMake command "add_llvm_install_targets").LLDB and LLVM need to be version synchronized. Did you checkout LLVM and LLDB both from their respective same-named release branches?
Mar 06 2018
I'm pretty sure Timothee based his patch onto LLDB/LLVM trunk.indeed, see instructions here: https://github.com/timotheecour/dtools/blob/master/dtools/lldbdplugin.dSeems like they prefer a shared library and not rewriting it in C++ [1].indeed, I would not support something that requires rewriting demangle in C++ for obvious reasons (lots of useless work, gets out of sync etc).BTW, there's also GNU libiberty, bart of binutils, which Iain claims have better support for demangling D symbols than core.demangler.IIRC he wrote that, so we'd need an unbiased opinion :) But more importantly, libiberty is not up to date with latest features in core.demangle (eg back references etc). Also, I'd like to know in what way it'd be better. I had to make some small modifications to core.demangle to avoid https://github.com/timotheecour/dtools/issues/2 ; it works, but a bit ugly (see https://github.com/timotheecour/dtools/issues/2 for discussion) On Tue, Mar 6, 2018 at 12:26 PM, Johan Engelen via Digitalmars-d <digitalmars-d puremagic.com> wrote:On Tuesday, 6 March 2018 at 20:25:10 UTC, Johan Engelen wrote:On Tuesday, 6 March 2018 at 18:19:13 UTC, Luís Marques wrote:I'm pretty sure Timothee based his patch onto LLDB/LLVM trunk. -JohanOn my LLVM fork for RISC-V and MSP430 work it doesn't build (no llvm/Support/DJB.h) and on the latest stable, 5.0.1, cmake fails to configure (Unknown CMake command "add_llvm_install_targets").LLDB and LLVM need to be version synchronized. Did you checkout LLVM and LLDB both from their respective same-named release branches?
Mar 08 2018
On Tuesday, 27 February 2018 at 05:28:41 UTC, Timothee Cour wrote:https://github.com/llvm-mirror/lldb/pull/3 + https://github.com/timotheecour/dtools/blob/master/dtools/lldbdplugin.d on OSX, it works great except when encountering large symbols which cause segfault when GC does a collection (triggered inside core.demangle.demangle); Help is welcome to improve that (or more generally to improve D support in lldb, which I started in https://github.com/llvm-mirror/lldb/pull/3) NOTE: lldb doesn't accept github PR's but easier to work with PR's for whoever wants to help on tha in the meantimeThis is great work. Keep in mind that DMD does not support dynamic libraries on macOS. -- /Jacob Carlborg
Mar 01 2018
On Tuesday, 27 February 2018 at 05:28:41 UTC, Timothee Cour wrote:https://github.com/llvm-mirror/lldb/pull/3 + https://github.com/timotheecour/dtools/blob/master/dtools/lldbdplugin.dOk, I started looking into this now. I hadn't realized that you were opening an external library. I'm not sure the LLDB developers are going to want to merge something like that, have you asked? Would you consider adding C++ code for the demangling itself instead?
Mar 05 2018
On Monday, 5 March 2018 at 20:03:39 UTC, Luís Marques wrote:On Tuesday, 27 February 2018 at 05:28:41 UTC, Timothee Cour wrote:Seems like they prefer a shared library and not rewriting it in C++ [1]. BTW, there's also GNU libiberty, bart of binutils, which Iain claims have better support for demangling D symbols than core.demangler. [1] http://lists.llvm.org/pipermail/lldb-dev/2018-January/013199.html -- /Jacob Carlborghttps://github.com/llvm-mirror/lldb/pull/3 + https://github.com/timotheecour/dtools/blob/master/dtools/lldbdplugin.dOk, I started looking into this now. I hadn't realized that you were opening an external library. I'm not sure the LLDB developers are going to want to merge something like that, have you asked? Would you consider adding C++ code for the demangling itself instead?
Mar 05 2018
On Tuesday, 27 February 2018 at 05:28:41 UTC, Timothee Cour wrote:https://github.com/timotheecour/dtools/blob/master/dtools/lldbdplugin.ddtools seems to rely on the old import visibility behavior and doesn't compile with a recent D compiler. For instance: // functional.d: import std.algorithm:sort,uniq,walkLength; Error: module std.algorithm import 'walkLength' not found
Mar 09 2018
updated build instructions, see https://github.com/timotheecour/dtools/commit/8597923dd4ed7691f717b5e1bdbbf2ee66961ef5 On Fri, Mar 9, 2018 at 9:33 AM, Luís Marques via Digitalmars-d <digitalmars-d puremagic.com> wrote:On Tuesday, 27 February 2018 at 05:28:41 UTC, Timothee Cour wrote:https://github.com/timotheecour/dtools/blob/master/dtools/lldbdplugin.ddtools seems to rely on the old import visibility behavior and doesn't compile with a recent D compiler. For instance: // functional.d: import std.algorithm:sort,uniq,walkLength; Error: module std.algorithm import 'walkLength' not found
Mar 09 2018
On Tuesday, 27 February 2018 at 05:28:41 UTC, Timothee Cour wrote:https://github.com/llvm-mirror/lldb/pull/3 + https://github.com/timotheecour/dtools/blob/master/dtools/lldbdplugin.dI put a writeln in lldbd_demangle and I see it's demangling about two pagefuls of symbols, but the backtrace still shows mangled names. The mangled names lack the initial underscore, maybe that's related? breakpoint 2.1 test`D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv + 40 test`D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv + 32 test`D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZv + 139 test`D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv + 32
Mar 12 2018
On Monday, 12 March 2018 at 14:19:03 UTC, Luís Marques wrote:On Tuesday, 27 February 2018 at 05:28:41 UTC, Timothee Cour wrote:(BTW, if I commented out the plugin path setting I would get an assertion failure. Just FYI if that helps with the code review.)https://github.com/llvm-mirror/lldb/pull/3 + https://github.com/timotheecour/dtools/blob/master/dtools/lldbdplugin.d
Mar 12 2018
The mangled names lack the initial underscore, maybe that's related?quite likely, try to compile with ldc or with latest dmd (2.079, which fixed underscores on OSX) so that demangling works. I just tried with dmd 2.078 and it indeed doesn't demangle (as expected) On Mon, Mar 12, 2018 at 7:21 AM, Luís Marques via Digitalmars-d <digitalmars-d puremagic.com> wrote:On Monday, 12 March 2018 at 14:19:03 UTC, Luís Marques wrote:On Tuesday, 27 February 2018 at 05:28:41 UTC, Timothee Cour wrote:(BTW, if I commented out the plugin path setting I would get an assertion failure. Just FYI if that helps with the code review.)https://github.com/llvm-mirror/lldb/pull/3 + https://github.com/timotheecour/dtools/blob/master/dtools/lldbdplugin.d
Mar 12 2018
On Monday, 12 March 2018 at 23:03:33 UTC, Timothee Cour wrote:quite likely, try to compile with ldc or with latest dmd (2.079, which fixed underscores on OSX) so that demangling works. I just tried with dmd 2.078 and it indeed doesn't demangle (as expected)Yeah, that works. I'll be trying it more thoroughly and report any issues.
Mar 13 2018
On Tuesday, 13 March 2018 at 14:00:39 UTC, Luís Marques wrote:On Monday, 12 March 2018 at 23:03:33 UTC, Timothee Cour wrote: Yeah, that works. I'll be trying it more thoroughly and report any issues.Even with DMD 2.079 the frame locals don't show up... LDC FTW!
Mar 13 2018
(BTW, if I commented out the plugin path setting I would get an assertion failure. Just FYI if that helps with the code review.)fixed ; thanks for reporting! On Tue, Mar 13, 2018 at 9:29 AM, Luís Marques via Digitalmars-d <digitalmars-d puremagic.com> wrote:On Tuesday, 13 March 2018 at 14:00:39 UTC, Luís Marques wrote:On Monday, 12 March 2018 at 23:03:33 UTC, Timothee Cour wrote: Yeah, that works. I'll be trying it more thoroughly and report any issues.Even with DMD 2.079 the frame locals don't show up... LDC FTW!
Mar 14 2018
Even with DMD 2.079 the frame locals don't show up... LDC FTW!confirmed, `fr v` shows frame locals for a binary built with ldc but not dmd (independent of this PR though :) ) => just submitted https://issues.dlang.org/show_bug.cgi?id=18612 On Tue, Mar 13, 2018 at 9:29 AM, Luís Marques via Digitalmars-d <digitalmars-d puremagic.com> wrote:On Tuesday, 13 March 2018 at 14:00:39 UTC, Luís Marques wrote:On Monday, 12 March 2018 at 23:03:33 UTC, Timothee Cour wrote: Yeah, that works. I'll be trying it more thoroughly and report any issues.Even with DMD 2.079 the frame locals don't show up... LDC FTW!
Mar 14 2018