[lldb-dev] lldb command like gdb's "set auto-solib-add off"
Chunseok Lee via lldb-dev
lldb-dev at lists.llvm.org
Mon May 22 14:35:04 PDT 2017
Thank you for your help.
It would be really helpful to me.
The reason behind the question is exactly what you mentioned. I am wokring on debugging in devices and it seems that shared library loading(I do not know lldb loads symbols lazyly) runs very slowly since my testing program depends on so many shared libs. since I am debuggging with gdbjit feature, I do not need shared library loading except one shared lib(which contains __jit_debug_register_code symbol)
Thus, I want to turn off shred lib loading except one shared lib. Is it possible?
2017. 5. 23. 오전 3:24 Jim Ingham <jingham at apple.com> 작성:
> We designed lldb to be as lazy as possible in loading symbol information from the shared libraries as they get loaded. If this is causing you problems, the first thing to do is to figure out why lldb is pulling in more information than you need. For instance, it looks like on Linux the gdb JIT loading breakpoint is getting set with a global search which is pulling in all the symbols from all the initially loaded shared libraries. It would be better to fix things so that only explicit user actions (which can be scoped to shared libraries to limit the search) pull in symbols so we don't have to fiddle around with turning off and on the loading of shared libraries. Back when we were supporting gdb for MacOS I did a lot of work to try to get this right (there are times you really need the shared library info - e.g. when something shows up in a backtrace) so you have to judiciously re-introduce symbols, or the user experience is noticeably degraded.
> It also depends on how far you want to go turning this off. There's "don't look at shared libraries at all" which is what the auto-solib-add variable does IIRC. We also had a fairly extensive mechanism to specify "load-levels" for various libraries, which was more user-friendly but much more work to support. Anyway, it would be easy to just turn this shared library notifications - just don't set the dyld load notification breakpoint. That would be the easy part. But as I said above, you're also going to have to make sure you turn it back on for users when some action they request requires it.
> Note, there is a setting to determine how much symbol information to read in from libraries loaded from memory (since in device debugging this can be quite slow.) That is the target.memory-module-load-level setting. You might look at that for some hints as to how to proceed.
>> On May 22, 2017, at 8:02 AM, Chunseok Lee via lldb-dev <lldb-dev at lists.llvm.org> wrote:
>> In gdb, I can toggle auto symbol loading using "set auto-solib-add off" command.
>> I wonder that lldb has similar command for disabling auto shared library symbol loading?
>> If not, where is the good starting point to review the source code to implement this feature?
>> Chunseok Lee
>> lldb-dev mailing list
>> lldb-dev at lists.llvm.org
More information about the lldb-dev