[Lldb-commits] [lldb] [lldb][Commands] Show symbol change bit in SB API (PR #66144)

via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 12 16:54:55 PDT 2023


jimingham wrote:

Okay, here's my understanding of what's going on here:

So what's going on here is that in order to support background fetching of dSYM's, there's a thread that calls dsymForUUID when someone tells it there's a binary with an unknown UUID, then when it gets the dSYM it needs to notify the system that the symbols for this module have changed.  It was inconvenient to call the Target::SymbolsDidLoad for all the targets from the background thread, so we instead made an event (eBroadcastSymbolChange, should be eBroadcastBitSymbolChange) whose whole reason for being is that its DoOnRemoval is the one that calls Target::SymbolsDidLoad, and then we can make a Listener that just polls continuously for this event.  It is just pulling and discarding the event to cause SymbolsDidLoad, so it is really an internal event, it should not be exposed to other clients.
Instead, what will happen is that then the Debugger::eBroadcastBitSymbolChange event gets pulled from the event queue, it will run through the targets and call their SymbolsDidLoad if they have the UUID that just got loaded.  Target::SymbolsDidLoad will in turn broadcast a Target::eBroadcastBitSymbolsLoaded event, that's the public one, and is correctly going to the Target's involved.
I think the only things that need doing here are:

1. Debugger::eBroadcastBitSymbolChange should NOT be public, it's internal to lldb and not useful to clients.
2. We should either have a Target::SymbolsDidChange that does the same work as Target::SymbolsDidLoad but sends Target::eBroadcastBitSymbolsChanged, or pass a bool in for changed vrs. load and dispatch the right event based on that.








https://github.com/llvm/llvm-project/pull/66144


More information about the lldb-commits mailing list