| 462 | } |
| 463 | |
| 464 | void MemWatchEntry::writeToJson(QJsonObject& json) const |
| 465 | { |
| 466 | json["label"] = getLabel(); |
| 467 | std::stringstream ss; |
| 468 | ss << std::hex << std::uppercase << getConsoleAddress(); |
| 469 | json["address"] = QString::fromStdString(ss.str()); |
| 470 | json["typeIndex"] = static_cast<double>(getType()); |
| 471 | json["unsigned"] = isUnsigned(); |
| 472 | if (getType() == Common::MemType::type_string || getType() == Common::MemType::type_byteArray) |
| 473 | json["length"] = static_cast<double>(getLength()); |
| 474 | else if (getType() == Common::MemType::type_struct) |
| 475 | json["structName"] = getStructName(); |
| 476 | else if (getType() == Common::MemType::type_array) |
| 477 | { |
| 478 | QJsonObject containerEntryJson{}; |
| 479 | getContainerEntry()->writeToJson(containerEntryJson); |
| 480 | json["containerEntry"] = containerEntryJson; |
| 481 | json["containerCount"] = static_cast<double>(getContainerCount()); |
| 482 | } |
| 483 | |
| 484 | json["baseIndex"] = static_cast<double>(getBase()); |
| 485 | if (isBoundToPointer()) |
| 486 | { |
| 487 | QJsonArray offsets; |
| 488 | for (int i{0}; i < static_cast<int>(getPointerOffsets().size()); ++i) |
| 489 | { |
| 490 | std::stringstream ssOffset; |
| 491 | ssOffset << std::hex << std::uppercase << getPointerOffset(i); |
| 492 | offsets.append(QString::fromStdString(ssOffset.str())); |
| 493 | } |
| 494 | json["pointerOffsets"] = offsets; |
| 495 | } |
| 496 | |
| 497 | json["absoluteBranch"] = m_absoluteBranch; |
| 498 | } |
nothing calls this directly
no outgoing calls
no test coverage detected