diff options
author | Johnny Chen <johnny.chen@apple.com> | 2011-09-21 01:00:02 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2011-09-21 01:00:02 +0000 |
commit | 184d7a727e247b899fdc210e83792e94edd9c16a (patch) | |
tree | dd42776917664b08d35d2169901801b7ef62738a /lldb/source/Commands/CommandObjectBreakpoint.cpp | |
parent | f16d2447e1685d97d1ce97136408c86d5259fecb (diff) | |
download | bcm5719-llvm-184d7a727e247b899fdc210e83792e94edd9c16a.tar.gz bcm5719-llvm-184d7a727e247b899fdc210e83792e94edd9c16a.zip |
A little refactoring of the way to add break IDs or ID ranges as command argument data
to the command argument entry. Add a static helper function:
CommandObject::AddIDsArgumentData(CommandArgumentEntry &arg)
to be used from CommandObjectBreakpoint.cpp. The helper function could also be useful
for commands in the future to manipulate watchpoints.
llvm-svn: 140221
Diffstat (limited to 'lldb/source/Commands/CommandObjectBreakpoint.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpoint.cpp | 68 |
1 files changed, 4 insertions, 64 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index 2b9643ebe3d..5c96a7f6d92 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -826,22 +826,7 @@ CommandObjectBreakpointEnable::CommandObjectBreakpointEnable (CommandInterpreter NULL) { CommandArgumentEntry arg; - CommandArgumentData bp_id_arg; - CommandArgumentData bp_id_range_arg; - - // Create the first variant for the first (and only) argument for this command. - bp_id_arg.arg_type = eArgTypeBreakpointID; - bp_id_arg.arg_repetition = eArgRepeatOptional; - - // Create the second variant for the first (and only) argument for this command. - bp_id_range_arg.arg_type = eArgTypeBreakpointIDRange; - bp_id_range_arg.arg_repetition = eArgRepeatOptional; - - // The first (and only) argument for this command could be either a bp_id or a bp_id_range. - // Push both variants into the entry for the first argument for this command. - arg.push_back (bp_id_arg); - arg.push_back (bp_id_range_arg); - + CommandObject::AddIDsArgumentData(arg); // Add the entry for the first argument for this command to the object's arguments vector. m_arguments.push_back (arg); } @@ -942,22 +927,7 @@ CommandObjectBreakpointDisable::CommandObjectBreakpointDisable (CommandInterpret NULL) { CommandArgumentEntry arg; - CommandArgumentData bp_id_arg; - CommandArgumentData bp_id_range_arg; - - // Create the first variant for the first (and only) argument for this command. - bp_id_arg.arg_type = eArgTypeBreakpointID; - bp_id_arg.arg_repetition = eArgRepeatOptional; - - // Create the second variant for the first (and only) argument for this command. - bp_id_range_arg.arg_type = eArgTypeBreakpointIDRange; - bp_id_range_arg.arg_repetition = eArgRepeatOptional; - - // The first (and only) argument for this command could be either a bp_id or a bp_id_range. - // Push both variants into the entry for the first argument for this command. - arg.push_back (bp_id_arg); - arg.push_back (bp_id_range_arg); - + CommandObject::AddIDsArgumentData(arg); // Add the entry for the first argument for this command to the object's arguments vector. m_arguments.push_back (arg); } @@ -1238,22 +1208,7 @@ CommandObjectBreakpointDelete::CommandObjectBreakpointDelete(CommandInterpreter NULL) { CommandArgumentEntry arg; - CommandArgumentData bp_id_arg; - CommandArgumentData bp_id_range_arg; - - // Create the first variant for the first (and only) argument for this command. - bp_id_arg.arg_type = eArgTypeBreakpointID; - bp_id_arg.arg_repetition = eArgRepeatOptional; - - // Create the second variant for the first (and only) argument for this command. - bp_id_range_arg.arg_type = eArgTypeBreakpointIDRange; - bp_id_range_arg.arg_repetition = eArgRepeatOptional; - - // The first (and only) argument for this command could be either a bp_id or a bp_id_range. - // Push both variants into the entry for the first argument for this command. - arg.push_back (bp_id_arg); - arg.push_back (bp_id_range_arg); - + CommandObject::AddIDsArgumentData(arg); // Add the entry for the first argument for this command to the object's arguments vector. m_arguments.push_back (arg); } @@ -1513,22 +1468,7 @@ CommandObjectBreakpointModify::CommandObjectBreakpointModify (CommandInterpreter m_options (interpreter) { CommandArgumentEntry arg; - CommandArgumentData bp_id_arg; - CommandArgumentData bp_id_range_arg; - - // Create the first variant for the first (and only) argument for this command. - bp_id_arg.arg_type = eArgTypeBreakpointID; - bp_id_arg.arg_repetition = eArgRepeatPlain; - - // Create the second variant for the first (and only) argument for this command. - bp_id_range_arg.arg_type = eArgTypeBreakpointIDRange; - bp_id_range_arg.arg_repetition = eArgRepeatPlain; - - // The first (and only) argument for this command could be either a bp_id or a bp_id_range. - // Push both variants into the entry for the first argument for this command. - arg.push_back (bp_id_arg); - arg.push_back (bp_id_range_arg); - + CommandObject::AddIDsArgumentData(arg); // Add the entry for the first argument for this command to the object's arguments vector. m_arguments.push_back (arg); } |