[Lldb-commits] [lldb] Add support for resolving addresses in "target hook". (PR #212831)

Med Ismail Bennani via lldb-commits lldb-commits at lists.llvm.org
Fri Jul 31 12:46:53 PDT 2026


medismailben wrote:

> @medismailben any ideas on how to add `std::optional<lldb.SBAddress>` support to the Dispatch? It would be great if `handle_resolve_addr` could return `lldb::SBAddress | None` and we would either fill in the optional value or if we get None back we could return `std::nullopt`.

That's an interesting idea! We could specialize `Dispatch` return type to be `std::optional<T>` instead of `T` itself and "recursively" call the right `ExtractValueFromPythonObject<T>` specialization. I think that would be a good clean-up since we already have other specialization for optional types. Also, as most of the SB classes points to pointers (`SBDebugger` -> `DebuggerSP`, `SBTarget` -> `TargetSP`, `SBProcess` -> `ProcessWP`) we need to align on what to do for those types since wrapping them in an optional wouldn't bring much value IMO.

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


More information about the lldb-commits mailing list