Commit 5a11c56c541a11ea8a3b990b019cc1d0ef351eee

  • avatar
  • con <qtc-committer @no…a.com> (Committer)
  • Mon Nov 23 12:56:03 CET 2009
  • avatar
  • Friedemann Kleint (Author)
  • Mon Nov 23 11:01:49 CET 2009
CDB: Convert 64bit pointers correctly.

Adapt to the output format "0x0000000`0046535C".
Reviewed-by: hjk <qtc-committer@nokia.com>
(cherry picked from commit 7def179a9874ef9cbeec8f824bcf35acc42d9253)
  
401401 return m_inameIndexMap.key(index);
402402}
403403
404// check for "0x000", "0x000 class X"
404// Return hexadecimal pointer value from a CDB pointer value
405// which look like "0x000032a" or "0x00000000`0250124a" on 64-bit systems.
406static bool inline getPointerValue(QString stringValue, quint64 *value)
407{
408 *value = 0;
409 if (!stringValue.startsWith(QLatin1String("0x")))
410 return false;
411 stringValue.remove(0, 2);
412 // Remove 64bit separator
413 if (stringValue.size() > 8 && stringValue.at(8) == QLatin1Char('`'))
414 stringValue.remove(8, 1);
415 bool ok;
416 *value = stringValue.toULongLong(&ok, 16);
417 return ok;
418}
419
420// check for "0x000", "0x000 class X" or its 64-bit equivalents.
405421static inline bool isNullPointer(const WatchData &wd)
406422{
407423 if (!isPointerType(wd.type))
408424 return false;
409 static const QRegExp hexNullPattern(QLatin1String("0x0+"));
410 Q_ASSERT(hexNullPattern.isValid());
411 const int blankPos = wd.value.indexOf(QLatin1Char(' '));
412 if (blankPos == -1)
413 return hexNullPattern.exactMatch(wd.value);
414 const QString addr = wd.value.mid(0, blankPos);
415 return hexNullPattern.exactMatch(addr);
425 QString stringValue = wd.value;
426 const int blankPos = stringValue.indexOf(QLatin1Char(' '));
427 if (blankPos != -1)
428 stringValue.truncate(blankPos);
429 quint64 value;
430 return getPointerValue(stringValue, &value) && value == 0u;
416431}
417432
418433// Fix a symbol group value. It is set to the class type for
728728}
729729
730730// Get pointer value of symbol group ("0xAAB")
731// Note that this is on "00000000`0250124a" on 64bit systems.
731732static inline bool getPointerValue(CIDebugSymbolGroup *sg, int index, quint64 *value)
732733{
733 *value = 0;
734 QString valueS = getSymbolString(sg, &IDebugSymbolGroup2::GetSymbolValueTextWide, index);
735 if (!valueS.startsWith(QLatin1String("0x")))
736 return false;
737 valueS.remove(0, 2);
738 bool ok;
739 *value = valueS.toULongLong(&ok, 16);
740 return ok;
734 const QString stringValue = getSymbolString(sg, &IDebugSymbolGroup2::GetSymbolValueTextWide, index);
735 return getPointerValue(stringValue, value);
741736}
742737
743738int CdbSymbolGroupContext::dumpQString(CIDebugDataSpaces *ds, WatchData *wd)