Skip to content

Commit 1b6289a

Browse files
committed
Add a "Python" prefix to Python debugger views, BinaryView, and actions
1 parent f28c9cb commit 1b6289a

File tree

4 files changed

+41
-41
lines changed

4 files changed

+41
-41
lines changed

ProcessView.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"""
1111

1212
class DebugProcessView(BinaryView):
13-
name = "Debugged Process"
13+
name = "Python Debugged Process"
1414
def __init__(self, parent):
1515
self.memory = DebugMemoryView(parent)
1616
self.local_view = parent
@@ -117,7 +117,7 @@ def is_local_addr(self, remote_addr, relative_view=None):
117117
return local_addr > local_base and local_addr < local_base + len(relative_view)
118118

119119
class DebugMemoryView(BinaryView):
120-
name = "Debugged Process Memory"
120+
name = "Python Debugged Process Memory"
121121
def __init__(self, parent):
122122
BinaryView.__init__(self, parent_view=parent, file_metadata=parent.file)
123123
self.value_cache = {}

dockwidgets/ConsoleWidget.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def __init__(self, parent, name, data):
4444
self.consoleEntry = QLineEdit(self)
4545
inputLayout.addWidget(self.consoleEntry, 1)
4646

47-
self.entryLabel = QLabel("dbg>>> ", self)
47+
self.entryLabel = QLabel("pydbg>>> ", self)
4848
self.entryLabel.setFont(getMonospaceFont(self))
4949
promptLayout.addWidget(self.entryLabel)
5050
promptLayout.addStretch(1)

dockwidgets/DebugView.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def add_scripting_ref(self):
156156
# and assign our state to the interpreter's locals
157157
for thread in threading.enumerate():
158158
if type(thread) == PythonScriptingInstance.InterpreterThread:
159-
thread.locals["dbg"] = self.debug_state
159+
thread.locals["pydbg"] = self.debug_state
160160

161161
def getData(self):
162162
return self.bv
@@ -374,7 +374,7 @@ def refresh_raw_disassembly(self):
374374
class DebugViewType(ViewType):
375375
# executed at plugin load time from from ui.py ViewType.registerViewType()
376376
def __init__(self):
377-
super(DebugViewType, self).__init__("Debugger", "Debugger")
377+
super(DebugViewType, self).__init__("Python Debugger", "Python Debugger")
378378

379379
def getPriority(self, data, filename):
380380
return 1

ui.py

+36-36
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ def __init__(self, state):
3030
self.regs = []
3131
self.stack = []
3232

33-
registers_widget = self.widget("Debugger Registers")
34-
modules_widget = self.widget("Debugger Modules")
35-
threads_widget = self.widget("Debugger Threads")
36-
stack_widget = self.widget("Debugger Stack")
37-
bp_widget = self.widget("Debugger Breakpoints")
38-
#console_widget = self.widget('Debugger Console')
33+
registers_widget = self.widget("Python Debugger Registers")
34+
modules_widget = self.widget("Python Debugger Modules")
35+
threads_widget = self.widget("Python Debugger Threads")
36+
stack_widget = self.widget("Python Debugger Stack")
37+
bp_widget = self.widget("Python Debugger Breakpoints")
38+
#console_widget = self.widget('Python Debugger Console')
3939

4040
if registers_widget is None or modules_widget is None or threads_widget is None or stack_widget is None or bp_widget is None:
4141
# One of the views failed to create, bail
@@ -55,10 +55,10 @@ def widget(self, name):
5555
return widget.get_dockwidget(self.state.bv, name)
5656

5757
def context_display(self):
58-
registers_widget = self.widget("Debugger Registers")
59-
modules_widget = self.widget("Debugger Modules")
60-
threads_widget = self.widget("Debugger Threads")
61-
stack_widget = self.widget("Debugger Stack")
58+
registers_widget = self.widget("Python Debugger Registers")
59+
modules_widget = self.widget("Python Debugger Modules")
60+
threads_widget = self.widget("Python Debugger Threads")
61+
stack_widget = self.widget("Python Debugger Stack")
6262

6363
if not self.state.connected:
6464
# Disconnected
@@ -355,7 +355,7 @@ def update_modules(self):
355355
# TODO: Length, segments, etc
356356
})
357357
mods.sort(key=lambda row: row['address'])
358-
modules_widget = self.widget("Debugger Modules")
358+
modules_widget = self.widget("Python Debugger Modules")
359359
modules_widget.notifyModulesChanged(mods)
360360

361361
# Mark memory as dirty, will refresh memory view
@@ -391,7 +391,7 @@ def update_breakpoints(self):
391391
'address': address
392392
})
393393

394-
bp_widget = self.widget("Debugger Breakpoints")
394+
bp_widget = self.widget("Python Debugger Breakpoints")
395395
bp_widget.notifyBreakpointsChanged(bps)
396396
# Refresh disassembly to show the new bp
397397
if self.debug_view is not None:
@@ -435,7 +435,7 @@ def get_breakpoint_tag_type(self):
435435

436436
def on_stdout(self, output):
437437
#def on_stdout_main_thread(output):
438-
# console_widget = self.widget('Debugger Console')
438+
# console_widget = self.widget('Python Debugger Console')
439439
# console_widget.notifyStdout(output)
440440
#execute_on_main_thread(lambda: on_stdout_main_thread(output))
441441
pass
@@ -617,28 +617,28 @@ def helpDocs(context):
617617
QDesktopServices.openUrl(URLPath)
618618

619619
def initialize_ui():
620-
widget.register_dockwidget(BreakpointsWidget.DebugBreakpointsWidget, "Debugger Breakpoints", Qt.BottomDockWidgetArea, Qt.Horizontal, False)
621-
widget.register_dockwidget(RegistersWidget.DebugRegistersWidget, "Debugger Registers", Qt.RightDockWidgetArea, Qt.Vertical, False)
622-
widget.register_dockwidget(ThreadsWidget.DebugThreadsWidget, "Debugger Threads", Qt.BottomDockWidgetArea, Qt.Horizontal, False)
623-
widget.register_dockwidget(StackWidget.DebugStackWidget, "Debugger Stack", Qt.LeftDockWidgetArea, Qt.Vertical, False)
624-
widget.register_dockwidget(ModulesWidget.DebugModulesWidget, "Debugger Modules", Qt.BottomDockWidgetArea, Qt.Horizontal, False)
625-
#widget.register_dockwidget(ConsoleWidget.DebugConsoleWidget, "Debugger Console", Qt.BottomDockWidgetArea, Qt.Horizontal, False)
626-
627-
PluginCommand.register_for_address("Debugger\\Toggle Breakpoint", "sets/clears breakpoint at right-clicked address", cb_bp_toggle, is_valid=valid_bp_toggle)
628-
629-
PluginCommand.register("Debugger\\Process\\Run", "Start new debugging session", cb_process_run, is_valid=valid_process_run)
630-
PluginCommand.register("Debugger\\User Documentation", "Open Debugger Documentation", helpDocs, is_valid=valid_process_run)
631-
PluginCommand.register("Debugger\\Process\\Restart", "Restart debugging session", cb_process_restart, is_valid=valid_process_restart)
632-
PluginCommand.register("Debugger\\Process\\Quit", "Terminate debugged process and end session", cb_process_quit, is_valid=valid_process_quit)
633-
# PluginCommand.register("Debugger\\Process\\Attach", "Attach to running process", cb_process_attach, is_valid=valid_process_attach)
634-
PluginCommand.register("Debugger\\Process\\Detach", "Detach from current debugged process", cb_process_detach, is_valid=valid_process_detach)
635-
PluginCommand.register("Debugger\\Process\\Settings", "Open adapter settings menu", cb_process_settings, is_valid=valid_process_settings)
636-
PluginCommand.register("Debugger\\Control\\Pause", "Pause execution", cb_control_pause, is_valid=valid_control_pause)
637-
PluginCommand.register("Debugger\\Control\\Resume", "Resume execution", cb_control_resume, is_valid=valid_control_resume)
638-
PluginCommand.register("Debugger\\Control\\Step Into (Assembly)", "Step into assembly", cb_control_step_into_asm, is_valid=valid_control_step_into_asm)
639-
PluginCommand.register("Debugger\\Control\\Step Into (IL)", "Step into IL", cb_control_step_into_il, is_valid=valid_control_step_into_il)
640-
PluginCommand.register("Debugger\\Control\\Step Over (Assembly)", "Step over function call", cb_control_step_over_asm, is_valid=valid_control_step_over_asm)
641-
PluginCommand.register("Debugger\\Control\\Step Over (IL)", "Step over function call", cb_control_step_over_il, is_valid=valid_control_step_over_il)
642-
PluginCommand.register("Debugger\\Control\\Step Return", "Step until current function returns", cb_control_step_return, is_valid=valid_control_step_return)
620+
widget.register_dockwidget(BreakpointsWidget.DebugBreakpointsWidget, "Python Debugger Breakpoints", Qt.BottomDockWidgetArea, Qt.Horizontal, False)
621+
widget.register_dockwidget(RegistersWidget.DebugRegistersWidget, "Python Debugger Registers", Qt.RightDockWidgetArea, Qt.Vertical, False)
622+
widget.register_dockwidget(ThreadsWidget.DebugThreadsWidget, "Python Debugger Threads", Qt.BottomDockWidgetArea, Qt.Horizontal, False)
623+
widget.register_dockwidget(StackWidget.DebugStackWidget, "Python Debugger Stack", Qt.LeftDockWidgetArea, Qt.Vertical, False)
624+
widget.register_dockwidget(ModulesWidget.DebugModulesWidget, "Python Debugger Modules", Qt.BottomDockWidgetArea, Qt.Horizontal, False)
625+
#widget.register_dockwidget(ConsoleWidget.DebugConsoleWidget, "Python Debugger Console", Qt.BottomDockWidgetArea, Qt.Horizontal, False)
626+
627+
PluginCommand.register_for_address("Python Debugger\\Toggle Breakpoint", "sets/clears breakpoint at right-clicked address", cb_bp_toggle, is_valid=valid_bp_toggle)
628+
629+
PluginCommand.register("Python Debugger\\Process\\Run", "Start new debugging session", cb_process_run, is_valid=valid_process_run)
630+
PluginCommand.register("Python Debugger\\User Documentation", "Open Debugger Documentation", helpDocs, is_valid=valid_process_run)
631+
PluginCommand.register("Python Debugger\\Process\\Restart", "Restart debugging session", cb_process_restart, is_valid=valid_process_restart)
632+
PluginCommand.register("Python Debugger\\Process\\Quit", "Terminate debugged process and end session", cb_process_quit, is_valid=valid_process_quit)
633+
# PluginCommand.register("Python Debugger\\Process\\Attach", "Attach to running process", cb_process_attach, is_valid=valid_process_attach)
634+
PluginCommand.register("Python Debugger\\Process\\Detach", "Detach from current debugged process", cb_process_detach, is_valid=valid_process_detach)
635+
PluginCommand.register("Python Debugger\\Process\\Settings", "Open adapter settings menu", cb_process_settings, is_valid=valid_process_settings)
636+
PluginCommand.register("Python Debugger\\Control\\Pause", "Pause execution", cb_control_pause, is_valid=valid_control_pause)
637+
PluginCommand.register("Python Debugger\\Control\\Resume", "Resume execution", cb_control_resume, is_valid=valid_control_resume)
638+
PluginCommand.register("Python Debugger\\Control\\Step Into (Assembly)", "Step into assembly", cb_control_step_into_asm, is_valid=valid_control_step_into_asm)
639+
PluginCommand.register("Python Debugger\\Control\\Step Into (IL)", "Step into IL", cb_control_step_into_il, is_valid=valid_control_step_into_il)
640+
PluginCommand.register("Python Debugger\\Control\\Step Over (Assembly)", "Step over function call", cb_control_step_over_asm, is_valid=valid_control_step_over_asm)
641+
PluginCommand.register("Python Debugger\\Control\\Step Over (IL)", "Step over function call", cb_control_step_over_il, is_valid=valid_control_step_over_il)
642+
PluginCommand.register("Python Debugger\\Control\\Step Return", "Step until current function returns", cb_control_step_return, is_valid=valid_control_step_return)
643643

644644
ViewType.registerViewType(DebugView.DebugViewType())

0 commit comments

Comments
 (0)