[Lldb-commits] [PATCH] D58962: Sanity check --max-gdbserver-port
Jan Kratochvil via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Mar 6 13:53:23 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB355554: Sanity check --max-gdbserver-port (authored by jankratochvil, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D58962?vs=189338&id=189584#toc
Repository:
rLLDB LLDB
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58962/new/
https://reviews.llvm.org/D58962
Files:
lit/helper/toolchain.py
lit/tools/lldb-server/TestGdbserverPort.test
tools/lldb-server/lldb-platform.cpp
Index: tools/lldb-server/lldb-platform.cpp
===================================================================
--- tools/lldb-server/lldb-platform.cpp
+++ tools/lldb-server/lldb-platform.cpp
@@ -241,11 +241,11 @@
return -1;
// Make a port map for a port range that was specified.
- if (min_gdbserver_port < max_gdbserver_port) {
+ if (min_gdbserver_port && min_gdbserver_port < max_gdbserver_port) {
for (uint16_t port = min_gdbserver_port; port < max_gdbserver_port; ++port)
gdbserver_portmap[port] = LLDB_INVALID_PROCESS_ID;
- } else if (min_gdbserver_port != max_gdbserver_port) {
- fprintf(stderr, "error: --min-gdbserver-port (%u) is greater than "
+ } else if (min_gdbserver_port || max_gdbserver_port) {
+ fprintf(stderr, "error: --min-gdbserver-port (%u) is not lower than "
"--max-gdbserver-port (%u)\n",
min_gdbserver_port, max_gdbserver_port);
option_error = 3;
Index: lit/tools/lldb-server/TestGdbserverPort.test
===================================================================
--- lit/tools/lldb-server/TestGdbserverPort.test
+++ lit/tools/lldb-server/TestGdbserverPort.test
@@ -0,0 +1,2 @@
+# RUN: %platformserver p --server --listen :1234 --min-gdbserver-port 1234 --max-gdbserver-port 1234 2>&1 | FileCheck %s
+# CHECK: error: --min-gdbserver-port (1234) is not lower than --max-gdbserver-port (1234)
Index: lit/helper/toolchain.py
===================================================================
--- lit/helper/toolchain.py
+++ lit/helper/toolchain.py
@@ -45,6 +45,10 @@
command=FindTool(dsname),
extra_args=dsargs,
unresolved='ignore'),
+ ToolSubst('%platformserver',
+ command=FindTool('lldb-server'),
+ extra_args=['platform'],
+ unresolved='ignore'),
'lldb-test',
'lldb-instr',
ToolSubst('%build',
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58962.189584.patch
Type: text/x-patch
Size: 1938 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190306/a5d09e16/attachment.bin>
More information about the lldb-commits
mailing list