1. [clang-format] State where should be run from (details)
  2. [lldb] Error when there are no ports to launch a gdbserver on (details)
Commit b5fbc60e4de45f2b56331281a706b78ff52bd286 by david.spickett
[clang-format] State where should be run from

At least with git, file paths in a diff will be relative
to the repo root. So if you are in "llvm-project/lldb"
and the diff shows "clang/foo" modified you get:
No such file or directory

From, since clang-format was
asked to read:

Add a note to the docs to explain this.

(there is `git diff --relative` but that excludes
changes outside of the current dir)

Reviewed By: sylvestre.ledru

Differential Revision:
The file was modifiedclang/docs/ClangFormat.rst
Commit 98e87f76d0f486122d76b334232102e0d7a9254d by david.spickett
[lldb] Error when there are no ports to launch a gdbserver on

Previously if you did:
$ lldb-server platform --server <...> --min-gdbserver-port 12346
--max-gdbserver-port 12347
(meaning only use port 12346 for gdbservers)

Then tried to launch two gdbservers on the same connection,
the second one would return port 65535. Which is a real port
number but it actually means lldb-server didn't find one it was
allowed to use.

send packet: $qLaunchGDBServer;<...>
read packet: $pid:1919;port:12346;#c0
send packet: $qLaunchGDBServer;<...>
read packet: $pid:1927;port:65535;#c7

This situation should be an error even if port 65535 does happen
to be available on the current machine.

To fix this make PortMap it's own class within

This almost the same as the old typedef but for
GetNextAvailablePort() returning an llvm::Expected.
This means we have to handle not finding a port,
by returning an error packet.

Also add unit tests for this new PortMap class.

Reviewed By: labath

Differential Revision:
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
The file was addedlldb/unittests/Process/gdb-remote/PortMapTest.cpp
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h
The file was modifiedlldb/unittests/Process/gdb-remote/CMakeLists.txt
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
The file was modifiedlldb/tools/lldb-server/lldb-platform.cpp