diff options
author | Walter Erquinigo <waltermelon@fb.com> | 2020-03-26 15:33:12 -0700 |
---|---|---|
committer | Walter Erquinigo <waltermelon@fb.com> | 2020-03-27 08:42:58 -0700 |
commit | a515fd01a4f2355291ab424d093e9de4f8acd4dc (patch) | |
tree | d06700ee90ad328cff7654b7d320b7abf07d91fc /llvm/lib/CodeGen/MachineOperand.cpp | |
parent | e9a2caf34c0c65cf65dcd2e63c58390d37732246 (diff) | |
download | llvm-a515fd01a4f2355291ab424d093e9de4f8acd4dc.zip llvm-a515fd01a4f2355291ab424d093e9de4f8acd4dc.tar.gz llvm-a515fd01a4f2355291ab424d093e9de4f8acd4dc.tar.bz2 |
[lldb-vscode] fix breakpoint result ordering
Summary:
The DAP specifies the following for the SetBreakpoints request:
The breakpoints returned are in the same order as the elements of the 'breakpoints' arguments
This was not followed, as lldb-vscode was returning the breakpoints in a different order, because they were first stored into a map, and then traversed. Of course, maps normally don't preserve ordering.
See this log I captured:
-->
{"command":"setBreakpoints",
"arguments":{
"source":{
"name":"main.cpp",
"path":"/Users/wallace/fbsource/xplat/sand/test-projects/buck-cpp/main.cpp"
},
"lines":[6,10,11],
"breakpoints":[{"line":6},{"line":10},{"line":11}],
"sourceModified":false
},
"type":"request",
"seq":3
}
<--
{"body":{
"breakpoints":[
{"id":1, "line":11,"source":{"name":"main.cpp","path":"xplat/sand/test-projects/buck-cpp/main.cpp"},"verified":true},
{"id":2,"line":6,"source":{"name":"main.cpp","path":"xplat/sand/test-projects/buck-cpp/main.cpp"},"verified":true},
{"id":3,"line":10,"source":{"name":"main.cpp","path":"xplat/sand/test-projects/buck-cpp/main.cpp"},"verified":true}]},
"command":"setBreakpoints",
"request_seq":3,
"seq":0,
"success":true,
"type":"response"
}
As you can see, the order was not respected. This was causing the IDE not to be able to disable/enable breakpoints by clicking on them in the breakpoint view in the lower corner of the Debug tab.
This diff fixes the ordering problem. The traversal + querying was done very fast in O(nlogn) time. I'm keeping the same complexity.
I also updated a couple of tests to account for the ordering.
Reviewers: clayborg, aadsm, kusmour, labath
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D76891
Diffstat (limited to 'llvm/lib/CodeGen/MachineOperand.cpp')
0 files changed, 0 insertions, 0 deletions