Skip to content

Commit 1e2c583

Browse files
committed
Added readme, example debug and image
1 parent 1135d77 commit 1e2c583

File tree

3 files changed

+1018
-1
lines changed

3 files changed

+1018
-1
lines changed

README.md

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,60 @@
11
# ethereum-graph-debugger
22

3-
Work in progress...
3+
![Graph example](images/screen-1.png)
4+
5+
Graphical Solidity debugger. This debugger takes a different approach to traditional debugging.
6+
Instead of stepping through the execution of the program, it shows the whole program control flow graph and
7+
the actual execution of the transaction highlighted in red. In this way, the developer can see the whole picture
8+
and jump where it is necessary in a quick and graphical way.
9+
10+
# Usage
11+
12+
Right now, the debugger is very simple:
13+
14+
```
15+
edebugger-1.0-SNAPSHOT.jar <solidity source file> <node URL> <transaction hash>
16+
```
17+
For example:
18+
```
19+
java -jar edebugger-1.0-SNAPSHOT.jar ~/tests/Program.sol http://127.0.0.1:8545 0x0c971feb820d2bca26c3e7a0a27b5015694d9ec8ea0169935ff7168a63da3f6f
20+
```
21+
22+
# Download
23+
24+
Go to the [releases](https://github.com/fergarrui/ethereum-graph-debugger/releases) section of this repo
25+
26+
# Example debug file
27+
28+
This file is made as a demo to see what this debugger does at this stage. A function (`pushIf`) was executed in a test contract (the source code of the contract is in the left panel of the debug file).
29+
The file can be found here: [Example debug file](http://htmlpreview.github.com/?https://raw.githubusercontent.com/fergarrui/ethereum-graph-debugger/master/examples/debug.html)
30+
31+
# Existing tools
32+
There are already tools that allow you to debug Ethereum transactions (Solidity):
33+
34+
* [Remix](https://remix.ethereum.org)
35+
* [Truffle](http://truffleframework.com)
36+
37+
# Features
38+
39+
* It compiles the provided source code and draws a control flow graph
40+
* From the provided transaction hash (using `debug_traceTransaction`) it gets the trace of the transaction
41+
* Combines the control flow graph with the execution trace, highlighting the executed instructions in red
42+
* Instructions opcodes can be clicked in the graph, and the Solidity source code in the left panel involving that instruction is highlighted. Also the EVM state is shown (stack, memory, storage)
43+
44+
# Limitations
45+
46+
For now there are many limitations since this is a very early release of the debugger
47+
48+
* It does not debugs the code executed to an external contract call
49+
* The control flow graph is drawn from the static bytecode, so there can be nodes without edges, a symbolic execution would be needed. Maybe added in future releases
50+
* Transactions executed in the runtime bytecode are supported (for example, the constructor execution of a contract cannot be debugged right now)
51+
* You must provide a node URL that supports `debug_traceTransaction`, like Geth or Ganache, therefore, Infura is not supported
52+
* The interface is quite ugly, but usable
53+
* Probably many more
54+
55+
# Build the project
56+
57+
`mvn clean package` creates a fat executable jar at: `target/edebugger-<version>.jar`
58+
59+
A dependency needs to be in your local maven repository (I want to rewrite that in the future).
60+
The project [Ethereum disassembler](https://github.com/fergarrui/ethereum-disassembler) must be installed using `mvn clean install`.

examples/debug.html

Lines changed: 960 additions & 0 deletions
Large diffs are not rendered by default.

images/screen-1.png

255 KB
Loading

0 commit comments

Comments
 (0)