| 210 | } |
| 211 | |
| 212 | bool SymbolTreeNode::updateDisplayString( |
| 213 | DebugInterface& cpu, const ccc::SymbolDatabase& database, const SymbolTreeDisplayOptions& display) |
| 214 | { |
| 215 | QString result; |
| 216 | |
| 217 | const ccc::ast::Node* logical_type = type.lookup_node(database); |
| 218 | if (logical_type) |
| 219 | { |
| 220 | const ccc::ast::Node& physical_type = *logical_type->physical_type(database).first; |
| 221 | result = generateDisplayString(physical_type, cpu, database, display, 0); |
| 222 | } |
| 223 | |
| 224 | if (result.isEmpty()) |
| 225 | { |
| 226 | // We don't know how to display objects of this type, so just show the |
| 227 | // first 4 bytes of it as a hex dump. |
| 228 | u32 value = location.read32(cpu); |
| 229 | result = QString("%1 %2 %3 %4") |
| 230 | .arg(value & 0xff, 2, 16, QChar('0')) |
| 231 | .arg((value >> 8) & 0xff, 2, 16, QChar('0')) |
| 232 | .arg((value >> 16) & 0xff, 2, 16, QChar('0')) |
| 233 | .arg((value >> 24) & 0xff, 2, 16, QChar('0')); |
| 234 | } |
| 235 | |
| 236 | if (result == m_display_value) |
| 237 | return false; |
| 238 | |
| 239 | m_display_value = std::move(result); |
| 240 | |
| 241 | return true; |
| 242 | } |
| 243 | |
| 244 | QString SymbolTreeNode::generateDisplayString( |
| 245 | const ccc::ast::Node& physical_type, |
nothing calls this directly
no test coverage detected