aboutsummaryrefslogtreecommitdiff
path: root/include/lldb/Interpreter/CommandObject.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/lldb/Interpreter/CommandObject.h')
-rw-r--r--include/lldb/Interpreter/CommandObject.h33
1 files changed, 23 insertions, 10 deletions
diff --git a/include/lldb/Interpreter/CommandObject.h b/include/lldb/Interpreter/CommandObject.h
index 8544fd9f9c3f..7bdf55a393d7 100644
--- a/include/lldb/Interpreter/CommandObject.h
+++ b/include/lldb/Interpreter/CommandObject.h
@@ -269,7 +269,7 @@ public:
//
// Ensures a valid register context (from the selected frame if there
// is a frame in m_exe_ctx, or from the selected thread from m_exe_ctx)
- // is availble from m_exe_ctx prior to executing the command. If a
+ // is available from m_exe_ctx prior to executing the command. If a
// target doesn't exist or is invalid, the command will fail and
// CommandObject::GetInvalidRegContextDescription() will be returned as
// the error. CommandObject subclasses can override the virtual function
@@ -460,25 +460,37 @@ public:
return NULL;
}
- CommandOverrideCallback
- GetOverrideCallback () const
+ bool
+ HasOverrideCallback () const
{
- return m_command_override_callback;
+ return m_command_override_callback || m_deprecated_command_override_callback;
}
- void *
- GetOverrideCallbackBaton () const
+ void
+ SetOverrideCallback (lldb::CommandOverrideCallback callback, void *baton)
{
- return m_command_override_baton;
+ m_deprecated_command_override_callback = callback;
+ m_command_override_baton = baton;
}
-
+
void
- SetOverrideCallback (CommandOverrideCallback callback, void *baton)
+ SetOverrideCallback (lldb::CommandOverrideCallbackWithResult callback, void *baton)
{
m_command_override_callback = callback;
m_command_override_baton = baton;
}
+ bool
+ InvokeOverrideCallback (const char **argv, CommandReturnObject &result)
+ {
+ if (m_command_override_callback)
+ return m_command_override_callback(m_command_override_baton, argv, result);
+ else if (m_deprecated_command_override_callback)
+ return m_deprecated_command_override_callback(m_command_override_baton, argv);
+ else
+ return false;
+ }
+
virtual bool
Execute (const char *args_string, CommandReturnObject &result) = 0;
@@ -540,7 +552,8 @@ protected:
bool m_is_alias;
Flags m_flags;
std::vector<CommandArgumentEntry> m_arguments;
- CommandOverrideCallback m_command_override_callback;
+ lldb::CommandOverrideCallback m_deprecated_command_override_callback;
+ lldb::CommandOverrideCallbackWithResult m_command_override_callback;
void * m_command_override_baton;
// Helper function to populate IDs or ID ranges as the command argument data