llvm-project/lldb
Greg Clayton ffb2d44ab9 Reduced packet counts to the remote GDB server where possible.
We have been working on reducing the packet count that is sent between LLDB and the debugserver on MacOSX and iOS. Our approach to this was to reduce the packets required when debugging multiple threads. We currently make one qThreadStopInfoXXXX call (where XXXX is the thread ID in hex) per thread except the thread that stopped with a stop reply packet. In order to implement multiple thread infos in a single reply, we need to use structured data, which means JSON. The new jThreadsInfo packet will attempt to retrieve all thread infos in a single packet. The data is very similar to the stop reply packets, but packaged in JSON and uses JSON arrays where applicable. The JSON output looks like:


[
  { "tid":1580681,
    "metype":6,
    "medata":[2,0],
    "reason":"exception",
    "qaddr":140735118423168,
    "registers": {
      "0":"8000000000000000",
      "1":"0000000000000000",
      "2":"20fabf5fff7f0000",
      "3":"e8f8bf5fff7f0000",
      "4":"0100000000000000",
      "5":"d8f8bf5fff7f0000",
      "6":"b0f8bf5fff7f0000",
      "7":"20f4bf5fff7f0000",
      "8":"8000000000000000",
      "9":"61a8db78a61500db",
      "10":"3200000000000000",
      "11":"4602000000000000",
      "12":"0000000000000000",
      "13":"0000000000000000",
      "14":"0000000000000000",
      "15":"0000000000000000",
      "16":"960b000001000000",
      "17":"0202000000000000",
      "18":"2b00000000000000",
      "19":"0000000000000000",
      "20":"0000000000000000"},
    "memory":[
      {"address":140734799804592,"bytes":"c8f8bf5fff7f0000c9a59e8cff7f0000"},
      {"address":140734799804616,"bytes":"00000000000000000100000000000000"}
    ]
  }
]

It contains an array of dicitionaries with all of the key value pairs that are normally in the stop reply packet. Including the expedited registers. Notice that is also contains expedited memory in the "memory" key. Any values in this memory will get included in a new L1 cache in lldb_private::Process where if a memory read request is made and that memory request fits into one of the L1 memory cache blocks, it will use that memory data. If a memory request fails in the L1 cache, it will fall back to the L2 cache which is the same block sized caching we were using before these changes. This allows a process to expedite memory that you are likely to use and it reduces packet count. On MacOSX with debugserver, we expedite the frame pointer backchain for a thread (up to 256 entries) by reading 2 pointers worth of bytes at the frame pointer (for the previous FP and PC), and follow the backchain. Most backtraces on MacOSX and iOS now don't require us to read any memory!

We will try these packets out and if successful, we should port these to lldb-server in the near future. 

<rdar://problem/21494354>

llvm-svn: 240354
2015-06-22 23:12:45 +00:00
..
cmake [LLDB][MIPS] ABI Plugin for MIPS64 2015-06-19 04:25:07 +00:00
docs Add a new wart, I mean feature, on to gdb-remote protocol: compression. 2015-06-18 21:46:06 +00:00
examples Fix a variety of typos. 2015-06-18 05:27:05 +00:00
include Reduced packet counts to the remote GDB server where possible. 2015-06-22 23:12:45 +00:00
lib [LLDB][MIPS] ABI Plugin for MIPS64 2015-06-19 04:25:07 +00:00
lit Create a check-lldb-unit target to run unit tests. 2015-03-13 20:55:07 +00:00
lldb.xcodeproj Fix the MacOSX build to include the Mips64 ABI plug-in. 2015-06-19 20:08:36 +00:00
lldb.xcworkspace Working on getting the OSX build green 2015-05-12 02:20:27 +00:00
resources Bump major vers # in xcode project file from 330 to 340. 2015-03-06 00:45:01 +00:00
scripts Fix a variety of typos. 2015-06-18 05:27:05 +00:00
source Reduced packet counts to the remote GDB server where possible. 2015-06-22 23:12:45 +00:00
test Adding some more flakey tests to the XFAIL list 2015-06-22 20:54:14 +00:00
tools Reduced packet counts to the remote GDB server where possible. 2015-06-22 23:12:45 +00:00
unittests Including <thread> with MSVC is buggy, use a workaround here. 2015-05-28 19:56:43 +00:00
utils LUI: Fix some issues causing crashes in the source view 2013-10-23 01:18:21 +00:00
www Fix a variety of typos. 2015-06-18 05:27:05 +00:00
.arcconfig Update .arcconfig to point to reviews.llvm.org 2014-05-20 21:24:59 +00:00
.clang-format Update build instructions / coding conventions. 2015-03-10 23:22:25 +00:00
.gitignore Fix .gitignore to ignore symlinks. 2015-03-31 00:03:00 +00:00
CMakeLists.txt Use the debugginess of the python interpreter when symlinking _lldb.pyd. 2015-04-22 22:53:18 +00:00
CODE_OWNERS.txt Convert CRLF to LF in CODE_OWNERS.txt 2015-03-23 14:00:54 +00:00
INSTALL.txt Revert "git-svn test commit" 2014-11-18 22:45:59 +00:00
LICENSE.TXT
Makefile Remove the -Wno-unused-function option. We are clean 2014-09-09 07:49:15 +00:00