summaryrefslogtreecommitdiff
path: root/misc/lldb_rb/rb_base_command.py
diff options
context:
space:
mode:
Diffstat (limited to 'misc/lldb_rb/rb_base_command.py')
-rw-r--r--misc/lldb_rb/rb_base_command.py28
1 files changed, 8 insertions, 20 deletions
diff --git a/misc/lldb_rb/rb_base_command.py b/misc/lldb_rb/rb_base_command.py
index bf98b67612..70a5addd6d 100644
--- a/misc/lldb_rb/rb_base_command.py
+++ b/misc/lldb_rb/rb_base_command.py
@@ -1,7 +1,9 @@
import lldb
from pydoc import locate
+from lldb_rb.constants import *
+from lldb_rb.utils import *
-class RbBaseCommand:
+class RbBaseCommand(LLDBInterface):
@classmethod
def register_lldb_command(cls, debugger, module_name):
# Add any commands contained in this module to LLDB
@@ -19,8 +21,8 @@ class RbBaseCommand:
imemo_types = target.FindFirstType("enum imemo_type")
- for member in imemo_types.GetEnumMembers():
- g[member.GetName()] = member.GetValueAsUnsigned()
+ #for member in imemo_types.GetEnumMembers():
+ # g[member.GetName()] = member.GetValueAsUnsigned()
for enum in target.FindFirstGlobalVariable("ruby_dummy_gdb_enums"):
enum = enum.GetType()
@@ -34,14 +36,14 @@ class RbBaseCommand:
if name.startswith("RUBY_T_"):
value_types.append(name)
g["value_types"] = value_types
+ return g
def __init__(self, debugger, _internal_dict):
+ self.ruby_globals = RbBaseCommand.lldb_init(debugger)
self.internal_dict = _internal_dict
def __call__(self, debugger, command, exe_ctx, result):
- if not ("RUBY_Qfalse" in globals()):
- RbBaseCommand.lldb_init(debugger)
-
+ self.ruby_globals = RbBaseCommand.lldb_init(debugger)
self.build_environment(debugger)
self.call(debugger, command, exe_ctx, result)
@@ -53,17 +55,3 @@ class RbBaseCommand:
def get_long_help(self):
return self.__class__.help_string
-
- def build_environment(self, debugger):
- self.target = debugger.GetSelectedTarget()
- self.process = self.target.GetProcess()
- self.thread = self.process.GetSelectedThread()
- self.frame = self.thread.GetSelectedFrame()
-
- def _append_command_output(self, debugger, command, result):
- output1 = result.GetOutput()
- debugger.GetCommandInterpreter().HandleCommand(command, result)
- output2 = result.GetOutput()
- result.Clear()
- result.write(output1)
- result.write(output2)