From 3cb4c7d6a0efbcbc87e1603b3b6edcdded1e11d0 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Sat, 15 Dec 2012 01:19:07 +0000 Subject: [PATCH] _regexp_attach doesn't handle the case where no arguments are provided. It now also handles the case you were you pass options. llvm-svn: 170262 --- lldb/source/Interpreter/CommandInterpreter.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 339a3c5..9f1c6cc 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -455,8 +455,10 @@ CommandInterpreter::LoadCommandDictionary () "_regexp-attach []\n_regexp-attach []", 2)); if (attach_regex_cmd_ap.get()) { - if (attach_regex_cmd_ap->AddRegexCommand("^([0-9]+)$", "process attach --pid %1") && - attach_regex_cmd_ap->AddRegexCommand("^(.*[^[:space:]])[[:space:]]*$", "process attach --name '%1'")) + if (attach_regex_cmd_ap->AddRegexCommand("^([0-9]+)[[:space:]]*$", "process attach --pid %1") && + attach_regex_cmd_ap->AddRegexCommand("^(-.*|.* -.*)$", "process attach %1") && // Any options that are specified get passed to 'process attach' + attach_regex_cmd_ap->AddRegexCommand("^(.+)$", "process attach --name '%1'") && + attach_regex_cmd_ap->AddRegexCommand("^$", "process attach")) { CommandObjectSP attach_regex_cmd_sp(attach_regex_cmd_ap.release()); m_command_dict[attach_regex_cmd_sp->GetCommandName ()] = attach_regex_cmd_sp; -- 2.7.4