当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
ArcGIS应用(二十一)Arcmap删除图层指定要素的方法
Qt OpenGL相机的使用
【mysql官方文档】死锁
小鹏 P7 撞护栏安全气囊未弹出,官方回应称撞击力度未达到弹出要求
STL tutorial 8-map
Symlink(): solution to protocol error in PHP artisan storage:link on win10
Experience container in libvirt
Vulnhub's Tomato (tomato)
抓包整理外篇fiddler———— 会话栏与过滤器[二]
vulnhub之raven2
PHP导出word方法(一phpword)
Duplicate numbers in the array of sword finger offer 03
Notes on 32-96 questions of sword finger offer
Hongmeng third training (project training)
Cacti监控Redis实现过程
libvirt 中体验容器
量化计算调研
PHP導出word方法(一mht)
MySQL uses the method of updating linked tables with update
Deploying WordPress instance tutorial under coreos









