Debugger: Add support for two more floating point display formats

1. The `std::hexfloat` representation produced by `std::sstream`.
2. Breaking the number into a normalized value and a integral power of 2,
   as does the `std::frexp()` function.

M_PI looks like "0x1.921fb54442d18p+1" and "0.785398163397 * 2^2"
respectively.

Fixes: QTCREATORBUG-26793
Change-Id: Ib08ea9408f79201434eb75ec328b94ab933259a4
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2022-01-06 18:10:04 +01:00
parent 03d4fdc602
commit 1abe76549e
4 changed files with 51 additions and 1 deletions

View File

@@ -628,6 +628,19 @@ QString WatchItem::sourceExpression() const
return QString("%1.%2").arg(p->sourceExpression(), name);
}
int WatchItem::guessSize() const
{
if (size != 0)
return size;
if (type == "double")
return 8;
if (type == "float")
return 4;
if (type == "qfloat16")
return 2;
return 0;
}
} // namespace Internal
} // namespace Debugger