summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/lldb-enumerations.h1
-rw-r--r--lldb/source/Commands/CommandObjectMemory.cpp2
-rw-r--r--lldb/source/Core/DataExtractor.cpp6
-rw-r--r--lldb/source/Core/State.cpp1
-rw-r--r--lldb/source/Core/ValueObject.cpp4
-rw-r--r--lldb/source/Interpreter/Args.cpp2
-rw-r--r--lldb/source/Symbol/ClangASTType.cpp1
7 files changed, 13 insertions, 4 deletions
diff --git a/lldb/include/lldb/lldb-enumerations.h b/lldb/include/lldb/lldb-enumerations.h
index bdb0162e453..b22046ad327 100644
--- a/lldb/include/lldb/lldb-enumerations.h
+++ b/lldb/include/lldb/lldb-enumerations.h
@@ -92,6 +92,7 @@ namespace lldb {
eFormatBytesWithASCII,
eFormatChar,
eFormatCharPrintable, // Only printable characters, space if not printable
+ eFormatCharArray, // Print characters with no single quotes, used for character arrays that can contain non printable characters
eFormatComplex, // Floating point complex type
eFormatComplexFloat = eFormatComplex,
eFormatCString, // NULL terminated C strings
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp
index 91144e5d7b4..6bdd40bdfd0 100644
--- a/lldb/source/Commands/CommandObjectMemory.cpp
+++ b/lldb/source/Commands/CommandObjectMemory.cpp
@@ -210,6 +210,7 @@ public:
if (!count_option_set)
m_count = 32;
break;
+ case eFormatCharArray:
case eFormatChar:
case eFormatCharPrintable:
if (!byte_size_option_set)
@@ -1062,6 +1063,7 @@ public:
buffer.PutMaxHex64 (uval64, item_byte_size);
break;
+ case eFormatCharArray:
case eFormatChar:
case eFormatCString:
if (value_str[0])
diff --git a/lldb/source/Core/DataExtractor.cpp b/lldb/source/Core/DataExtractor.cpp
index bc26c8645e1..9d665735534 100644
--- a/lldb/source/Core/DataExtractor.cpp
+++ b/lldb/source/Core/DataExtractor.cpp
@@ -1354,6 +1354,7 @@ DataExtractor::Dump
else
if (item_format != eFormatChar &&
item_format != eFormatCharPrintable &&
+ item_format != eFormatCharArray &&
count > 0)
{
s->PutChar(' ');
@@ -1397,6 +1398,7 @@ DataExtractor::Dump
case eFormatChar:
case eFormatCharPrintable:
+ case eFormatCharArray:
{
// If we are only printing one character surround it with single
// quotes
@@ -1406,7 +1408,7 @@ DataExtractor::Dump
uint32_t ch = GetMaxU64(&offset, item_byte_size);
if (isprint(ch))
s->Printf ("%c", ch);
- else if (item_format == eFormatChar)
+ else if (item_format != eFormatCharPrintable)
{
switch (ch)
{
@@ -1608,7 +1610,7 @@ DataExtractor::Dump
case eFormatVectorOfChar:
s->PutChar('{');
- offset = Dump (s, start_offset, eFormatChar, 1, item_byte_size, item_byte_size, LLDB_INVALID_ADDRESS, 0, 0);
+ offset = Dump (s, start_offset, eFormatCharArray, 1, item_byte_size, item_byte_size, LLDB_INVALID_ADDRESS, 0, 0);
s->PutChar('}');
break;
diff --git a/lldb/source/Core/State.cpp b/lldb/source/Core/State.cpp
index ad73ba8e3d5..2292fa750b2 100644
--- a/lldb/source/Core/State.cpp
+++ b/lldb/source/Core/State.cpp
@@ -51,6 +51,7 @@ lldb_private::GetFormatAsCString (lldb::Format format)
case eFormatBytes: return "bytes";
case eFormatBytesWithASCII: return "bytes with ASCII";
case eFormatChar: return "character";
+ case eFormatCharArray: return "character array";
case eFormatCharPrintable: return "printable character";
case eFormatComplexFloat: return "complet float";
case eFormatCString: return "c-string";
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index ee44876a0ec..2f71c02dba8 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -505,7 +505,7 @@ ValueObject::GetSummaryAsCString ()
sstr << '"';
data.Dump (&sstr,
0, // Start offset in "data"
- eFormatChar, // Print as characters
+ eFormatCharArray, // Print as characters
1, // Size of item (1 byte for a char!)
bytes_read, // How many bytes to print?
UINT32_MAX, // num per line
@@ -535,7 +535,7 @@ ValueObject::GetSummaryAsCString ()
data.Dump (&sstr,
0, // Start offset in "data"
- eFormatChar, // Print as characters
+ eFormatCharArray, // Print as characters
1, // Size of item (1 byte for a char!)
len, // How many bytes to print?
UINT32_MAX, // num per line
diff --git a/lldb/source/Interpreter/Args.cpp b/lldb/source/Interpreter/Args.cpp
index 95183a0686c..1913132fc83 100644
--- a/lldb/source/Interpreter/Args.cpp
+++ b/lldb/source/Interpreter/Args.cpp
@@ -908,6 +908,7 @@ Args::StringToFormat
case 'Y': format = eFormatBytesWithASCII; break;
case 'b': format = eFormatBinary; break;
case 'B': format = eFormatBoolean; break;
+ case 'a': format = eFormatCharArray; break;
case 'c': format = eFormatChar; break;
case 'C': format = eFormatCharPrintable; break;
case 'o': format = eFormatOctal; break;
@@ -930,6 +931,7 @@ Args::StringToFormat
}
if (!success)
error.SetErrorStringWithFormat ("Invalid format specification '%s'. Valid values are:\n"
+ " a - char buffer\n"
" b - binary\n"
" B - boolean\n"
" c - char\n"
diff --git a/lldb/source/Symbol/ClangASTType.cpp b/lldb/source/Symbol/ClangASTType.cpp
index c8c5e766396..4a5767b2f0f 100644
--- a/lldb/source/Symbol/ClangASTType.cpp
+++ b/lldb/source/Symbol/ClangASTType.cpp
@@ -788,6 +788,7 @@ ClangASTType::DumpTypeValue
case eFormatChar:
case eFormatCharPrintable:
+ case eFormatCharArray:
case eFormatBytes:
case eFormatBytesWithASCII:
item_count = (byte_size * item_count);
OpenPOWER on IntegriCloud