当前位置:网站首页>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
边栏推荐
- Go language to realize static server
- [MySQL special] read lock and write lock
- During FTP login, the error "530 login incorrect.login failed" is reported
- Socket TCP for network communication (I)
- OpenGL draws colored triangles
- PHP export word method (one MHT)
- cgroup简介
- PHP Basics
- Solutions to the failure of installing electron
- Ripper of vulnhub
猜你喜欢

shardingSphere分库分表<3>

Qt OpenGL 纹理贴图

(构造笔记)ADT与OOP

Ripper of vulnhub

The tutor put forward 20 pieces of advice to help graduate students successfully complete their studies: first, don't plan to take a vacation

Hongmeng third training (project training)

Vulnhub's Tomato (tomato)

Laravel time zone timezone

解决msvcp120d.dll和msvcr120d.dll缺失

Groovy test class and JUnit test
随机推荐
Wechat applet development - page Jump transfer parameters
《剑指offer 04》二维数组查找
Notes on 32-96 questions of sword finger offer
Go language to realize static server
023(【模板】最小生成树)(最小生成树)
Vulnhub geminiinc V2
牛牛的组队竞赛
shardingSphere分库分表<3>
(database authorization - redis) summary of unauthorized access vulnerabilities in redis
Solve msvcp120d DLL and msvcr120d DLL missing
在CoreOS下部署WordPress实例教程
Basic knowledge of OpenGL (sort it out according to your own understanding)
Unity3d learning notes 5 - create sub mesh
Nestjs configuration service, configuring cookies and sessions
PHP export word method (phpword)
Socket TCP for network communication (I)
vulnhub之cereal
Interview experience in summer camp of Central South University in 2022
previous permutation lintcode51
利用Zabbix动态监控磁盘I/O