Unverified Commit 491c4e21 authored by Andrew Davies's avatar Andrew Davies Committed by GitHub

[frdp] Removes regex check for Isolate search. (#22100)

This will now make it so that the Dart VM class returns any Isolate that
matches the passed Pattern, without checking for any specific strings
like "main()"

This causes the search to skip over Isolates that would have matched.
parent efbd6f60
......@@ -118,14 +118,15 @@ class DartVm {
/// Returns a [List] of [IsolateRef] objects whose name matches `pattern`.
///
/// Also checks to make sure it was launched from the `main()` function.
/// This is not limited to Isolates running Flutter, but to any Isolate on the
/// VM.
Future<List<IsolateRef>> getMainIsolatesByPattern(Pattern pattern) async {
final Map<String, dynamic> jsonVmRef =
await invokeRpc('getVM', timeout: _kRpcTimeout);
final List<IsolateRef> result = <IsolateRef>[];
for (Map<String, dynamic> jsonIsolate in jsonVmRef['isolates']) {
final String name = jsonIsolate['name'];
if (name.contains(pattern) && name.contains(RegExp(r':main\(\)'))) {
if (name.contains(pattern)) {
result.add(IsolateRef._fromJson(jsonIsolate, this));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment