[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2019-06-08 Thread James S Blachly, MD via Phabricator via lldb-commits
jblachly added a comment. I sat down to write my own plugin today and found this. @timotheecour , thanks for writing this -- can I help with anything to get this across the finish line? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D44321/new/ https://reviews.llvm.org/D44321

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-21 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. The Terminate function is a good place to do this kind of cleanup. Comment at: source/Plugins/Language/D/DLanguage.cpp:34-36 +// D Plugin will define these symbols. They're declared to use with decltype. +extern "C" { +// called once, to initialize

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-20 Thread Johan Engelen via Phabricator via lldb-commits
johanengelen added a comment. In https://reviews.llvm.org/D44321#1038241, @timotheecour wrote: > > When druntime is initialized, a number of resources are allocated (e.g. > > memory and mutex). Yes you initialize druntime once, I can see that. You > > don't deinitialize druntime at all: that's

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-14 Thread Timothee Cour via Phabricator via lldb-commits
timotheecour updated this revision to Diff 138477. timotheecour added a comment. - fix assert fail when plugin.language.D.pluginfile empty https://reviews.llvm.org/D44321 Files: include/lldb/Core/Mangled.h include/lldb/Core/PluginManager.h source/API/SystemInitializerFull.cpp

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-14 Thread Timothee Cour via Phabricator via lldb-commits
timotheecour added a comment. > When druntime is initialized, a number of resources are allocated (e.g. > memory and mutex). Yes you initialize druntime once, I can see that. You > don't deinitialize druntime at all: that's the resource leak. Where would you want me to deinit? inside `

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-14 Thread Timothee Cour via Phabricator via lldb-commits
timotheecour added inline comments. Comment at: source/Plugins/Language/D/DLanguage.cpp:108 + +auto fun0=lib2->getFun("d_initialize"); +(*fun0)(); johanengelen wrote: > timotheecour wrote: > > johanengelen wrote: > > > Would it

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-14 Thread Johan Engelen via Phabricator via lldb-commits
johanengelen added a comment. In https://reviews.llvm.org/D44321#1038160, @timotheecour wrote: > > How do you de-initialize druntime? (without de-init, there is a big mem > > leak) > > There is no memory leak because `d_initialize` once (using c++11 static > initialization pattern) and is

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-14 Thread Timothee Cour via Phabricator via lldb-commits
timotheecour added a comment. > How do you de-initialize druntime? (without de-init, there is a big mem leak) There is no memory leak because `d_initialize` once (using c++11 static initialization pattern) and is intended to last for duration of application; so druntime will be initialized

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-14 Thread Timothee Cour via Phabricator via lldb-commits
timotheecour updated this revision to Diff 138471. timotheecour added a comment. - added d_terminate - format https://reviews.llvm.org/D44321 Files: include/lldb/Core/Mangled.h include/lldb/Core/PluginManager.h source/API/SystemInitializerFull.cpp source/Core/CMakeLists.txt

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-13 Thread Timothee Cour via Phabricator via lldb-commits
timotheecour updated this revision to Diff 138291. timotheecour added a comment. - document C interface https://reviews.llvm.org/D44321 Files: include/lldb/Core/Mangled.h include/lldb/Core/PluginManager.h source/API/SystemInitializerFull.cpp source/Core/CMakeLists.txt

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-13 Thread Timothee Cour via Phabricator via lldb-commits
timotheecour added a comment. > Actually, this is not the correct interface is it? The returned pointer > should point to newly allocated memory using malloc, right? > Good to document that somewhere. not 100% sure what you mean in that comment but I just pushed a commit that clarifies that

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-11 Thread Johan Engelen via Phabricator via lldb-commits
johanengelen added a comment. In https://reviews.llvm.org/D44321#1034168, @johanengelen wrote: > extern "C" char* lldbd_demangle(size_t length, const char* mangled) { > if (mangled == "_D3fooFZv") // pseudo code > return "void foo()"; > else > return mangled; > }

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-11 Thread Johan Engelen via Phabricator via lldb-commits
johanengelen added a comment. In https://reviews.llvm.org/D44321#1034141, @timotheecour wrote: > > It's a little more complicated for D because it's an out-of-tree compiler > > so it poses interesting challenges. > > the demangling itself is thoroughly tested in >

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-11 Thread Johan Engelen via Phabricator via lldb-commits
johanengelen added inline comments. Comment at: source/Plugins/Language/D/DLanguage.cpp:108 + +auto fun0=lib2->getFun("d_initialize"); +(*fun0)(); timotheecour wrote: > johanengelen wrote: > > Would it help to initialize druntime

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-10 Thread Timothee Cour via Phabricator via lldb-commits
timotheecour added a comment. Note that the D plugin is not loaded by default (so default behavior is not affected) ; it's only loaded if user adds to his .lldbinit: settings set plugin.language.D.pluginfile "path_to/liblldbdplugin.dylib" https://reviews.llvm.org/D44321

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-10 Thread Timothee Cour via Phabricator via lldb-commits
timotheecour added a comment. > It's a little more complicated for D because it's an out-of-tree compiler so > it poses interesting challenges. the demangling itself is thoroughly tested in https://github.com/dlang/druntime/blob/master/src/core/demangle.d https://reviews.llvm.org/D44321

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-10 Thread Timothee Cour via Phabricator via lldb-commits
timotheecour updated this revision to Diff 137942. timotheecour added a comment. - added doc https://reviews.llvm.org/D44321 Files: include/lldb/Core/Mangled.h include/lldb/Core/PluginManager.h source/API/SystemInitializerFull.cpp source/Core/CMakeLists.txt source/Core/Mangled.cpp

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-10 Thread Timothee Cour via Phabricator via lldb-commits
timotheecour added a comment. update: we can now set lldbdplugin in .lldbinit via `settings set plugin.language.D.pluginfile` so this avoids hardcoding that file https://reviews.llvm.org/D44321 ___ lldb-commits mailing list

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-10 Thread Timothee Cour via Phabricator via lldb-commits
timotheecour updated this revision to Diff 137940. timotheecour added a comment. - format - use llvm::sys::DynamicLibrary - added DLanguageProperties https://reviews.llvm.org/D44321 Files: include/lldb/Core/Mangled.h include/lldb/Core/PluginManager.h source/API/SystemInitializerFull.cpp

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-10 Thread Davide Italiano via Phabricator via lldb-commits
davide added a comment. In https://reviews.llvm.org/D44321#1034043, @timotheecour wrote: > In https://reviews.llvm.org/D44321#1033325, @davide wrote: > > > This patch has no testcase. It shouldn't be particularly hard to write one, > > you can take inspiration from the one in `lit/`. > > > >

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-10 Thread Timothee Cour via Phabricator via lldb-commits
timotheecour added a comment. In https://reviews.llvm.org/D44321#1033325, @davide wrote: > This patch has no testcase. It shouldn't be particularly hard to write one, > you can take inspiration from the one in `lit/`. > > Thanks! 5d29d3f0aa2f540c277a67eac5873feca8c62d51 (Support for OCaml

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-10 Thread Timothee Cour via Phabricator via lldb-commits
timotheecour marked an inline comment as done. timotheecour added inline comments. Comment at: source/Plugins/Language/D/DLanguage.cpp:24 +// TODO:MOVE +struct SharedLib{ + void* handle; johanengelen wrote: > Did you look into using

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-10 Thread Timothee Cour via Phabricator via lldb-commits
timotheecour updated this revision to Diff 137930. timotheecour added a comment. - use llvm::sys::DynamicLibrary - format https://reviews.llvm.org/D44321 Files: include/lldb/Core/Mangled.h source/Core/CMakeLists.txt source/Core/Mangled.cpp source/Plugins/Language/CMakeLists.txt

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-10 Thread Timothee Cour via Phabricator via lldb-commits
timotheecour added inline comments. Comment at: source/Plugins/Language/D/DLanguage.cpp:108 + +auto fun0=lib2->getFun("d_initialize"); +(*fun0)(); johanengelen wrote: > Would it help to initialize druntime using a static module

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-10 Thread Timothee Cour via Phabricator via lldb-commits
timotheecour updated this revision to Diff 137927. timotheecour marked 4 inline comments as done. timotheecour edited the summary of this revision. timotheecour added a comment. - format - format - fixup https://reviews.llvm.org/D44321 Files: include/lldb/Core/Mangled.h

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-09 Thread Davide Italiano via Phabricator via lldb-commits
davide requested changes to this revision. davide added a comment. This revision now requires changes to proceed. This patch has no testcase. It shouldn't be particularly hard to write one, you can take inspiration from the one in `lit/`. Thanks! Repository: rL LLVM

[Lldb-commits] [PATCH] D44321: Support demangling for D symbols via dlopen

2018-03-09 Thread Johan Engelen via Phabricator via lldb-commits
johanengelen added inline comments. Comment at: source/Plugins/Language/D/DLanguage.cpp:1 +//===-- DLanguage.cpp +// fix header, and also need to clang-format the file Comment at: source/Plugins/Language/D/DLanguage.cpp:20 + +char*