[Lldb-commits] [review request] fix bug that allows users to re-define commands

Jim Ingham jingham at apple.com
Wed Feb 20 15:00:30 PST 2013


I don't think that we want Python script commands to be able to override built-in commands, so "false" seems the right setting for can_replace.  

This code handles adding Python based commands, and that can be done in two ways, either by providing the Python function that implements the command (the second place AddUserCommand gets called in your patch) and by providing a little input editor that takes in commands and wraps them in a function and adds that as the command.  The first place you changed is the "done editing" callback for that way of entering Python commands.

Anyway, this patch looks right to me.

Jim

On Feb 20, 2013, at 2:36 PM, "Malea, Daniel" <daniel.malea at intel.com> wrote:

> Hi,
> 
> I noticed the TestCommandScript.py test case is failing one line 118, where it verifies that a user cannot redefine a command named 'frame'.
> 
> I believe the failure is due to CommandObjectCommands.cpp passing the wrong value (true) for the 'can_replace' parameter to CommandInterpreter::AddUserCommand… When this is set to 'true', which allows the test-case to re-define the 'frame' command to be something else.
> 
> Attached patch should fix it. Any concerns/comments, or can I commit this as-is?
> 
> I'm still not exactly sure how CommandObjectCommands works, and why there's two code paths that end up calling AddUserCommand..so I figured I'd run it by the list first.
> 
> 
> Dan
> 
> 
> <fix_test_command_script.patch>
> 
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits





More information about the lldb-commits mailing list