From 8fa37553af3cd23290b2b563fb57074983275802 Mon Sep 17 00:00:00 2001 From: Kyle Huey Date: Wed, 3 Apr 2024 11:02:27 -0400 Subject: [PATCH] Tweak GdbCommand impl. --- scripts/rr-gdb-script-host.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/rr-gdb-script-host.py b/scripts/rr-gdb-script-host.py index be4a6892038..b4e143e38fd 100755 --- a/scripts/rr-gdb-script-host.py +++ b/scripts/rr-gdb-script-host.py @@ -16,6 +16,10 @@ def strip_prefix(s: str, needle: str) -> Optional[str]: GdbNewObjfileEventCallback = Callable[[object], None] +class GdbCommand: + def __init__(self, *args, **kwargs): + logging.debug("GdbCommand(%s, %s)" % (args, kwargs)) + class GdbScriptHost: """ The filename of the main symbol file """ _filename: str = "" @@ -105,7 +109,7 @@ class GdbApiRoot(GdbApiObject): _current_progspace: Optional[GdbProgspace] = None def execute(self, command: str, from_tty: bool = False, to_string: bool = False) -> Optional[str]: - logging.debug("gdb.execute(\"%s\", from_tty=%s, to_string=%s)"%(command, str(from_tty), str(to_string))) + logging.debug("gdb.execute(\"%s\", from_tty=%s, to_string=%s)" % (command, str(from_tty), str(to_string))) if from_tty: logging.warning("Unsupported gdb.execute with from_tty == True") return None @@ -162,8 +166,8 @@ def COMMAND_USER(self) -> int: return 13 @property - def Command(self) -> object: - return object() + def Command(self) -> GdbCommand: + return GdbCommand if __name__ == '__main__': with open(sys.argv[1], 'r') as user_script_file: