Skip to content

Commit c61e08d

Browse files
Copilotxusheng6
andcommitted
Fix TTD Memory widget issues: revert theme changes, use 1-byte default range, fix timestamp navigation
Co-authored-by: xusheng6 <[email protected]>
1 parent 4071570 commit c61e08d

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

core/adapters/dbgengttdadapter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ bool DbgEngTTDAdapter::SetTTDPosition(const TTDPosition& position)
458458
}
459459

460460
// Use data model API to navigate to position
461-
std::string expression = fmt::format("@$cursession.TTD.SetPosition(0x{:X}:{:X})", position.sequence, position.step);
461+
std::string expression = fmt::format("@$curprocess.TTD.SetPosition(\"{}:{}\")", position.sequence, position.step);
462462
std::string output = EvaluateDataModelExpression(expression);
463463

464464
if (!output.empty())

ui/ttdmemorywidget.cpp

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,26 @@ void TTDMemoryQueryWidget::onCellDoubleClicked(int row, int column)
516516
TTDPosition pos(sequence, step);
517517
if (m_controller->SetTTDPosition(pos))
518518
{
519-
updateStatus(QString("Navigated to position %1").arg(posStr));
519+
// After time traveling, also navigate to the instruction pointer
520+
QTableWidgetItem* ipItem = m_resultsTable->item(row, 10); // IP column
521+
if (ipItem && m_data)
522+
{
523+
QString ipStr = ipItem->text();
524+
if (ipStr.startsWith("0x", Qt::CaseInsensitive))
525+
{
526+
bool ok;
527+
uint64_t ipAddress = ipStr.mid(2).toULongLong(&ok, 16);
528+
if (ok)
529+
{
530+
ViewFrame* frame = ViewFrame::viewFrameForWidget(this);
531+
if (frame)
532+
{
533+
frame->navigate(m_data, ipAddress);
534+
}
535+
}
536+
}
537+
}
538+
updateStatus(QString("Time traveled to position %1 and navigated to instruction").arg(posStr));
520539
}
521540
else
522541
{
@@ -747,11 +766,6 @@ void TTDMemoryWidget::setupUI()
747766
// Tab widget setup
748767
m_tabWidget = new QTabWidget(this);
749768
m_tabWidget->setTabsClosable(true);
750-
751-
// Ensure proper theme inheritance
752-
m_tabWidget->setAutoFillBackground(false);
753-
m_tabWidget->setAttribute(Qt::WA_StyledBackground, false);
754-
755769
connect(m_tabWidget, &QTabWidget::tabCloseRequested, this, &TTDMemoryWidget::closeTab);
756770

757771
// Create "+" button as corner widget

ui/ui.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ void GlobalDebuggerUI::GetAddressRange(const UIActionContext& ctxt, uint64_t& st
200200
}
201201
else
202202
{
203-
// Use current address, default to 4 bytes
203+
// Use current address, default to 1 byte
204204
startAddr = ctxt.address;
205-
endAddr = ctxt.address + 4;
205+
endAddr = ctxt.address + 1;
206206
}
207207
}
208208

0 commit comments

Comments
 (0)