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
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
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
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
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 `
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
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
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
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
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
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
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;
> }
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
>
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
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
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
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
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
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
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/`.
> >
> >
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
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
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
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
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
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
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*
27 matches
Mail list logo