Skip to content

Commit 526fb7a

Browse files
committed
Do not register the dbg object from the API
1 parent b2c7e5c commit 526fb7a

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

python/scriptingprovider.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,6 @@ def __init__(self, instance):
706706
self.current_addr = 0
707707
self.current_selection_begin = 0
708708
self.current_selection_end = 0
709-
self.current_dbg = None
710709

711710
# Selections that were current as of last issued command
712711
self.active_view = None
@@ -716,7 +715,6 @@ def __init__(self, instance):
716715
self.active_selection_begin = 0
717716
self.active_selection_end = 0
718717
self.active_file_offset = None
719-
self.active_dbg = None
720718
self.active_il_index = 0
721719
self.selection_start_il_index = 0
722720
self.active_il_function = None
@@ -834,7 +832,6 @@ def update_locals(self):
834832
self.active_addr = self.current_addr
835833
self.active_selection_begin = self.current_selection_begin
836834
self.active_selection_end = self.current_selection_end
837-
self.active_dbg = self.current_dbg
838835

839836
self.locals.blacklist_enabled = False
840837

@@ -925,13 +922,11 @@ def __init__(self, provider):
925922
# So `from debugger import DebuggerController` would not work.
926923
from debugger import DebuggerController
927924
self.DebuggerController = DebuggerController
928-
self.debugger_imported = True
929925
else:
930926
if settings.contains('corePlugins.debugger') and settings.get_bool('corePlugins.debugger') and \
931927
(os.environ.get('BN_DISABLE_CORE_DEBUGGER') is None):
932928
from .debugger import DebuggerController
933929
self.DebuggerController = DebuggerController
934-
self.debugger_imported = True
935930

936931
@abc.abstractmethod
937932
def perform_stop(self):
@@ -1001,12 +996,6 @@ def perform_cancel_script_input(self):
1001996
@abc.abstractmethod
1002997
def perform_set_current_binary_view(self, view):
1003998
self.interpreter.current_view = view
1004-
if view is not None:
1005-
if self.debugger_imported:
1006-
self.interpreter.current_dbg = self.DebuggerController(view)
1007-
1008-
else:
1009-
self.interpreter.current_dbg = None
1010999

10111000
# This is a workaround that allows BN to properly free up resources when the last tab of a binary view is closed.
10121001
# Without this update, the interpreter local variables will NOT be updated until the user interacts with the
@@ -1545,11 +1534,6 @@ def _get_current_project(instance: PythonScriptingInstance):
15451534
"current_basic_block",
15461535
lambda instance: instance.interpreter.active_block
15471536
)
1548-
# todo: this is the debugger's responsibility
1549-
PythonScriptingProvider.register_magic_variable(
1550-
"dbg",
1551-
lambda instance: instance.interpreter.active_dbg
1552-
)
15531537

15541538

15551539
def _get_current_llil(instance: PythonScriptingInstance):

0 commit comments

Comments
 (0)