aboutsummaryrefslogtreecommitdiff
path: root/source/Host
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-10-11 10:56:54 +0000
committerPavel Labath <pavel@labath.sk>2019-10-11 10:56:54 +0000
commitb82b009949beb47ef60552dc42e033a62d843a8c (patch)
treec0cd70d78b38b5fe1c63c9607019e5ae7206ed3b /source/Host
parent3535a53da52895e42f738ef7bc08cc27dc1a0cee (diff)
downloadlldb-b82b009949beb47ef60552dc42e033a62d843a8c.tar.gz
ProcessInstanceInfoMatch: Don't match processes with no name if a name match was requested, take 2
Summary: The previous attempt at making nameless process not match when searching for a given name failed because the macos implementation was depending on this detail in its partial matching strategy. Doing partial matching to avoid expensive lookups is a perfectly valid thing to do, the way it was implemented seems somewhat unexpected. This patch implements it differently by providing special methods in the ProcessInstanceInfoMatch which match only a subset of fields, and changes mac host code to use those instead. Then, it re-applies r373925 to get make the ProcessInstanceInfoMatch with a name *not* match a nameless process. Reviewers: JDevlieghere, teemperor, jingham Subscribers: wallace, lldb-commits Differential Revision: https://reviews.llvm.org/D68631 git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@374529 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'source/Host')
-rw-r--r--source/Host/macosx/objcxx/Host.mm18
1 files changed, 10 insertions, 8 deletions
diff --git a/source/Host/macosx/objcxx/Host.mm b/source/Host/macosx/objcxx/Host.mm
index 742c38fd0..fe31830b9 100644
--- a/source/Host/macosx/objcxx/Host.mm
+++ b/source/Host/macosx/objcxx/Host.mm
@@ -677,14 +677,16 @@ uint32_t Host::FindProcesses(const ProcessInstanceInfoMatch &match_info,
process_info.SetEffectiveGroupID(UINT32_MAX);
// Make sure our info matches before we go fetch the name and cpu type
- if (match_info.Matches(process_info)) {
- // Get CPU type first so we can know to look for iOS simulator is we have
- // x86 or x86_64
- if (GetMacOSXProcessCPUType(process_info)) {
- if (GetMacOSXProcessArgs(&match_info, process_info)) {
- if (match_info.Matches(process_info))
- process_infos.Append(process_info);
- }
+ if (!match_info.UserIDsMatch(process_info) ||
+ !match_info.ProcessIDsMatch(process_info))
+ continue;
+
+ // Get CPU type first so we can know to look for iOS simulator is we have
+ // x86 or x86_64
+ if (GetMacOSXProcessCPUType(process_info)) {
+ if (GetMacOSXProcessArgs(&match_info, process_info)) {
+ if (match_info.Matches(process_info))
+ process_infos.Append(process_info);
}
}
}