Currently you can ask the target symbols add command to locate the debug symbols for the current frame. This patch add an options to do that for the whole call stack.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lldb/source/Commands/CommandObjectTarget.cpp | ||
---|---|---|
4301–4302 | do you need the separate variable? can it be: flush |= true; |
lldb/source/Commands/CommandObjectTarget.cpp | ||
---|---|---|
4268–4271 | Yep! | |
4281–4282 | Not currently, no. I looked at StackFrameList in case it was just a matter of adding a LockingAdaptedIterable, but unsurprisingly, stack frames are computed rather than stored in a list. We'd need to implement a custom iterator that keeps track of the index and calls GetStackFrameAtIndex under the hood, which is definitely something for a separate patch. | |
4301–4302 | I want flush to be true only if at least one frame requires a flush. |
lldb/source/Commands/CommandObjectTarget.cpp | ||
---|---|---|
4301–4302 | my suggestion still achieves that. Instead of: bool current_frame_flush = false; if (DownloadObjectAndSymbolFile(module_spec, target, result, current_frame_flush)) symbols_found = true; flush |= current_frame_flush; Inline the current_frame_flush variable: if (DownloadObjectAndSymbolFile(module_spec, target, result, current_frame_flush)) flush |= true; This makes flush only true when one frame needs it. |
lldb/source/Commands/CommandObjectTarget.cpp | ||
---|---|---|
4300 | It seems this is call is synchronous? A separate improvement would be to perform the unique downloads in parallel. |
lldb/source/Commands/CommandObjectTarget.cpp | ||
---|---|---|
4301–4302 | That relies on the assumption that flush is true iff DownloadObjectAndSymbolFilereturn true (and the same for AddModuleSymbols). Looking at the code that does indeed seem to be the case, but then I'd rather see the API refactored to remove the flush output variable instead of relying on an implementation-specific assumption here. |
Does it make sense to add a test for this? It looks like we have two basic tests for add-dsym already.
lldb/source/Commands/CommandObjectTarget.cpp | ||
---|---|---|
4301–4302 | thanks, makes sense. I had overlooked that current_frame_flush is also an output parameter. |
Is this missing a return?