Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
39ebae2b
Unverified
Commit
39ebae2b
authored
Apr 04, 2019
by
Zachary Anderson
Committed by
GitHub
Apr 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fuchsia] Fix isolate filter (#30458)
parent
9fe6be8a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
24 deletions
+7
-24
dart_vm.dart
...s/fuchsia_remote_debug_protocol/lib/src/dart/dart_vm.dart
+3
-9
fuchsia_remote_connection.dart
...ote_debug_protocol/lib/src/fuchsia_remote_connection.dart
+1
-8
dart_vm_test.dart
...sia_remote_debug_protocol/test/src/dart/dart_vm_test.dart
+3
-7
No files found.
packages/fuchsia_remote_debug_protocol/lib/src/dart/dart_vm.dart
View file @
39ebae2b
...
@@ -128,24 +128,18 @@ class DartVm {
...
@@ -128,24 +128,18 @@ class DartVm {
/// Returns a [List] of [IsolateRef] objects whose name matches `pattern`.
/// Returns a [List] of [IsolateRef] objects whose name matches `pattern`.
///
///
/// This is not limited to Isolates running Flutter, but to any Isolate on the
/// This is not limited to Isolates running Flutter, but to any Isolate on the
/// VM.
/// VM. Therefore, the [pattern] argument should be written to exclude
///
/// matching unintended isolates.
/// `includeNonFlutterIsolates` makes sure to add non-flutter Dart isolates,
/// and defaults to `false`.
Future
<
List
<
IsolateRef
>>
getMainIsolatesByPattern
(
Future
<
List
<
IsolateRef
>>
getMainIsolatesByPattern
(
Pattern
pattern
,
{
Pattern
pattern
,
{
Duration
timeout
=
_kRpcTimeout
,
Duration
timeout
=
_kRpcTimeout
,
bool
includeNonFlutterIsolates
=
false
,
})
async
{
})
async
{
final
Map
<
String
,
dynamic
>
jsonVmRef
=
final
Map
<
String
,
dynamic
>
jsonVmRef
=
await
invokeRpc
(
'getVM'
,
timeout:
timeout
);
await
invokeRpc
(
'getVM'
,
timeout:
timeout
);
final
List
<
IsolateRef
>
result
=
<
IsolateRef
>[];
final
List
<
IsolateRef
>
result
=
<
IsolateRef
>[];
for
(
Map
<
String
,
dynamic
>
jsonIsolate
in
jsonVmRef
[
'isolates'
])
{
for
(
Map
<
String
,
dynamic
>
jsonIsolate
in
jsonVmRef
[
'isolates'
])
{
final
String
name
=
jsonIsolate
[
'name'
];
final
String
name
=
jsonIsolate
[
'name'
];
// `:main()` is included at the end of a flutter isolate, whereas the
if
(
pattern
.
matchAsPrefix
(
name
)
!=
null
)
{
// name of a dart Isolate is concluded as if the name were a function.
if
(
name
.
contains
(
pattern
)
&&
(
includeNonFlutterIsolates
||
name
.
contains
(
RegExp
(
r':main\(\)'
))))
{
_log
.
fine
(
'Found Isolate matching "
$pattern
": "
$name
"'
);
_log
.
fine
(
'Found Isolate matching "
$pattern
": "
$name
"'
);
result
.
add
(
IsolateRef
.
_fromJson
(
jsonIsolate
,
this
));
result
.
add
(
IsolateRef
.
_fromJson
(
jsonIsolate
,
this
));
}
}
...
...
packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart
View file @
39ebae2b
...
@@ -289,14 +289,10 @@ class FuchsiaRemoteConnection {
...
@@ -289,14 +289,10 @@ class FuchsiaRemoteConnection {
/// If there are no live Dart VM's or the Isolate cannot be found, waits until
/// If there are no live Dart VM's or the Isolate cannot be found, waits until
/// either `timeout` is reached, or a Dart VM starts up with a name that
/// either `timeout` is reached, or a Dart VM starts up with a name that
/// matches `pattern`.
/// matches `pattern`.
///
/// `includeNonFlutterIsolates` can be set to true to include all isolates
/// found instead of just Flutter Isolates.
Future
<
List
<
IsolateRef
>>
getMainIsolatesByPattern
(
Future
<
List
<
IsolateRef
>>
getMainIsolatesByPattern
(
Pattern
pattern
,
{
Pattern
pattern
,
{
Duration
timeout
=
_kIsolateFindTimeout
,
Duration
timeout
=
_kIsolateFindTimeout
,
Duration
vmConnectionTimeout
=
_kDartVmConnectionTimeout
,
Duration
vmConnectionTimeout
=
_kDartVmConnectionTimeout
,
bool
includeNonFlutterIsolates
=
false
,
})
async
{
})
async
{
// If for some reason there are no Dart VM's that are alive, wait for one to
// If for some reason there are no Dart VM's that are alive, wait for one to
// start with the Isolate in question.
// start with the Isolate in question.
...
@@ -315,10 +311,7 @@ class FuchsiaRemoteConnection {
...
@@ -315,10 +311,7 @@ class FuchsiaRemoteConnection {
if
(
vmService
==
null
)
{
if
(
vmService
==
null
)
{
continue
;
continue
;
}
}
isolates
.
add
(
vmService
.
getMainIsolatesByPattern
(
isolates
.
add
(
vmService
.
getMainIsolatesByPattern
(
pattern
));
pattern
,
includeNonFlutterIsolates:
includeNonFlutterIsolates
,
));
}
}
final
List
<
IsolateRef
>
result
=
final
List
<
IsolateRef
>
result
=
await
Future
.
wait
<
List
<
IsolateRef
>>(
isolates
)
await
Future
.
wait
<
List
<
IsolateRef
>>(
isolates
)
...
...
packages/fuchsia_remote_debug_protocol/test/src/dart/dart_vm_test.dart
View file @
39ebae2b
...
@@ -241,7 +241,7 @@ void main() {
...
@@ -241,7 +241,7 @@ void main() {
'type'
:
'@Isolate'
,
'type'
:
'@Isolate'
,
'fixedId'
:
'true'
,
'fixedId'
:
'true'
,
'id'
:
'isolates/3'
,
'id'
:
'isolates/3'
,
'name'
:
'f
ile://flutterBinary2:main()
'
,
'name'
:
'f
lutterBinary.cmx
'
,
'number'
:
'3'
,
'number'
:
'3'
,
},
},
<
String
,
dynamic
>{
<
String
,
dynamic
>{
...
@@ -268,13 +268,9 @@ void main() {
...
@@ -268,13 +268,9 @@ void main() {
await
DartVm
.
connect
(
Uri
.
parse
(
'http://whatever.com/ws'
));
await
DartVm
.
connect
(
Uri
.
parse
(
'http://whatever.com/ws'
));
expect
(
vm
,
isNot
(
null
));
expect
(
vm
,
isNot
(
null
));
final
List
<
IsolateRef
>
matchingFlutterIsolates
=
final
List
<
IsolateRef
>
matchingFlutterIsolates
=
await
vm
.
getMainIsolatesByPattern
(
'flutterBinary'
);
await
vm
.
getMainIsolatesByPattern
(
'flutterBinary
.cmx
'
);
expect
(
matchingFlutterIsolates
.
length
,
1
);
expect
(
matchingFlutterIsolates
.
length
,
1
);
final
List
<
IsolateRef
>
allFlutterIsolates
=
final
List
<
IsolateRef
>
allIsolates
=
await
vm
.
getMainIsolatesByPattern
(
''
);
await
vm
.
getMainIsolatesByPattern
(
''
);
expect
(
allFlutterIsolates
.
length
,
2
);
final
List
<
IsolateRef
>
allIsolates
=
await
vm
.
getMainIsolatesByPattern
(
''
,
includeNonFlutterIsolates:
true
);
expect
(
allIsolates
.
length
,
4
);
expect
(
allIsolates
.
length
,
4
);
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment