-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add output selection support for ethdebug #15293
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
test/cmdlineTests/combined_json_ethdebug_with_ethdebug_debug_info/args
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--combined-json ethdebug --pretty-json --json-indent 3 |
1 change: 1 addition & 0 deletions
1
test/cmdlineTests/combined_json_ethdebug_with_ethdebug_debug_info/err
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Error: --combined-json ethdebug can only be used together with --debug-info ethdebug. |
1 change: 1 addition & 0 deletions
1
test/cmdlineTests/combined_json_ethdebug_with_ethdebug_debug_info/exit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
3 changes: 3 additions & 0 deletions
3
test/cmdlineTests/combined_json_ethdebug_with_ethdebug_debug_info/input.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity >=0.0; | ||
contract C {} |
1 change: 1 addition & 0 deletions
1
test/cmdlineTests/combined_json_ethdebug_without_ethdebug_debug_info/args
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--via-ir --debug-info ethdebug --combined-json ethdebug --pretty-json --json-indent 3 |
3 changes: 3 additions & 0 deletions
3
test/cmdlineTests/combined_json_ethdebug_without_ethdebug_debug_info/input.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity >=0.0; | ||
contract C {} |
8 changes: 8 additions & 0 deletions
8
test/cmdlineTests/combined_json_ethdebug_without_ethdebug_debug_info/output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"contracts": { | ||
"combined_json_ethdebug_without_ethdebug_debug_info/input.sol:C": { | ||
"ethdebug": {} | ||
} | ||
}, | ||
"version": "<VERSION REMOVED>" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--debug-info ethdebug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Error: --debug-info ethdebug can only be used with --via-ir, --ir and/or --ir-optimized. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
pragma solidity >=0.0; | ||
|
||
contract C { | ||
function f() public {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--ir --debug-info ethdebug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
pragma solidity >=0.0; | ||
|
||
contract C { | ||
function f() public {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
IR: | ||
/// ethdebug: enabled | ||
/// @use-src 0:"debug_info_in_yul_ethdebug/input.sol" | ||
object "C_6" { | ||
code { | ||
/// @src 0:60:101 | ||
mstore(64, memoryguard(128)) | ||
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } | ||
|
||
constructor_C_6() | ||
|
||
let _1 := allocate_unbounded() | ||
codecopy(_1, dataoffset("C_6_deployed"), datasize("C_6_deployed")) | ||
|
||
return(_1, datasize("C_6_deployed")) | ||
|
||
function allocate_unbounded() -> memPtr { | ||
memPtr := mload(64) | ||
} | ||
|
||
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() { | ||
revert(0, 0) | ||
} | ||
|
||
/// @src 0:60:101 | ||
function constructor_C_6() { | ||
|
||
/// @src 0:60:101 | ||
|
||
} | ||
/// @src 0:60:101 | ||
|
||
} | ||
/// @use-src 0:"debug_info_in_yul_ethdebug/input.sol" | ||
object "C_6_deployed" { | ||
code { | ||
/// @src 0:60:101 | ||
mstore(64, memoryguard(128)) | ||
|
||
if iszero(lt(calldatasize(), 4)) | ||
{ | ||
let selector := shift_right_224_unsigned(calldataload(0)) | ||
switch selector | ||
|
||
case 0x26121ff0 | ||
{ | ||
// f() | ||
|
||
external_fun_f_5() | ||
} | ||
|
||
default {} | ||
} | ||
|
||
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() | ||
|
||
function shift_right_224_unsigned(value) -> newValue { | ||
newValue := | ||
|
||
shr(224, value) | ||
|
||
} | ||
|
||
function allocate_unbounded() -> memPtr { | ||
memPtr := mload(64) | ||
} | ||
|
||
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() { | ||
revert(0, 0) | ||
} | ||
|
||
function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() { | ||
revert(0, 0) | ||
} | ||
|
||
function abi_decode_tuple_(headStart, dataEnd) { | ||
if slt(sub(dataEnd, headStart), 0) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() } | ||
|
||
} | ||
|
||
function abi_encode_tuple__to__fromStack(headStart ) -> tail { | ||
tail := add(headStart, 0) | ||
|
||
} | ||
|
||
function external_fun_f_5() { | ||
|
||
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } | ||
abi_decode_tuple_(4, calldatasize()) | ||
fun_f_5() | ||
let memPos := allocate_unbounded() | ||
let memEnd := abi_encode_tuple__to__fromStack(memPos ) | ||
return(memPos, sub(memEnd, memPos)) | ||
|
||
} | ||
|
||
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() { | ||
revert(0, 0) | ||
} | ||
|
||
/// @src 0:77:99 | ||
function fun_f_5() { | ||
|
||
} | ||
/// @src 0:60:101 | ||
|
||
} | ||
|
||
data ".metadata" hex"<BYTECODE REMOVED>" | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--ir-optimized --optimize --debug-info ethdebug |
6 changes: 6 additions & 0 deletions
6
test/cmdlineTests/debug_info_in_yul_ethdebug_optimized/input.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
pragma solidity >=0.0; | ||
|
||
contract C { | ||
function f() public {} | ||
} |
35 changes: 35 additions & 0 deletions
35
test/cmdlineTests/debug_info_in_yul_ethdebug_optimized/output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Optimized IR: | ||
/// ethdebug: enabled | ||
/// @use-src 0:"debug_info_in_yul_ethdebug_optimized/input.sol" | ||
object "C_6" { | ||
code { | ||
{ | ||
/// @src 0:60:101 | ||
let _1 := memoryguard(0x80) | ||
mstore(64, _1) | ||
if callvalue() { revert(0, 0) } | ||
let _2 := datasize("C_6_deployed") | ||
codecopy(_1, dataoffset("C_6_deployed"), _2) | ||
return(_1, _2) | ||
} | ||
} | ||
/// @use-src 0:"debug_info_in_yul_ethdebug_optimized/input.sol" | ||
object "C_6_deployed" { | ||
code { | ||
{ | ||
/// @src 0:60:101 | ||
if iszero(lt(calldatasize(), 4)) | ||
{ | ||
if eq(0x26121ff0, shr(224, calldataload(0))) | ||
{ | ||
if callvalue() { revert(0, 0) } | ||
if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } | ||
return(0, 0) | ||
} | ||
} | ||
revert(0, 0) | ||
} | ||
} | ||
data ".metadata" hex"<BYTECODE REMOVED>" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--allow-paths . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
pragma solidity >=0.0; | ||
|
||
contract C { | ||
function f() public {} | ||
} |
12 changes: 12 additions & 0 deletions
12
test/cmdlineTests/standard_debug_info_ethdebug_no_ir/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"language": "Solidity", | ||
"sources": { | ||
"C": {"urls": ["standard_debug_info_in_yul_ethdebug_optimized/in.sol"]} | ||
}, | ||
"settings": { | ||
"debug": {"debugInfo": ["ethdebug"]}, | ||
"outputSelection": { | ||
"*": {"*": ["asm"]} | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Combined JSON has been deprecated for ages now (#10278) and we're likely to drop it in the next breaking release. It does not make sense add more things to it at this point.
This should be standalone compiler output instead.