summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Value.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Core/Value.cpp')
-rw-r--r--lldb/source/Core/Value.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/lldb/source/Core/Value.cpp b/lldb/source/Core/Value.cpp
index 920c467333e..c346371a5e9 100644
--- a/lldb/source/Core/Value.cpp
+++ b/lldb/source/Core/Value.cpp
@@ -162,34 +162,6 @@ Value::GetProxyTarget()
return NULL;
}
-//#include "clang/Lex/LiteralSupport.h"
-//#include "clang/AST/ASTContext.h"
-//#include "clang/Frontend/CompilerInstance.h"
-//
-//Value::Value (const char *data, llvm::CompilerInstance *compiler)
-//{
-// clang::NumericLiteralParser parser(data, data + strlen(data), clang::SourceLocation(),
-// compiler->getPreprocessor());
-// if (parser.had_error)
-// {
-// }
-// else if (parser.isBool)
-// {
-// APInt value;
-// parser.GetIntegerValue(value);
-// }
-// else if (parser.isLong)
-// {
-// }
-// else if (parser.isLongLong)
-// {
-// }
-// else if (parser.isFloat)
-// {
-// }
-//
-//}
-//
void
Value::Dump (Stream* strm)
{
@@ -484,6 +456,34 @@ Value::GetValueDefaultFormat ()
return eFormatHex;
}
+bool
+Value::GetData (DataExtractor &data)
+{
+ switch (m_value_type)
+ {
+ default:
+ break;
+
+ case eValueTypeScalar:
+ if (m_value.GetData (data))
+ return true;
+ break;
+
+ case eValueTypeLoadAddress:
+ case eValueTypeFileAddress:
+ case eValueTypeHostAddress:
+ if (m_data_buffer.GetByteSize())
+ {
+ data.SetData(m_data_buffer.GetBytes(), m_data_buffer.GetByteSize(), data.GetByteOrder());
+ return true;
+ }
+ break;
+ }
+
+ return false;
+
+}
+
Error
Value::GetValueAsData (ExecutionContext *exe_ctx, clang::ASTContext *ast_context, DataExtractor &data, uint32_t data_offset)
{
OpenPOWER on IntegriCloud