static const char *g_python_command_instructions =
"Enter your Python command(s). Type 'DONE' to end.\n"
"You must define a Python function with this signature:\n"
- "def my_command_impl(debugger, args, result, internal_dict):\n";
+ "def my_command_impl(debugger, args, exe_ctx, result, internal_dict):\n";
class CommandObjectCommandsAlias : public CommandObjectRaw {
protected:
std::string auto_generated_function_name(GenerateUniqueName(
"lldb_autogen_python_cmd_alias_func", num_created_functions));
- sstr.Printf("def %s (debugger, args, result, internal_dict):",
+ sstr.Printf("def %s (debugger, args, exe_ctx, result, internal_dict):",
auto_generated_function_name.c_str());
if (!GenerateFunction(sstr.GetData(), user_input).Success())
--- /dev/null
+# Test that command script add with no arguments prompts for
+# and generates the modern (exe_ctx) version of the command.
+
+# RUN: %lldb < %s | FileCheck %s
+command script add doit
+print(exe_ctx.target)
+DONE
+doit
+# CHECK: No value