[Lldb-commits] [PATCH] D17099: Add reverse-connect functionality to the gdb-remote command
Francis Ricci via lldb-commits
lldb-commits at lists.llvm.org
Fri Feb 12 08:04:23 PST 2016
fjricci updated this revision to Diff 47806.
fjricci added a comment.
Remove unnecessary special-case logic for reverse connecting
http://reviews.llvm.org/D17099
Files:
source/Interpreter/CommandInterpreter.cpp
Index: source/Interpreter/CommandInterpreter.cpp
===================================================================
--- source/Interpreter/CommandInterpreter.cpp
+++ source/Interpreter/CommandInterpreter.cpp
@@ -624,18 +624,21 @@
}
}
- std::unique_ptr<CommandObjectRegexCommand>
- connect_gdb_remote_cmd_ap(new CommandObjectRegexCommand (*this,
- "gdb-remote",
- "Connect to a remote GDB server. If no hostname is provided, localhost is assumed.",
- "gdb-remote [<hostname>:]<portnum>",
- 2,
- 0,
- false));
+ std::unique_ptr<CommandObjectRegexCommand> connect_gdb_remote_cmd_ap(
+ new CommandObjectRegexCommand(*this, "gdb-remote", "Connect to a remote GDB server. If no "
+ "hostname is provided, localhost is assumed.",
+ "gdb-remote [<hostname>:]<portnum> [reverse]", 2, 0, false));
if (connect_gdb_remote_cmd_ap.get())
{
- if (connect_gdb_remote_cmd_ap->AddRegexCommand("^([^:]+:[[:digit:]]+)$", "process connect --plugin gdb-remote connect://%1") &&
- connect_gdb_remote_cmd_ap->AddRegexCommand("^([[:digit:]]+)$", "process connect --plugin gdb-remote connect://localhost:%1"))
+ if (connect_gdb_remote_cmd_ap->AddRegexCommand("^([^:]+:[[:digit:]]+)$",
+ "process connect --plugin gdb-remote connect://%1") &&
+ connect_gdb_remote_cmd_ap->AddRegexCommand("^([[:digit:]]+)$",
+ "process connect --plugin gdb-remote connect://localhost:%1") &&
+ connect_gdb_remote_cmd_ap->AddRegexCommand("^([^:]+:[[:digit:]]+) reverse$",
+ "process connect --plugin gdb-remote listen://%1") &&
+ connect_gdb_remote_cmd_ap->AddRegexCommand("^([[:digit:]]+) reverse$",
+ "process connect --plugin gdb-remote "
+ "listen://localhost:%1"))
{
CommandObjectSP command_sp(connect_gdb_remote_cmd_ap.release());
m_command_dict[command_sp->GetCommandName ()] = command_sp;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17099.47806.patch
Type: text/x-patch
Size: 2615 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160212/5478fee1/attachment.bin>
More information about the lldb-commits
mailing list