Commit fbdfb3ac authored by hjk's avatar hjk
Browse files

debugger: display size of bitfields in 'type' column

parent 8bcaf428
......@@ -144,6 +144,8 @@ WatchData::WatchData() :
state(InitialState),
editformat(0),
address(0),
bitpos(0),
bitsize(0),
generation(-1),
hasChildren(false),
valueEnabled(true),
......
......@@ -128,6 +128,8 @@ public:
QByteArray type; // Type for further processing
QString displayedType;// Displayed type (optional)
quint64 address; // Displayed address
uint bitpos; // Position within bit fields
uint bitsize; // Size in case of bit fields
qint32 generation; // When updated?
bool hasChildren;
bool valueEnabled; // Value will be enabled or not
......
......@@ -285,9 +285,12 @@ static QString removeInitialNamespace(QString str, const QByteArray &ns)
QString WatchModel::displayType(const WatchData &data) const
{
return data.displayedType.isEmpty()
QString base = data.displayedType.isEmpty()
? niceTypeHelper(data.type)
: data.displayedType;
if (data.bitsize)
base += QString(":%1").arg(data.bitsize);
return base;
}
static int formatToIntegerBase(int format)
......
......@@ -1399,6 +1399,12 @@ void parseWatchData(const QSet<QByteArray> &expandedINames,
mi = item.findChild("typeformats");
if (mi.isValid())
data.typeFormats = QString::fromUtf8(mi.data());
mi = item.findChild("bitpos");
if (mi.isValid())
data.bitpos = mi.data().toInt();
mi = item.findChild("bitsize");
if (mi.isValid())
data.bitsize = mi.data().toInt();
setWatchDataValue(data, item);
setWatchDataAddress(data, item.findChild("addr"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment