hanchenye-llvm-project/lldb/docs
Jason Molenda 91ffe0a570 Add a new wart, I mean feature, on to gdb-remote protocol: compression.
For some communication channels, sending large packets can be very 
slow.  In those cases, it may be faster to compress the contents of
the packet on the target device and decompress it on the debug host
system.  For instance, communicating with a device using something
like Bluetooth may be an environment where this tradeoff is a good one.

This patch adds a new field to the response to the "qSupported" packet
(which returns a "qXfer:features:" response) -- SupportedCompressions
and DefaultCompressionMinSize.  These tell you what the remote
stub can support.

lldb, if it wants to enable compression and can handle one of those 
algorithms, it can send a QEnableCompression packet specifying the
algorithm and optionally the minimum packet size to use compression
on.  lldb may have better knowledge about the best tradeoff for
a given communication channel.

I added support to debugserver an lldb to use the zlib APIs
(if -DHAVE_LIBZ=1 is in CFLAGS and -lz is in LDFLAGS) and the
libcompression APIs on Mac OS X 10.11 and later 
(if -DHAVE_LIBCOMPRESSION=1).  libz "zlib-deflate" compression.
libcompression can support deflate, lz4, lzma, and a proprietary
lzfse algorithm.  libcompression has been hand-tuned for Apple
hardware so it should be preferred if available.

debugserver currently only adds the SupportedCompressions when
it is being run on an Apple watch (TARGET_OS_WATCH).  Comment
that #if out from RNBRemote.cpp if you want to enable it to
see how it works.  I haven't tested this on a native system
configuration but surely it will be slower to compress & decompress
the packets in a same-system debug session.

I haven't had a chance to add support for this to 
GDBRemoteCommunciationServer.cpp yet.

<rdar://problem/21090180> 

llvm-svn: 240066
2015-06-18 21:46:06 +00:00
..
testsuite
CMakeLists.txt [cmake/multilib] Teach LLDB to respect the multlib LLVM_LIBDIR_SUFFIX 2014-12-29 12:42:33 +00:00
building-with-debug-llvm.txt
code-signing.txt Fix a typo in code-signing.txt 2015-01-27 23:26:59 +00:00
doxygen.cfg.in Start to share SWIG interface files between languages. 2015-04-24 00:38:53 +00:00
doxygen.footer
doxygen.header
doxygen.intro
lldb-for-gdb-users.txt test commit 2015-04-28 12:34:19 +00:00
lldb-gdb-remote.txt Add a new wart, I mean feature, on to gdb-remote protocol: compression. 2015-06-18 21:46:06 +00:00
lldb.1 Fix lldb(1) man page formatting 2014-11-24 15:01:11 +00:00