I have a couple of questions about lldb:
-
I building a lldb command plugin for dotnet/coreclr (sos for lldb) and it currently depends on the lldb source (API h files) and the lldb build. Is there a package that includes just the public h and library files necessary to build a lldb plugin? I’ve heard there is one for llvm. Or am I stuck enlisting and building lldb to build my plugin?
-
Is there any way to get the plugin’s load path? I want to load another module dynamically in the same directory as my lldb plugin. I’m still learning about linux and lldb but it doesn’t look like there is a lldb api or the equivalent of Windows the hmodule passed to the DllMain.
Thanks.
mikem
I have a couple of questions about lldb:
1) I building a lldb command plugin for dotnet/coreclr (sos for lldb) and it currently depends on the lldb source (API h files) and the lldb build. Is there a package that includes just the public h and library files necessary to build a lldb plugin? I’ve heard there is one for llvm. Or am I stuck enlisting and building lldb to build my plugin?
Why don't you do this in Python?
http://lldb.llvm.org/python-reference.html
See section titled "CREATE A NEW LLDB COMMAND USING A PYTHON FUNCTION"
This keeps you isolated from having to link against anything at all.
2) Is there any way to get the plugin’s load path? I want to load another module dynamically in the same directory as my lldb plugin. I’m still learning about linux and lldb but it doesn’t look like there is a lldb api or the equivalent of Windows the hmodule passed to the DllMain.
int some_function_in_your_plugin()
{
}
Then you can ask the host to locate the module for a specific function:
FileSpec plugin_file_spec = Host::GetModuleFileSpecForHostAddress(reinterpret_cast<void *>(reinterpret_cast<intptr_t>(some_function_in_your_plugin))));
Thanks for your response. My lldb plugin needs to call a bunch C++ code ported from Windows/Windbg so doing this in Python really isn't practical. I found the lldb-3.5-dev package not too long after I sent my email and it contains everything I need to build my plugin without depending on a lldb build directly.
mikem