Commit 87d5ae7
authored
## Purpose
Properly implement a subset of match filters for the `qfProcessInfo` and
`qsProcessInfo` packets.
fixes #167
fixes #171
## Overview
* Fix the `Handle_qfProcessInfo` implementation to parse the incoming
string; it was mistakenly using the full argument string `args` instead
of the individual argument string `arg`.
* Decode the hex-encoded process name string to match against in
`Handle_qfProcessInfo`. It was incorrectly not decoded before.
* Fix `PlatformSessionImplBase::updateProcesses` to clear the process
list before enumerating/matching.
* Without this fix, the process list keeps growing with redundant
entries.
* Implement `PlatformSessionImplBase::processMatch` to perform the
actual matching against the values provided with the `qfProcessInfo`
packet. They were previously ignored (and noted in a TODO).
* When matching against the process name, try matching against both the
process name in the `ProcessInfo` structure and the base thread name for
the process.
* This matching is necessary on Linux and Android because the process
name is the fully qualified path name to the executable, but the match
name is just the base name (e.g. "/home/user/a.out" vs "a.out") which
matches the primary thread name.
* This change was the most targeted fix that didn't disrupt other
behavior and break other test cases that rely on `ProcessInfo.name`
being the fully qualified executable file name.
* Add TODOs for the remaining missing functionality. The test coverage
on this code path appears to be incomplete.
* Enable the
`TestProcessAttach.ProcessAttachTestCase.test_attach_to_process_by_name`
test case on Linux and Android.
## Background
The `qfProcessInfo` and `qsProcessInfo` packets are and LLDB platform
extension and are used together to enumerate processes on the target.
They are documented
[here](https://lldb.llvm.org/resources/lldbgdbremote.html#qfprocessinfo-qsprocessinfo-platform-extension).
## Validation
Ranually run the `test_attach_to_process_by_name` test case on Android
and Linux to confirm it passes.
1 parent 2e7f67a commit 87d5ae7
File tree
6 files changed
+69
-9
lines changed- Headers/DebugServer2/GDBRemote
- Sources/GDBRemote
- Support/Testing/Excluded/ds2
6 files changed
+69
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
| 146 | + | |
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
150 | 209 | | |
151 | 210 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2495 | 2495 | | |
2496 | 2496 | | |
2497 | 2497 | | |
2498 | | - | |
| 2498 | + | |
2499 | 2499 | | |
2500 | 2500 | | |
2501 | 2501 | | |
2502 | | - | |
2503 | | - | |
| 2502 | + | |
| 2503 | + | |
2504 | 2504 | | |
2505 | 2505 | | |
2506 | | - | |
| 2506 | + | |
2507 | 2507 | | |
2508 | 2508 | | |
2509 | 2509 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | 111 | | |
113 | 112 | | |
114 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
173 | 172 | | |
174 | 173 | | |
175 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
168 | 167 | | |
169 | 168 | | |
170 | 169 | | |
| |||
0 commit comments