MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / updateDisplayString

Method updateDisplayString

pcsx2-qt/Debugger/SymbolTree/SymbolTreeNode.cpp:212–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210}
211
212bool 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
244QString SymbolTreeNode::generateDisplayString(
245 const ccc::ast::Node& physical_type,

Callers

nothing calls this directly

Calls 5

lookup_nodeMethod · 0.80
physical_typeMethod · 0.80
read32Method · 0.80
argMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected