[Lldb-commits] [lldb] Add doc strings for SBValue::IsValid and SBValue::GetError. (PR #94007)
Alex Langford via lldb-commits
lldb-commits at lists.llvm.org
Fri May 31 13:27:16 PDT 2024
================
@@ -45,6 +45,36 @@ SBValue instance which interprets the value object as representing the head of a
linked list."
) lldb::SBValue;
+%feature("docstring", "
+Returns true if the SBValue holds any useful state
+and false otherwise.
+IsValid is a very weak API, lldb will only return
+invalid SBValues if it has no useful information
+about the SBValue.
+The two main ways you will end up with an invalid
+SBValue are:
+1) default constructed SBValues are not valid.
+2) SBValues that have outlived their SBTarget are
+no longer valid since its not safe to ask them
----------------
bulbazord wrote:
What does it mean for it to be "not safe" to ask it questions? Does LLDB crash? Or does it modify state in an unpredictable manner? I think this should either be more specific about the consequences (e.g. "... no longer valid. Request data from the SBValue {is undefined, will crash LLDB, will return invalid data}.")
If you want to be vague about the behavior of this scenario (so that we aren't on the hook for guaranteeing the behavior stay the same) we should say that it is "undefined".
https://github.com/llvm/llvm-project/pull/94007
More information about the lldb-commits
mailing list