aboutsummaryrefslogtreecommitdiff
path: root/source/Commands/CommandObjectMemory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Commands/CommandObjectMemory.cpp')
-rw-r--r--source/Commands/CommandObjectMemory.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/source/Commands/CommandObjectMemory.cpp b/source/Commands/CommandObjectMemory.cpp
index 6c06ec831830..dac6dd81651b 100644
--- a/source/Commands/CommandObjectMemory.cpp
+++ b/source/Commands/CommandObjectMemory.cpp
@@ -24,6 +24,7 @@
#include "lldb/Core/StreamString.h"
#include "lldb/Core/ValueObjectMemory.h"
#include "lldb/DataFormatters/ValueObjectPrinter.h"
+#include "lldb/Host/StringConvert.h"
#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Interpreter/CommandInterpreter.h"
@@ -566,7 +567,7 @@ protected:
--pointer_count;
}
- m_format_options.GetByteSizeValue() = clang_ast_type.GetByteSize();
+ m_format_options.GetByteSizeValue() = clang_ast_type.GetByteSize(nullptr);
if (m_format_options.GetByteSizeValue() == 0)
{
@@ -689,7 +690,7 @@ protected:
if (m_format_options.GetFormatValue().OptionWasSet() == false)
m_format_options.GetFormatValue().SetCurrentValue(eFormatDefault);
- bytes_read = clang_ast_type.GetByteSize() * m_format_options.GetCountValue().GetCurrentValue();
+ bytes_read = clang_ast_type.GetByteSize(nullptr) * m_format_options.GetCountValue().GetCurrentValue();
}
else if (m_format_options.GetFormatValue().GetCurrentValue() != eFormatCString)
{
@@ -1113,7 +1114,7 @@ protected:
if (process->GetTarget().EvaluateExpression(m_memory_options.m_expr.GetStringValue(), frame, result_sp) && result_sp.get())
{
uint64_t value = result_sp->GetValueAsUnsigned(0);
- switch (result_sp->GetClangType().GetByteSize())
+ switch (result_sp->GetClangType().GetByteSize(nullptr))
{
case 1: {
uint8_t byte = (uint8_t)value;
@@ -1293,7 +1294,7 @@ public:
case 'o':
{
bool success;
- m_infile_offset = Args::StringToUInt64(option_arg, 0, 0, &success);
+ m_infile_offset = StringConvert::ToUInt64(option_arg, 0, 0, &success);
if (!success)
{
error.SetErrorStringWithFormat("invalid offset string '%s'", option_arg);
@@ -1446,7 +1447,7 @@ protected:
if (m_memory_options.m_infile)
{
size_t length = SIZE_MAX;
- if (item_byte_size > 0)
+ if (item_byte_size > 1)
length = item_byte_size;
lldb::DataBufferSP data_sp (m_memory_options.m_infile.ReadFileContents (m_memory_options.m_infile_offset, length));
if (data_sp)
@@ -1539,7 +1540,7 @@ protected:
case eFormatPointer:
// Decode hex bytes
- uval64 = Args::StringToUInt64(value_str, UINT64_MAX, 16, &success);
+ uval64 = StringConvert::ToUInt64(value_str, UINT64_MAX, 16, &success);
if (!success)
{
result.AppendErrorWithFormat ("'%s' is not a valid hex string value.\n", value_str);
@@ -1567,7 +1568,7 @@ protected:
break;
case eFormatBinary:
- uval64 = Args::StringToUInt64(value_str, UINT64_MAX, 2, &success);
+ uval64 = StringConvert::ToUInt64(value_str, UINT64_MAX, 2, &success);
if (!success)
{
result.AppendErrorWithFormat ("'%s' is not a valid binary string value.\n", value_str);
@@ -1607,7 +1608,7 @@ protected:
break;
case eFormatDecimal:
- sval64 = Args::StringToSInt64(value_str, INT64_MAX, 0, &success);
+ sval64 = StringConvert::ToSInt64(value_str, INT64_MAX, 0, &success);
if (!success)
{
result.AppendErrorWithFormat ("'%s' is not a valid signed decimal value.\n", value_str);
@@ -1624,7 +1625,7 @@ protected:
break;
case eFormatUnsigned:
- uval64 = Args::StringToUInt64(value_str, UINT64_MAX, 0, &success);
+ uval64 = StringConvert::ToUInt64(value_str, UINT64_MAX, 0, &success);
if (!success)
{
result.AppendErrorWithFormat ("'%s' is not a valid unsigned decimal string value.\n", value_str);
@@ -1641,7 +1642,7 @@ protected:
break;
case eFormatOctal:
- uval64 = Args::StringToUInt64(value_str, UINT64_MAX, 8, &success);
+ uval64 = StringConvert::ToUInt64(value_str, UINT64_MAX, 8, &success);
if (!success)
{
result.AppendErrorWithFormat ("'%s' is not a valid octal string value.\n", value_str);