truffle-debugger:调试使用Truffle构建的Solidity文件的核心功能

  • q6_706851
    了解作者
  • 65KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-13 13:14
    上传日期
松露调试器 :warning: 此仓库已弃用 :warning: Truffle已将所有模块移至 truffle的monorepo中。 到那边见! 可移植的Solidity调试器库,可与或不与Truffle一起使用。 特征: 稳固性步进和断点 变量检查 观看表情 和更多! API文档 可以在找到该库的API文档。 图书馆使用 :warning: 该文档当前正在开发中。 请参阅truffle debug命令提供的。 必填参数 要启动松露调试器会话,您需要执行以下操作: txHash交易哈希(前缀0x ),用于调试交易 provider一个web3提供者实例(请参阅 ) contracts -合同对象数组,具有以下属性: contractName名称 source -完整的密实度的源代码 sourcePath (可选)磁盘上Solidity文件的路径 ast -Solidity编译器的输出AST(新样式,不是lega
truffle-debugger-develop.zip
内容介绍
# truffle-debugger ----------------------- ### :warning: This repo is deprecated :warning: **Truffle has moved all modules to a monorepo at [trufflesuite/truffle](https://github.com/trufflesuite/truffle). See you over there!** ----------------------- Portable Solidity debugger library, for use with or without Truffle. ![Debugger in Action](https://i.imgur.com/0j5m4KW.gif) Features: - Solidity stepping and breakpoints - Variable inspection - Watch expressions - and more! ## API Documentation API Documentation for this library can be found at [truffleframework.com/truffle-debugger](http://truffleframework.com/truffle-debugger/). ## Library Usage _:warning: This documentation is currently a work in progress. Please see the [reference integration](https://github.com/trufflesuite/truffle-core/blob/develop/lib/commands/debug.js) provided by the `truffle debug` command._ ### Required Parameters To start a truffle-debugger session, you'll need the following: - `txHash` - A transaction hash (prefixed with `0x`), for the transaction to debug - `provider` - A web3 provider instance (see [web3.js](https://github.com/ethereum/web3.js/)) - `contracts` - An array of contract objects, with the following properties: - `contractName` - The name of the contract - `source` - The full Solidity source code - `sourcePath` - (optional) the path to the Solidity file on disk - `ast` - The Solidity compiler's output AST (new style, not `legacyAST`) - `binary` - `0x`-prefixed string with the binary used to create a contract instance - `sourceMap` - The Solidity compiler output source map for the creation binary - `deployedBinary` - `0x`-prefixed string with the on-chain binary for a contract instance - `deployedSourceMap` - The source map corresponding to the on-chain binary (from the Solidity compiler) Optionally (and recommended), you can also provide a `files` argument: - `files` - An array of sourcePaths representing file indexes (from `solc` or `truffle-compile`) ### Invocation 1. Start the debugger session by constructing a Debugger instance with `.forTx()` and then `.connect()` to it: ```javascript import Debugger from "truffle-debugger"; let bugger = await Debugger .forTx(txHash, { contracts, files, provider }); let session = bugger.connect(); ``` 2. Resolve the session's `ready()` promise: ```javascript await session.ready(); ``` 3. Use the provided public methods on the `session` instance in order to step through the trace for the transaction: ```javascript session.stepNext(); session.stepOver(); session.stepInto(); ``` 4. Access data provided by the debugger via the `session.view()` interface, and the provided selectors: ```javascript let { ast, data, evm, solidity, trace } = Debugger.selectors; let variables = session.view(data.current.identifiers.native); let sourceRange = session.view(solidity.current.sourceRange); ``` ### Useful API Docs References - [**`Session` class docs**](http://truffleframework.com/truffle-debugger/class/lib/session/index.js~Session.html) - **Docs for selectors:** - [**`ast` selectors**](http://truffleframework.com/truffle-debugger/identifiers.html#ast-selectors) - [**`data` selectors**](http://truffleframework.com/truffle-debugger/identifiers.html#data-selectors) - [**`evm` selectors**](http://truffleframework.com/truffle-debugger/identifiers.html#evm-selectors) - [**`solidity` selectors**](http://truffleframework.com/truffle-debugger/identifiers.html#solidity-selectors) - [**`trace` selectors**](http://truffleframework.com/truffle-debugger/identifiers.html#trace-selectors) ## Contributing It's our goal that this library should serve as a reliable and well-maintained tool for the Solidity ecosystem. Ultimately, we hope to support all language features and meet the varied requirements of a mature debugging library. We believe that a good Solidity debugger belongs to the community. We welcome, with our most humble gratitude, any and all community efforts in bringing this debugger closer to that goal. If you find something broken or missing, please open an issue! Some other ideas for how to get involved: - Bug fix PRs - Documentation improvements - Additional tests - unit tests and integration - Technical discussion (ways to improve architecture, etc.) Thank you for all the continued support. :bow:
评论
    相关推荐
    • QNX IDE training
      QNX IDE使用教程,Developing, Debugging and Analyzing Performance with the QNX® Momentics® IDE
    • DBGridEh 6.3 +修正3个Bug
      从网上下载的DBGridEh6.3,发现有几个Bug,我已做修正,使用效果良好,未见异常,现分享给有需要有朋友,直接安装即可。 2015-12-05 Bug修改********************* Bug 1. 点击列头排序后,行已经变了,但是却并不...
    • BTASM4.1汇编IDE
      BTASM4.1 标天目前最终版,相对于4.0版作了比较大的改进,主要是修复了内部的一些BUGER。
    • bugfree-wallhack:PointAndClick IDE
      bugfreewallhack PointAndClick IDE
    • 最新的VB公用控件bug补丁
      旧的控件会有时莫名的在VB的IDE开发环境里出现程序退出和收到"除数为零"的错误信息。微软据此本月释放了最新的修改补丁。 由此可以看出微软对现有的VB支持力度还是比较不错的,呵呵,大伙应该放心些了吧!
    • TurtleCode:小型IDE
      TurtleCode 小型IDE 特征 语法高亮 自动填充(按Shift + Tab) 注释突出显示(!!!) 文件管理 脚本正在运行(Buggy,稍后需要查看) 去做 文件树/导航系统 完成菜单栏 写一些语言文件 暗模式(?)
    • IDE Fix Pack 6.4.4(Embarcadero RAD Studio 10.3.X最新Bug补钉包)
      IDE Fix Pack 6.4.4(Embarcadero RAD Studio 10.3.X 最新Bug补钉包),支持10.3 (RTM/UP1/2),内含详细bug补钉说明及安装说明文档。
    • delphi2005 IDE UPDATE FIX BUG 2005-9-24
      DELPHI2005 内部更新IDEbug , 2005-9月内部发布
    • IDE Factory
      【名称】IDE Factory 【作用】Flex Builder的AS3开发插件,主要用于生成Geter and Setter 、Format code...etc 【版本】Beta2 1.05(2008.12.20 最新) 【官网】开代理访问 www.idefactory.com 【已知Bug】 根据...
    • Selenium IDE AND Firefoxbug
      Selenium IDE AND Firefoxbug