@@ -28,7 +28,7 @@ export 'snapshot_graph.dart'
2828 HeapSnapshotObjectNoData,
2929 HeapSnapshotObjectNullData;
3030
31- const String vmServiceVersion = '3.41 .0' ;
31+ const String vmServiceVersion = '3.42 .0' ;
3232
3333/// @optional
3434const String optional = 'optional' ;
@@ -733,14 +733,20 @@ abstract class VmServiceInterface {
733733 /// The `getStack` RPC is used to retrieve the current execution stack and
734734 /// message queue for an isolate. The isolate does not need to be paused.
735735 ///
736+ /// If `limit` is provided, up to `limit` frames from the top of the stack
737+ /// will be returned. If the stack depth is smaller than `limit` the entire
738+ /// stack is returned. Note: this limit also applies to the
739+ /// `asyncCausalFrames` and `awaiterFrames` stack representations in the
740+ /// `Stack` response.
741+ ///
736742 /// If `isolateId` refers to an isolate which has exited, then the `Collected`
737743 /// [Sentinel] is returned.
738744 ///
739745 /// See [Stack] .
740746 ///
741747 /// This method will throw a [SentinelException] in the case a [Sentinel] is
742748 /// returned.
743- Future <Stack > getStack (String isolateId);
749+ Future <Stack > getStack (String isolateId, { int limit} );
744750
745751 /// The `getSupportedProtocols` RPC is used to determine which protocols are
746752 /// supported by the current server.
@@ -1344,6 +1350,7 @@ class VmServerConnection {
13441350 case 'getStack' :
13451351 response = await _serviceImplementation.getStack (
13461352 params['isolateId' ],
1353+ limit: params['limit' ],
13471354 );
13481355 break ;
13491356 case 'getSupportedProtocols' :
@@ -1798,8 +1805,10 @@ class VmService implements VmServiceInterface {
17981805 _call ('getProcessMemoryUsage' );
17991806
18001807 @override
1801- Future <Stack > getStack (String isolateId) =>
1802- _call ('getStack' , {'isolateId' : isolateId});
1808+ Future <Stack > getStack (String isolateId, {int limit}) => _call ('getStack' , {
1809+ 'isolateId' : isolateId,
1810+ if (limit != null ) 'limit' : limit,
1811+ });
18031812
18041813 @override
18051814 Future <ProtocolList > getSupportedProtocols () =>
@@ -6664,23 +6673,40 @@ class SourceReportRange {
66646673 'compiled: ${compiled }]' ;
66656674}
66666675
6676+ /// The `Stack` class represents the various components of a Dart stack trace
6677+ /// for a given isolate.
6678+ ///
6679+ /// See [getStack] .
66676680class Stack extends Response {
66686681 static Stack parse (Map <String , dynamic > json) =>
66696682 json == null ? null : Stack ._fromJson (json);
66706683
6684+ /// A list of frames that make up the synchronous stack, rooted at the message
6685+ /// loop (i.e., the frames since the last asynchronous gap or the isolate's
6686+ /// entrypoint).
66716687 List <Frame > frames;
66726688
6689+ /// A list of frames representing the asynchronous path. Comparable to
6690+ /// `awaiterFrames` , if provided, although some frames may be different.
66736691 @optional
66746692 List <Frame > asyncCausalFrames;
66756693
6694+ /// A list of frames representing the asynchronous path. Comparable to
6695+ /// `asyncCausalFrames` , if provided, although some frames may be different.
66766696 @optional
66776697 List <Frame > awaiterFrames;
66786698
6699+ /// A list of messages in the isolate's message queue.
66796700 List <Message > messages;
66806701
6702+ /// Specifies whether or not this stack is complete or has been artificially
6703+ /// truncated.
6704+ bool truncated;
6705+
66816706 Stack ({
66826707 @required this .frames,
66836708 @required this .messages,
6709+ @required this .truncated,
66846710 this .asyncCausalFrames,
66856711 this .awaiterFrames,
66866712 });
@@ -6698,6 +6724,7 @@ class Stack extends Response {
66986724 createServiceObject (json['awaiterFrames' ], const ['Frame' ]));
66996725 messages = List <Message >.from (
67006726 createServiceObject (json['messages' ], const ['Message' ]) ?? []);
6727+ truncated = json['truncated' ];
67016728 }
67026729
67036730 @override
@@ -6707,6 +6734,7 @@ class Stack extends Response {
67076734 json.addAll ({
67086735 'frames' : frames.map ((f) => f.toJson ()).toList (),
67096736 'messages' : messages.map ((f) => f.toJson ()).toList (),
6737+ 'truncated' : truncated,
67106738 });
67116739 _setIfNotNull (json, 'asyncCausalFrames' ,
67126740 asyncCausalFrames? .map ((f) => f? .toJson ())? .toList ());
@@ -6715,8 +6743,9 @@ class Stack extends Response {
67156743 return json;
67166744 }
67176745
6718- String toString () =>
6719- '[Stack type: ${type }, frames: ${frames }, messages: ${messages }]' ;
6746+ String toString () => '[Stack ' //
6747+ 'type: ${type }, frames: ${frames }, messages: ${messages }, ' //
6748+ 'truncated: ${truncated }]' ;
67206749}
67216750
67226751/// The `Success` type is used to indicate that an operation completed
0 commit comments