6ce6dd4 Don't use the mutex for each symbol_set_names call

Authored and Committed by Christian Biesinger 4 years ago
    Don't use the mutex for each symbol_set_names call
    
    This avoids the lock contention that was seen with tromey's patch (it
    moves it to a once- per-thread lock call from a once-per-symbol call).
    
    It speeds up "attach to Chrome's content_shell binary" from 44 sec -> 30
    sec (32%) (compared to GDB trunk), or from 37 sec compared to this
    patchset before this patch.
    
    gdb/ChangeLog:
    
    2019-09-28  Christian Biesinger  <cbiesinger@google.com>
    
    	* minsyms.c (minimal_symbol_reader::install): Only do
    	demangling on the background thread; still call
    	symbol_set_names on the main thread.
    	* symtab.c (symbol_find_demangled_name): Make public,
    	so that minsyms.c can call it.
    	(symbol_set_names): Remove mutex. Avoid demangle call
    	if the demangled name is already set.
    	* symtab.h (symbol_find_demangled_name): Make public.
    
        
file modified
+32 -3
file modified
+73 -89
file modified
+10 -0