summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/lldb-enumerations.h1
-rw-r--r--lldb/source/Commands/CommandObjectMemory.cpp4
-rw-r--r--lldb/source/Core/DataExtractor.cpp32
-rw-r--r--lldb/source/DataFormatters/FormatManager.cpp1
4 files changed, 12 insertions, 26 deletions
diff --git a/lldb/include/lldb/lldb-enumerations.h b/lldb/include/lldb/lldb-enumerations.h
index fcca562e977..cfc68f19732 100644
--- a/lldb/include/lldb/lldb-enumerations.h
+++ b/lldb/include/lldb/lldb-enumerations.h
@@ -125,7 +125,6 @@ namespace lldb {
eFormatAddressInfo, // Describe what an address points to (func + offset with file/line, symbol + offset, data, etc)
eFormatHexFloat, // ISO C99 hex float string
eFormatInstruction, // Disassemble an opcode
- eFormatHalfFloat, // Half-floats (IEEE-754-2008 binary16 interchange format)
eFormatVoid, // Do not print this
kNumFormats
} Format;
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp
index 8bf303e08e8..fe44ad052ab 100644
--- a/lldb/source/Commands/CommandObjectMemory.cpp
+++ b/lldb/source/Commands/CommandObjectMemory.cpp
@@ -180,15 +180,12 @@ public:
case eFormatUnicode32:
case eFormatUnsigned:
case eFormatHexFloat:
- case eFormatHalfFloat:
if (!byte_size_option_set)
byte_size_value = 4;
if (!num_per_line_option_set)
m_num_per_line = 1;
if (!count_option_set)
format_options.GetCountValue() = 8;
- if (format_options.GetFormat() == eFormatFloat && byte_size_option_set && byte_size_value == 2)
- format_options.GetFormatValue().SetCurrentValue(eFormatHalfFloat);
break;
case eFormatBytes:
@@ -1173,7 +1170,6 @@ protected:
case eFormatComplexInteger:
case eFormatAddressInfo:
case eFormatHexFloat:
- case eFormatHalfFloat:
case eFormatInstruction:
case eFormatVoid:
result.AppendError("unsupported format for writing memory");
diff --git a/lldb/source/Core/DataExtractor.cpp b/lldb/source/Core/DataExtractor.cpp
index 64d2929f119..5b042ce37b6 100644
--- a/lldb/source/Core/DataExtractor.cpp
+++ b/lldb/source/Core/DataExtractor.cpp
@@ -1703,10 +1703,20 @@ DataExtractor::Dump (Stream *s,
case eFormatFloat:
{
std::ostringstream ss;
- if (item_byte_size == sizeof(float))
+ if (item_byte_size == sizeof(float) || item_byte_size == 2)
{
+ float f;
+ if (item_byte_size == 2)
+ {
+ uint16_t half = this->GetU16(&offset);
+ f = half2float(half);
+ }
+ else
+ {
+ f = GetFloat (&offset);
+ }
ss.precision(std::numeric_limits<float>::digits10);
- ss << GetFloat(&offset);
+ ss << f;
}
else if (item_byte_size == sizeof(double))
{
@@ -1728,24 +1738,6 @@ DataExtractor::Dump (Stream *s,
}
break;
- case eFormatHalfFloat:
- {
- std::ostringstream ss;
- if (item_byte_size == 2)
- {
- uint16_t half = this->GetU16(&offset);
- float half_converted = half2float(half);
- ss << half_converted;
- }
- else
- {
- s->Printf("error: unsupported byte size (%zu) for half-float format", item_byte_size);
- return offset;
- }
- ss.flush();
- s->Printf("%s", ss.str().c_str());
- }
- break;
case eFormatUnicode16:
s->Printf("U+%4.4x", GetU16 (&offset));
break;
diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp
index 1a3b2ae5f86..28c3f82e2df 100644
--- a/lldb/source/DataFormatters/FormatManager.cpp
+++ b/lldb/source/DataFormatters/FormatManager.cpp
@@ -72,7 +72,6 @@ g_format_infos[] =
{ eFormatCharArray , 'a' , "character array" },
{ eFormatAddressInfo , 'A' , "address" },
{ eFormatHexFloat , '\0' , "hex float" },
- { eFormatHalfFloat , '\0' , "half float" },
{ eFormatInstruction , 'i' , "instruction" },
{ eFormatVoid , 'v' , "void" }
};
OpenPOWER on IntegriCloud