MCPcopy Create free account
hub / github.com/KDE/kdevelop / displayCurrent

Method displayCurrent

plugins/debuggercommon/widgets/disassemblewidget.cpp:346–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344}
345
346bool DisassembleWidget::displayCurrent()
347{
348 if (!isMemoryRegionDisplayed() || !m_currentAddress.isValid()) {
349 return false;
350 }
351 if (m_currentAddress < m_regionFirst || m_currentAddress > m_regionLast) {
352 return false; // cannot highlight the current address because it is outside of the displayed memory region
353 }
354
355 bool bFound=false;
356 for (int line=0; line < m_disassembleWindow->topLevelItemCount(); line++)
357 {
358 QTreeWidgetItem* item = m_disassembleWindow->topLevelItem(line);
359 const auto address = knownValidAddressFromString(item->text(Address));
360 if (address == m_currentAddress.integer()) {
361 // put cursor at start of line and highlight the line
362 m_disassembleWindow->setCurrentItem(item);
363 item->setIcon(Icon, QIcon::fromTheme(QStringLiteral("go-next")));
364 bFound = true; // need to process all items to clear icons
365 }
366 else if(!item->icon(Icon).isNull()) item->setIcon(Icon, QIcon());
367 }
368
369 return bFound;
370}
371
372/***************************************************************************/
373

Callers

nothing calls this directly

Calls 8

integerMethod · 0.80
setIconMethod · 0.80
isNullMethod · 0.80
QIconClass · 0.50
isValidMethod · 0.45
textMethod · 0.45
iconMethod · 0.45

Tested by

no test coverage detected