[Lldb-commits] [lldb] [LLDB] Add more helper functions to ValueObject class. (PR #87197)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 1 12:59:47 PDT 2024


================
@@ -441,6 +441,19 @@ class ValueObject {
 
   virtual int64_t GetValueAsSigned(int64_t fail_value, bool *success = nullptr);
 
+  llvm::APSInt GetValueAsAPSInt();
+
+  llvm::APFloat GetValueAsFloat();
+
+  bool GetValueAsBool();
+
+  /// Update the value of the current object to be the integer in the 'value'
+  /// parameter.
+  void UpdateIntegerValue(const llvm::APInt &value);
+
+  /// Assign the integer value 'new_val_sp' to the current object.
+  void UpdateIntegerValue(lldb::ValueObjectSP new_val_sp);
----------------
clayborg wrote:

What does this function actually do? Are we wanting the current `ValueObject` to copy the integer value from `lldb::ValueObjectSP new_val_sp`? Seems like we should just be able to use the above `void UpdateIntegerValue(const llvm::APInt &value);`? Can you elaborate on why this is needed?

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


More information about the lldb-commits mailing list