Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2a91773

Browse files
committedApr 12, 2025·
Test ethdebug output when requested in standard json under EOF
1 parent 38a84d5 commit 2a91773

File tree

13 files changed

+1346
-0
lines changed

13 files changed

+1346
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"language": "Solidity",
3+
"sources": {
4+
"a.sol": {
5+
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A1 { function a(uint x) public pure { assert(x > 0); } } contract A2 { function a(uint x) public pure { assert(x > 0); } }"
6+
},
7+
"b.sol": {
8+
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A1 { function b(uint x) public pure { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } }"
9+
}
10+
},
11+
"settings": {
12+
"eofVersion": 1,
13+
"evmVersion": "osaka",
14+
"viaIR": true,
15+
"debug": {
16+
"debugInfo": [
17+
"ethdebug"
18+
]
19+
},
20+
"outputSelection": {
21+
"*": {
22+
"*": [
23+
"evm.bytecode.ethdebug",
24+
"evm.deployedBytecode.ethdebug",
25+
"ir",
26+
"irOptimized"
27+
]
28+
}
29+
}
30+
}
31+
}

‎test/cmdlineTests/standard_output_debuginfo_ethdebug_compatible_eof/output.json

+1,165
Large diffs are not rendered by default.

‎test/cmdlineTests/standard_output_debuginfo_ethdebug_compatible_eof/strip-ethdebug

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--allow-paths .
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/// @use-src 0:"input.sol"
2+
object "C_6_deployed" {
3+
code {
4+
/// @src 0:60:101 "contract C {..."
5+
mstore(64, 128)
6+
7+
// f()
8+
fun_f_5()
9+
10+
/// @src 0:77:99 "function f() public {}"
11+
function fun_f_5() {
12+
sstore(0, 42)
13+
}
14+
/// @src 0:60:101 "contract C {..."
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"language": "Yul",
3+
"sources": {
4+
"C": {
5+
"urls": [
6+
"standard_yul_debug_info_ethdebug_compatible_output_eof/in.yul"
7+
]
8+
}
9+
},
10+
"settings": {
11+
"eofVersion": 1,
12+
"evmVersion": "osaka",
13+
"debug": {"debugInfo": ["ethdebug"]},
14+
"outputSelection": {
15+
"*": {"*": ["ir", "irOptimized", "evm.bytecode.ethdebug"]}
16+
}
17+
}
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"contracts": {
3+
"C": {
4+
"C_6_deployed": {
5+
"evm": {
6+
"bytecode": {
7+
"ethdebug": "<ETHDEBUG DEBUG DATA REMOVED>"
8+
}
9+
},
10+
"ir": "/// ethdebug: enabled
11+
/// @use-src 0:\"input.sol\"
12+
object \"C_6_deployed\" {
13+
code {
14+
/// @src 0:60:101
15+
mstore(64, 128)
16+
fun_f_5()
17+
/// @src 0:77:99
18+
function fun_f_5()
19+
{ sstore(0, 42) }
20+
}
21+
}
22+
",
23+
"irOptimized": "/// ethdebug: enabled
24+
/// @use-src 0:\"input.sol\"
25+
object \"C_6_deployed\" {
26+
code {
27+
{
28+
/// @src 0:60:101
29+
mstore(64, 128)
30+
fun_f()
31+
}
32+
/// @src 0:77:99
33+
function fun_f()
34+
{ sstore(0, 42) }
35+
}
36+
}
37+
"
38+
}
39+
}
40+
},
41+
"ethdebug": "<ETHDEBUG DEBUG DATA REMOVED>"
42+
}

‎test/cmdlineTests/standard_yul_debug_info_ethdebug_compatible_output_eof/strip-ethdebug

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--allow-paths .
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/// @use-src 0:"input.sol"
2+
object "C_6_deployed" {
3+
code {
4+
/// @src 0:60:101 "contract C {..."
5+
mstore(64, 128)
6+
7+
// f()
8+
fun_f_5()
9+
10+
/// @src 0:77:99 "function f() public {}"
11+
function fun_f_5() {
12+
sstore(0, 42)
13+
}
14+
/// @src 0:60:101 "contract C {..."
15+
}
16+
}
17+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"language": "Yul",
3+
"sources": {
4+
"C": {"urls": ["standard_yul_ethdebug_eof/in.yul"]}
5+
},
6+
"settings": {
7+
"eofVersion": 1,
8+
"evmVersion": "osaka",
9+
"outputSelection": {
10+
"*": {"*": ["evm.bytecode.ethdebug", "evm.deployedBytecode.ethdebug", "ir", "irOptimized"]}
11+
}
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"contracts": {
3+
"C": {
4+
"C_6_deployed": {
5+
"evm": {
6+
"bytecode": {
7+
"ethdebug": "<ETHDEBUG DEBUG DATA REMOVED>"
8+
}
9+
},
10+
"ir": "/// ethdebug: enabled
11+
/// @use-src 0:\"input.sol\"
12+
object \"C_6_deployed\" {
13+
code {
14+
/// @src 0:60:101
15+
mstore(64, 128)
16+
fun_f_5()
17+
/// @src 0:77:99
18+
function fun_f_5()
19+
{ sstore(0, 42) }
20+
}
21+
}
22+
",
23+
"irOptimized": "/// ethdebug: enabled
24+
/// @use-src 0:\"input.sol\"
25+
object \"C_6_deployed\" {
26+
code {
27+
{
28+
/// @src 0:60:101
29+
mstore(64, 128)
30+
fun_f()
31+
}
32+
/// @src 0:77:99
33+
function fun_f()
34+
{ sstore(0, 42) }
35+
}
36+
}
37+
"
38+
}
39+
}
40+
},
41+
"ethdebug": "<ETHDEBUG DEBUG DATA REMOVED>"
42+
}

‎test/cmdlineTests/standard_yul_ethdebug_eof/strip-ethdebug

Whitespace-only changes.

0 commit comments

Comments
 (0)
Please sign in to comment.