当前位置:网站首页>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
边栏推荐
猜你喜欢

vulnhub之raven2

Symlink(): solution to protocol error in PHP artisan storage:link on win10

STL tutorial 10 container commonalities and usage scenarios

2022年湖南工学院ACM集训第二次周测题解

MCDF实验1

XML (DTD, XML parsing, XML modeling)

Unity3D学习笔记5——创建子Mesh

【mysql官方文档】死锁

Kibana - installation and configuration of kibana

《剑指offer 04》二维数组查找
随机推荐
(数据库提权——Redis)Redis未授权访问漏洞总结
Ripper of vulnhub
Groovy测试类 和 Junit测试
Introduction to the implementation principle of rxjs observable filter operator
OpenGL shader use
(構造筆記)從類、API、框架三個層面學習如何設計可複用軟件實體的具體技術
win10 上PHP artisan storage:link 出现 symlink (): Protocol error的解决办法
网络通讯之Socket-Tcp(一)
Socket TCP for network communication (I)
Solution à la défaillance de l'installation d'Electron
Simple factory and factory method mode
(构造笔记)ADT与OOP
STL tutorial 10 container commonalities and usage scenarios
Systemverilog-- OOP--对象的拷贝
牛牛的组队竞赛
利用Zabbix动态监控磁盘I/O
(构造笔记)MIT reading部分学习心得
Hongmeng third training (project training)
Basic knowledge of OpenGL (sort it out according to your own understanding)
laravel 时区问题timezone