[Lldb-commits] [lldb] r137710 - in /lldb/trunk: include/lldb/Core/ValueObject.h include/lldb/Core/ValueObjectRegister.h source/Core/ValueObjectRegister.cpp

Greg Clayton gclayton at apple.com
Mon Aug 15 20:49:01 PDT 2011


Author: gclayton
Date: Mon Aug 15 22:49:01 2011
New Revision: 137710

URL: http://llvm.org/viewvc/llvm-project?rev=137710&view=rev
Log:
Fixed register value objects to be able to return their values as unsigned
and signed integers.


Modified:
    lldb/trunk/include/lldb/Core/ValueObject.h
    lldb/trunk/include/lldb/Core/ValueObjectRegister.h
    lldb/trunk/source/Core/ValueObjectRegister.cpp

Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=137710&r1=137709&r2=137710&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Mon Aug 15 22:49:01 2011
@@ -640,7 +640,7 @@
     Value &
     GetValue();
 
-    bool
+    virtual bool
     ResolveValue (Scalar &scalar);
     
     const char *

Modified: lldb/trunk/include/lldb/Core/ValueObjectRegister.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectRegister.h?rev=137710&r1=137709&r2=137710&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObjectRegister.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectRegister.h Mon Aug 15 22:49:01 2011
@@ -160,6 +160,9 @@
     virtual bool
     SetValueFromCString (const char *value_str);
 
+    virtual bool
+    ResolveValue (Scalar &scalar);
+
 protected:
     virtual bool
     UpdateValue ();

Modified: lldb/trunk/source/Core/ValueObjectRegister.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectRegister.cpp?rev=137710&r1=137709&r2=137710&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectRegister.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectRegister.cpp Mon Aug 15 22:49:01 2011
@@ -404,3 +404,12 @@
         return false;
 }
 
+bool
+ValueObjectRegister::ResolveValue (Scalar &scalar)
+{
+    if (UpdateValueIfNeeded(false)) // make sure that you are up to date before returning anything
+        return m_reg_value.GetScalarValue(scalar);
+    return false;
+}
+
+





More information about the lldb-commits mailing list