[Lldb-commits] [lldb] [LLDB] FindLibCppStdFunctionCallableInfo improvements (PR #111892)

David Mentler via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 11 12:09:15 PDT 2024


mentlerd wrote:

> A high-level comment: could we split up `FindLibCppStdFunctionCallableInfo`? Exactly how I haven't fully thought through. But possibly a function for each of the callable cases?

Sure! I think a natural split could be to make a version which returns a (possibly dummy) `ValueObjectSP` of wrapped callable in combination with a `CompilerType` of the function pointer type describing the kind of function this `std::function` implements.

Other code then can either proceed to extracting the load address from the `ValueObjectSP` that we might land in when the `std::function` is called, or to just serve the `ValueObjectSP` as synthetic children.

---

One open question that I have been thinking about is how to handle callable types with multiple `operator()(...)` function overloads. My thought process so far is that trying to figure out which overload `std::function` would end up calling is futile effort, instead we could try giving the thread plan all potential addresses.

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


More information about the lldb-commits mailing list