当前位置:网站首页>Dart: view the dill compiled code file
Dart: view the dill compiled code file
2022-07-03 12:05:00 【J_ D_ Chi】
List of articles
Write it at the front
Dart VM At run time .dart File compiled into .dill file , Sometimes we can check .dill File to understand the code from a deeper perspective . This article is mainly about .dill Compile and view files , Some practical examples will be added later .
Content
Get ready
Because in Dart Packed SDK and Flutter Under the SDK All have been screened , Like here we need to use one dump_kernel.dart file , This is packed SDK It's not in there .
So first we go GitHub On clone complete dart-sdk.
If we don't have Flutter, Let's just put clone Under the dart-sdk Configure to environment variables , Then you can use it directly .
If there is Flutter, So the dart The order should be Flutter Of , Then we need to make sure that at present Flutter Of dart-sdk With us clone Under the dart-sdk Consistent versions of .
for instance , adopt dart --version Command view Flutter Under the dart-sdk edition :
* dart --version
Dart SDK version: 2.14.0-188.5.beta (beta) (Thu Jun 24 15:29:20 2021 +0200) on “macos_x64”
Here is 2.14.0-188.5.beta, Then we can put us clone Under the dart-sdk Switch to the corresponding tag, So both sides are consistent .
* git checkout 2.14.0-188.5.beta
Note: checking out ‘2.14.0-188.5.beta’.
compile
Let's say we've written a main.dart file , Want to view its compiled code file , Let's do it first dart compile kernel main.dart, And that creates main.dill file .
Then passed dart .../pkg/vm/bin/dump_kernel.dart main.dill main.txt The compiled code will be output to main.txt in , So we can check the compiled code .
dump_kernel.dart The document is in our clone Under the dart-sdk Of pkg Directory , The above path should be completed according to your own situation .
Because we will Flutter Of dart-sdk and clone Under the dart-sdk The version is consistent , So our orders can be carried out normally . Otherwise, errors like the following will occur :
Unhandled exception:
Unexpected Kernel Format Version 60 (expected 65)
#0 BinaryBuilder.readComponent. (package:kernel/binary/ast_from_binary.dart:601:9)
#1 Timeline.timeSync (dart:developer/timeline.dart:163:22)
#2 BinaryBuilder.readComponent (package:kernel/binary/ast_from_binary.dart:588:21)
#3 main (file:///…/dart_sdk/sdk/pkg/vm/bin/dump_kernel.dart:54:40)
#4 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:281:32)
#5 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
Reference resources
边栏推荐
猜你喜欢
随机推荐
(database authorization - redis) summary of unauthorized access vulnerabilities in redis
Hongmeng third training (project training)
MySQL uses the method of updating linked tables with update
【mysql专项】读锁和写锁
(构造笔记)ADT与OOP
STL tutorial 8-map
Pragma pack syntax and usage
Wrong arrangement (lottery, email)
【mysql官方文档】死锁
Keepalived中Master和Backup角色选举策略
AOSP ~ NTP (Network Time Protocol)
外插散点数据
Sheet1$.输出[Excel 源输出].列[XXX] 出错。返回的列状态是:“文本被截断,或者一个或多个字符在目标代码页中没有匹配项。”。
为什么我的mysql容器启动不了呢
Visual Studio 2022下载及配置OpenCV4.5.5
Visual studio 2022 downloading and configuring opencv4.5.5
(database authorization - redis) summary of unauthorized access vulnerabilities in redis
Use of QT OpenGL camera
Qt OpenGL 旋转、平移、缩放
QT OpenGL rotate, pan, zoom









