Commit 5a11c56c541a11ea8a3b990b019cc1d0ef351eee
- Diff rendering mode:
- inline
- side by side
src/plugins/debugger/cdb/cdbsymbolgroupcontext.cpp
(26 / 16)
|   | |||
| 401 | 401 | return m_inameIndexMap.key(index); | |
| 402 | 402 | } | |
| 403 | 403 | ||
| 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. | ||
| 406 | static 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. | ||
| 405 | 421 | static inline bool isNullPointer(const WatchData &wd) | |
| 406 | 422 | { | |
| 407 | 423 | if (!isPointerType(wd.type)) | |
| 408 | 424 | 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; | ||
| 416 | 431 | } | |
| 417 | 432 | ||
| 418 | 433 | // Fix a symbol group value. It is set to the class type for | |
| … | … | ||
| 728 | 728 | } | |
| 729 | 729 | ||
| 730 | 730 | // Get pointer value of symbol group ("0xAAB") | |
| 731 | // Note that this is on "00000000`0250124a" on 64bit systems. | ||
| 731 | 732 | static inline bool getPointerValue(CIDebugSymbolGroup *sg, int index, quint64 *value) | |
| 732 | 733 | { | |
| 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); | ||
| 741 | 736 | } | |
| 742 | 737 | ||
| 743 | 738 | int CdbSymbolGroupContext::dumpQString(CIDebugDataSpaces *ds, WatchData *wd) |
Comments
Add a new comment:
Login or create an account to post a comment
Add your comment
Please log in to comment

