Skip to content

Commit 77edee4

Browse files
Copilotxusheng6
andcommitted
Update TTD navigation API to use property syntax and change shortcut to Shift+G
Co-authored-by: xusheng6 <[email protected]>
1 parent 1aee293 commit 77edee4

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

api/python/debuggercontroller.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,8 @@ def is_first_launch(self):
16921692
def is_ttd(self):
16931693
return dbgcore.BNDebuggerIsTTD(self.handle)
16941694

1695-
def get_current_ttd_position(self):
1695+
@property
1696+
def current_ttd_position(self):
16961697
"""
16971698
Get the current position in the TTD trace.
16981699
@@ -1705,6 +1706,31 @@ def get_current_ttd_position(self):
17051706
pos = dbgcore.BNDebuggerGetCurrentTTDPosition(self.handle)
17061707
return TTDPosition(pos.sequence, pos.step)
17071708

1709+
@current_ttd_position.setter
1710+
def current_ttd_position(self, position):
1711+
"""
1712+
Navigate to a specific position in the TTD trace.
1713+
1714+
Args:
1715+
position: TTDPosition object or string in format "sequence:step"
1716+
"""
1717+
if not self.is_ttd:
1718+
raise RuntimeError("TTD is not active")
1719+
1720+
if isinstance(position, str):
1721+
position = TTDPosition.from_string(position)
1722+
elif not isinstance(position, TTDPosition):
1723+
raise TypeError("Position must be TTDPosition object or string")
1724+
1725+
# Create the C structure
1726+
pos = dbgcore.BNDebuggerTTDPosition()
1727+
pos.sequence = position.sequence
1728+
pos.step = position.step
1729+
1730+
success = dbgcore.BNDebuggerSetTTDPosition(self.handle, pos)
1731+
if not success:
1732+
raise RuntimeError("Failed to navigate to the specified TTD position")
1733+
17081734
def set_ttd_position(self, position):
17091735
"""
17101736
Navigate to a specific position in the TTD trace.

ui/ui.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ void GlobalDebuggerUI::SetupMenu(UIContext* context)
11431143
connectedToTTD));
11441144
debuggerMenu->addAction("TTD Calls\\Kernel32 Calls", "TTD");
11451145

1146-
UIAction::registerAction("Navigate to TTD Timestamp...", QKeySequence(Qt::ControlModifier | Qt::Key_T));
1146+
UIAction::registerAction("Navigate to TTD Timestamp...", QKeySequence(Qt::ShiftModifier | Qt::Key_G));
11471147
context->globalActions()->bindAction("Navigate to TTD Timestamp...",
11481148
UIAction(
11491149
[=](const UIActionContext& ctxt) {

0 commit comments

Comments
 (0)