当前位置:网站首页>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
- (数据库提权——Redis)Redis未授权访问漏洞总结
- libvirt 中体验容器
- vulnhub之narak
- MySQL searches and sorts out common methods according to time
- Solution to the second weekly test of ACM intensive training of Hunan Institute of technology in 2022
- Flutter: about monitoring on flutter applications
- Wrong arrangement (lottery, email)
- Laravel time zone timezone
- ArcGIS应用(二十一)Arcmap删除图层指定要素的方法
猜你喜欢
Kibana - installation and configuration of kibana
Basic knowledge of OpenGL (sort it out according to your own understanding)
Shardingsphere sub database and sub table < 3 >
cgroup简介
PHP export word method (one MHT)
Vulnhub's cereal
During FTP login, the error "530 login incorrect.login failed" is reported
PHP export word method (phpword)
rxjs Observable filter Operator 的实现原理介绍
AOSP ~ NTP (Network Time Protocol)
随机推荐
previous permutation lintcode51
After watching the video, AI model learned to play my world: cutting trees, making boxes, making stone picks, everything is good
MySQL searches and sorts out common methods according to time
(构造笔记)从类、API、框架三个层面学习如何设计可复用软件实体的具体技术
Socket TCP for network communication (I)
Dynamically monitor disk i/o with ZABBIX
Notes on 32-96 questions of sword finger offer
Kubernetes three dozen probes and probe mode
vulnhub之Nagini
023(【模板】最小生成树)(最小生成树)
错排问题 (抽奖,发邮件)
AOSP ~ NTP (Network Time Protocol)
网络通讯之Socket-Tcp(一)
Redis notes 01: Introduction
Unity3d learning notes 5 - create sub mesh
MySQL union和union all区别
Master and backup role election strategy in kept
[MySQL special] read lock and write lock
Dart: about grpc (I)
Ripper of vulnhub