Sanity check --max-gdbserver-port
authorJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 6 Mar 2019 21:52:19 +0000 (21:52 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 6 Mar 2019 21:52:19 +0000 (21:52 +0000)
commit94b1ff72f57ac38052aa0a44b12904fba04d5bb6
treea667b0172242948cf9676972ba022eb2d87e247e
parent0e4c482124f098957fc13bcfbabc36775dd190ab
Sanity check --max-gdbserver-port

In mail
[lldb-dev] Remote debugging a docker process
https://lists.llvm.org/pipermail/lldb-dev/2019-March/014795.html
user was confused by --min-gdbserver-port and --max-gdbserver-port options
being ignored. I think there is even a bug that --max-gdbserver-port is upper
exclusive limit (and not upper inclusive limit appropriate for max).

At least this patch should catch such mistake by an error message. The question
is whether --max-gdbserver-port should not be changed to really be max and not
max+1 but that would break backward compatibility.

Now the mail example does produce:
error: --min-gdbserver-port (5001) is not lower than --max-gdbserver-port (5001)

Differential Revision: https://reviews.llvm.org/D58962

llvm-svn: 355554
lldb/lit/helper/toolchain.py
lldb/lit/tools/lldb-server/TestGdbserverPort.test [new file with mode: 0644]
lldb/tools/lldb-server/lldb-platform.cpp