Expose --debug-info/settings.debug.debugInfo option

This commit is contained in:
Kamil Śliwak
2021-10-11 20:34:48 +02:00
parent bcfefc79d9
commit a9e794c872
73 changed files with 1913 additions and 5 deletions
@@ -0,0 +1 @@
--ir --ir-optimized --asm --optimize --debug-info all
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
pragma solidity >=0.0;
contract C {
function f() public {}
}
@@ -0,0 +1,213 @@
======= debug_info_in_yul_and_evm_asm_print_all/input.sol:C =======
EVM assembly:
/* "debug_info_in_yul_and_evm_asm_print_all/input.sol":60:101 contract C {... */
mstore(0x40, 0x80)
callvalue
dup1
iszero
tag_1
jumpi
0x00
dup1
revert
tag_1:
pop
dataSize(sub_0)
dup1
dataOffset(sub_0)
0x00
codecopy
0x00
return
stop
sub_0: assembly {
/* "debug_info_in_yul_and_evm_asm_print_all/input.sol":60:101 contract C {... */
mstore(0x40, 0x80)
callvalue
dup1
iszero
tag_1
jumpi
0x00
dup1
revert
tag_1:
pop
jumpi(tag_2, lt(calldatasize, 0x04))
shr(0xe0, calldataload(0x00))
dup1
0x26121ff0
eq
tag_3
jumpi
tag_2:
0x00
dup1
revert
/* "debug_info_in_yul_and_evm_asm_print_all/input.sol":77:99 function f() public {} */
tag_3:
stop
auxdata: <AUXDATA REMOVED>
}
IR:
/*=====================================================*
* WARNING *
* Solidity to Yul compilation is still EXPERIMENTAL *
* It can result in LOSS OF FUNDS or worse *
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"debug_info_in_yul_and_evm_asm_print_all/input.sol"
object "C_6" {
code {
/// @src 0:60:101 "contract C {..."
mstore(64, 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 "contract C {..."
function constructor_C_6() {
/// @src 0:60:101 "contract C {..."
}
/// @src 0:60:101 "contract C {..."
}
/// @use-src 0:"debug_info_in_yul_and_evm_asm_print_all/input.sol"
object "C_6_deployed" {
code {
/// @src 0:60:101 "contract C {..."
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
let selector := shift_right_224_unsigned(calldataload(0))
switch selector
case 0x26121ff0
{
// f()
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))
}
default {}
}
if iszero(calldatasize()) { }
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 revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
revert(0, 0)
}
/// @ast-id 5
/// @src 0:77:99 "function f() public {}"
function fun_f_5() {
}
/// @src 0:60:101 "contract C {..."
}
data ".metadata" hex"<BYTECODE REMOVED>"
}
}
Optimized IR:
/*=====================================================*
* WARNING *
* Solidity to Yul compilation is still EXPERIMENTAL *
* It can result in LOSS OF FUNDS or worse *
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"debug_info_in_yul_and_evm_asm_print_all/input.sol"
object "C_6" {
code {
{
/// @src 0:60:101 "contract C {..."
mstore(64, 128)
if callvalue() { revert(0, 0) }
let _1 := datasize("C_6_deployed")
codecopy(128, dataoffset("C_6_deployed"), _1)
return(128, _1)
}
}
/// @use-src 0:"debug_info_in_yul_and_evm_asm_print_all/input.sol"
object "C_6_deployed" {
code {
{
/// @src 0:60:101 "contract C {..."
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
let _1 := 0
if eq(0x26121ff0, shr(224, calldataload(_1)))
{
if callvalue() { revert(_1, _1) }
if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) }
return(128, _1)
}
}
revert(0, 0)
}
}
data ".metadata" hex"<BYTECODE REMOVED>"
}
}
@@ -0,0 +1 @@
--ir --ir-optimized --asm --optimize --debug-info location,all,none
@@ -0,0 +1 @@
Invalid value for --debug-info option: location,all,none
@@ -0,0 +1 @@
--ir --ir-optimized --asm --optimize --debug-info location
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
pragma solidity >=0.0;
contract C {
function f() public {}
}
@@ -0,0 +1,212 @@
======= debug_info_in_yul_and_evm_asm_print_location_only/input.sol:C =======
EVM assembly:
/* "debug_info_in_yul_and_evm_asm_print_location_only/input.sol":60:101 */
mstore(0x40, 0x80)
callvalue
dup1
iszero
tag_1
jumpi
0x00
dup1
revert
tag_1:
pop
dataSize(sub_0)
dup1
dataOffset(sub_0)
0x00
codecopy
0x00
return
stop
sub_0: assembly {
/* "debug_info_in_yul_and_evm_asm_print_location_only/input.sol":60:101 */
mstore(0x40, 0x80)
callvalue
dup1
iszero
tag_1
jumpi
0x00
dup1
revert
tag_1:
pop
jumpi(tag_2, lt(calldatasize, 0x04))
shr(0xe0, calldataload(0x00))
dup1
0x26121ff0
eq
tag_3
jumpi
tag_2:
0x00
dup1
revert
/* "debug_info_in_yul_and_evm_asm_print_location_only/input.sol":77:99 */
tag_3:
stop
auxdata: <AUXDATA REMOVED>
}
IR:
/*=====================================================*
* WARNING *
* Solidity to Yul compilation is still EXPERIMENTAL *
* It can result in LOSS OF FUNDS or worse *
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"debug_info_in_yul_and_evm_asm_print_location_only/input.sol"
object "C_6" {
code {
/// @src 0:60:101
mstore(64, 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_and_evm_asm_print_location_only/input.sol"
object "C_6_deployed" {
code {
/// @src 0:60:101
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
let selector := shift_right_224_unsigned(calldataload(0))
switch selector
case 0x26121ff0
{
// f()
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))
}
default {}
}
if iszero(calldatasize()) { }
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 revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
revert(0, 0)
}
/// @src 0:77:99
function fun_f_5() {
}
/// @src 0:60:101
}
data ".metadata" hex"<BYTECODE REMOVED>"
}
}
Optimized IR:
/*=====================================================*
* WARNING *
* Solidity to Yul compilation is still EXPERIMENTAL *
* It can result in LOSS OF FUNDS or worse *
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"debug_info_in_yul_and_evm_asm_print_location_only/input.sol"
object "C_6" {
code {
{
/// @src 0:60:101
mstore(64, 128)
if callvalue() { revert(0, 0) }
let _1 := datasize("C_6_deployed")
codecopy(128, dataoffset("C_6_deployed"), _1)
return(128, _1)
}
}
/// @use-src 0:"debug_info_in_yul_and_evm_asm_print_location_only/input.sol"
object "C_6_deployed" {
code {
{
/// @src 0:60:101
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
let _1 := 0
if eq(0x26121ff0, shr(224, calldataload(_1)))
{
if callvalue() { revert(_1, _1) }
if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) }
return(128, _1)
}
}
revert(0, 0)
}
}
data ".metadata" hex"<BYTECODE REMOVED>"
}
}
@@ -0,0 +1 @@
--ir --ir-optimized --asm --optimize --debug-info none
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
pragma solidity >=0.0;
contract C {
function f() public {}
}
@@ -0,0 +1,201 @@
======= debug_info_in_yul_and_evm_asm_print_none/input.sol:C =======
EVM assembly:
mstore(0x40, 0x80)
callvalue
dup1
iszero
tag_1
jumpi
0x00
dup1
revert
tag_1:
pop
dataSize(sub_0)
dup1
dataOffset(sub_0)
0x00
codecopy
0x00
return
stop
sub_0: assembly {
mstore(0x40, 0x80)
callvalue
dup1
iszero
tag_1
jumpi
0x00
dup1
revert
tag_1:
pop
jumpi(tag_2, lt(calldatasize, 0x04))
shr(0xe0, calldataload(0x00))
dup1
0x26121ff0
eq
tag_3
jumpi
tag_2:
0x00
dup1
revert
tag_3:
stop
auxdata: <AUXDATA REMOVED>
}
IR:
/*=====================================================*
* WARNING *
* Solidity to Yul compilation is still EXPERIMENTAL *
* It can result in LOSS OF FUNDS or worse *
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"debug_info_in_yul_and_evm_asm_print_none/input.sol"
object "C_6" {
code {
mstore(64, 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)
}
function constructor_C_6() {
}
}
/// @use-src 0:"debug_info_in_yul_and_evm_asm_print_none/input.sol"
object "C_6_deployed" {
code {
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
let selector := shift_right_224_unsigned(calldataload(0))
switch selector
case 0x26121ff0
{
// f()
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))
}
default {}
}
if iszero(calldatasize()) { }
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 revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
revert(0, 0)
}
function fun_f_5() {
}
}
data ".metadata" hex"<BYTECODE REMOVED>"
}
}
Optimized IR:
/*=====================================================*
* WARNING *
* Solidity to Yul compilation is still EXPERIMENTAL *
* It can result in LOSS OF FUNDS or worse *
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"debug_info_in_yul_and_evm_asm_print_none/input.sol"
object "C_6" {
code {
{
mstore(64, 128)
if callvalue() { revert(0, 0) }
let _1 := datasize("C_6_deployed")
codecopy(128, dataoffset("C_6_deployed"), _1)
return(128, _1)
}
}
/// @use-src 0:"debug_info_in_yul_and_evm_asm_print_none/input.sol"
object "C_6_deployed" {
code {
{
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
let _1 := 0
if eq(0x26121ff0, shr(224, calldataload(_1)))
{
if callvalue() { revert(_1, _1) }
if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) }
return(128, _1)
}
}
revert(0, 0)
}
}
data ".metadata" hex"<BYTECODE REMOVED>"
}
}
@@ -0,0 +1 @@
--ir --ir-optimized --asm --optimize --debug-info snippet
@@ -0,0 +1 @@
To use 'snippet' with --debug-info you must select also 'location'.
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
pragma solidity >=0.0;
contract C {
function f() public {}
}
@@ -0,0 +1 @@
--pretty-json --json-indent 4 --allow-paths .
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
pragma solidity >=0.0;
contract C {
function f() public {}
}
@@ -0,0 +1,13 @@
{
"language": "Solidity",
"sources": {
"C": {"urls": ["standard_debug_info_in_yul_and_evm_asm_print_all/in.sol"]}
},
"settings": {
"debug": {"debugInfo": ["*"]},
"optimizer": {"enabled": true},
"outputSelection": {
"*": {"*": ["ir", "irOptimized", "evm.assembly"]}
}
}
}
@@ -0,0 +1,230 @@
{
"contracts":
{
"C":
{
"C":
{
"evm":
{
"assembly": " /* \"C\":60:101 contract C {... */
mstore(0x40, 0x80)
callvalue
dup1
iszero
tag_1
jumpi
0x00
dup1
revert
tag_1:
pop
dataSize(sub_0)
dup1
dataOffset(sub_0)
0x00
codecopy
0x00
return
stop
sub_0: assembly {
/* \"C\":60:101 contract C {... */
mstore(0x40, 0x80)
callvalue
dup1
iszero
tag_1
jumpi
0x00
dup1
revert
tag_1:
pop
jumpi(tag_2, lt(calldatasize, 0x04))
shr(0xe0, calldataload(0x00))
dup1
0x26121ff0
eq
tag_3
jumpi
tag_2:
0x00
dup1
revert
/* \"C\":77:99 function f() public {} */
tag_3:
stop
auxdata: <AUXDATA REMOVED>
}
"
},
"ir": "/*=====================================================*
* WARNING *
* Solidity to Yul compilation is still EXPERIMENTAL *
* It can result in LOSS OF FUNDS or worse *
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:\"C\"
object \"C_6\" {
code {
/// @src 0:60:101 \"contract C {...\"
mstore(64, 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 \"contract C {...\"
function constructor_C_6() {
/// @src 0:60:101 \"contract C {...\"
}
/// @src 0:60:101 \"contract C {...\"
}
/// @use-src 0:\"C\"
object \"C_6_deployed\" {
code {
/// @src 0:60:101 \"contract C {...\"
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
let selector := shift_right_224_unsigned(calldataload(0))
switch selector
case 0x26121ff0
{
// f()
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))
}
default {}
}
if iszero(calldatasize()) { }
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 revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
revert(0, 0)
}
/// @ast-id 5
/// @src 0:77:99 \"function f() public {}\"
function fun_f_5() {
}
/// @src 0:60:101 \"contract C {...\"
}
data \".metadata\" hex\"<BYTECODE REMOVED>\"
}
}
",
"irOptimized": "/*=====================================================*
* WARNING *
* Solidity to Yul compilation is still EXPERIMENTAL *
* It can result in LOSS OF FUNDS or worse *
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:\"C\"
object \"C_6\" {
code {
{
/// @src 0:60:101 \"contract C {...\"
mstore(64, 128)
if callvalue() { revert(0, 0) }
let _1 := datasize(\"C_6_deployed\")
codecopy(128, dataoffset(\"C_6_deployed\"), _1)
return(128, _1)
}
}
/// @use-src 0:\"C\"
object \"C_6_deployed\" {
code {
{
/// @src 0:60:101 \"contract C {...\"
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
let _1 := 0
if eq(0x26121ff0, shr(224, calldataload(_1)))
{
if callvalue() { revert(_1, _1) }
if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) }
return(128, _1)
}
}
revert(0, 0)
}
}
data \".metadata\" hex\"<BYTECODE REMOVED>\"
}
}
"
}
}
},
"sources":
{
"C":
{
"id": 0
}
}
}
@@ -0,0 +1 @@
--pretty-json --json-indent 4 --allow-paths .
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
pragma solidity >=0.0;
contract C {
function f() public {}
}
@@ -0,0 +1,13 @@
{
"language": "Solidity",
"sources": {
"C": {"urls": ["standard_debug_info_in_yul_and_evm_asm_print_location_only/in.sol"]}
},
"settings": {
"debug": {"debugInfo": ["location"]},
"optimizer": {"enabled": true},
"outputSelection": {
"*": {"*": ["ir", "irOptimized", "evm.assembly"]}
}
}
}
@@ -0,0 +1,229 @@
{
"contracts":
{
"C":
{
"C":
{
"evm":
{
"assembly": " /* \"C\":60:101 */
mstore(0x40, 0x80)
callvalue
dup1
iszero
tag_1
jumpi
0x00
dup1
revert
tag_1:
pop
dataSize(sub_0)
dup1
dataOffset(sub_0)
0x00
codecopy
0x00
return
stop
sub_0: assembly {
/* \"C\":60:101 */
mstore(0x40, 0x80)
callvalue
dup1
iszero
tag_1
jumpi
0x00
dup1
revert
tag_1:
pop
jumpi(tag_2, lt(calldatasize, 0x04))
shr(0xe0, calldataload(0x00))
dup1
0x26121ff0
eq
tag_3
jumpi
tag_2:
0x00
dup1
revert
/* \"C\":77:99 */
tag_3:
stop
auxdata: <AUXDATA REMOVED>
}
"
},
"ir": "/*=====================================================*
* WARNING *
* Solidity to Yul compilation is still EXPERIMENTAL *
* It can result in LOSS OF FUNDS or worse *
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:\"C\"
object \"C_6\" {
code {
/// @src 0:60:101
mstore(64, 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:\"C\"
object \"C_6_deployed\" {
code {
/// @src 0:60:101
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
let selector := shift_right_224_unsigned(calldataload(0))
switch selector
case 0x26121ff0
{
// f()
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))
}
default {}
}
if iszero(calldatasize()) { }
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 revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
revert(0, 0)
}
/// @src 0:77:99
function fun_f_5() {
}
/// @src 0:60:101
}
data \".metadata\" hex\"<BYTECODE REMOVED>\"
}
}
",
"irOptimized": "/*=====================================================*
* WARNING *
* Solidity to Yul compilation is still EXPERIMENTAL *
* It can result in LOSS OF FUNDS or worse *
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:\"C\"
object \"C_6\" {
code {
{
/// @src 0:60:101
mstore(64, 128)
if callvalue() { revert(0, 0) }
let _1 := datasize(\"C_6_deployed\")
codecopy(128, dataoffset(\"C_6_deployed\"), _1)
return(128, _1)
}
}
/// @use-src 0:\"C\"
object \"C_6_deployed\" {
code {
{
/// @src 0:60:101
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
let _1 := 0
if eq(0x26121ff0, shr(224, calldataload(_1)))
{
if callvalue() { revert(_1, _1) }
if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) }
return(128, _1)
}
}
revert(0, 0)
}
}
data \".metadata\" hex\"<BYTECODE REMOVED>\"
}
}
"
}
}
},
"sources":
{
"C":
{
"id": 0
}
}
}
@@ -0,0 +1 @@
--pretty-json --json-indent 4 --allow-paths .
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
pragma solidity >=0.0;
contract C {
function f() public {}
}
@@ -0,0 +1,13 @@
{
"language": "Solidity",
"sources": {
"C": {"urls": ["standard_debug_info_in_yul_and_evm_asm_print_none/in.sol"]}
},
"settings": {
"debug": {"debugInfo": []},
"optimizer": {"enabled": true},
"outputSelection": {
"*": {"*": ["ir", "irOptimized", "evm.assembly"]}
}
}
}
@@ -0,0 +1,218 @@
{
"contracts":
{
"C":
{
"C":
{
"evm":
{
"assembly": " mstore(0x40, 0x80)
callvalue
dup1
iszero
tag_1
jumpi
0x00
dup1
revert
tag_1:
pop
dataSize(sub_0)
dup1
dataOffset(sub_0)
0x00
codecopy
0x00
return
stop
sub_0: assembly {
mstore(0x40, 0x80)
callvalue
dup1
iszero
tag_1
jumpi
0x00
dup1
revert
tag_1:
pop
jumpi(tag_2, lt(calldatasize, 0x04))
shr(0xe0, calldataload(0x00))
dup1
0x26121ff0
eq
tag_3
jumpi
tag_2:
0x00
dup1
revert
tag_3:
stop
auxdata: <AUXDATA REMOVED>
}
"
},
"ir": "/*=====================================================*
* WARNING *
* Solidity to Yul compilation is still EXPERIMENTAL *
* It can result in LOSS OF FUNDS or worse *
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:\"C\"
object \"C_6\" {
code {
mstore(64, 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)
}
function constructor_C_6() {
}
}
/// @use-src 0:\"C\"
object \"C_6_deployed\" {
code {
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
let selector := shift_right_224_unsigned(calldataload(0))
switch selector
case 0x26121ff0
{
// f()
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))
}
default {}
}
if iszero(calldatasize()) { }
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 revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
revert(0, 0)
}
function fun_f_5() {
}
}
data \".metadata\" hex\"<BYTECODE REMOVED>\"
}
}
",
"irOptimized": "/*=====================================================*
* WARNING *
* Solidity to Yul compilation is still EXPERIMENTAL *
* It can result in LOSS OF FUNDS or worse *
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:\"C\"
object \"C_6\" {
code {
{
mstore(64, 128)
if callvalue() { revert(0, 0) }
let _1 := datasize(\"C_6_deployed\")
codecopy(128, dataoffset(\"C_6_deployed\"), _1)
return(128, _1)
}
}
/// @use-src 0:\"C\"
object \"C_6_deployed\" {
code {
{
mstore(64, 128)
if iszero(lt(calldatasize(), 4))
{
let _1 := 0
if eq(0x26121ff0, shr(224, calldataload(_1)))
{
if callvalue() { revert(_1, _1) }
if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) }
return(128, _1)
}
}
revert(0, 0)
}
}
data \".metadata\" hex\"<BYTECODE REMOVED>\"
}
}
"
}
}
},
"sources":
{
"C":
{
"id": 0
}
}
}
@@ -0,0 +1 @@
--pretty-json --json-indent 4 --allow-paths .
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
pragma solidity >=0.0;
contract C {
function f() public {}
}
@@ -0,0 +1,13 @@
{
"language": "Solidity",
"sources": {
"C": {"urls": ["standard_debug_info_in_yul_and_evm_asm_print_snippet_only/in.sol"]}
},
"settings": {
"debug": {"debugInfo": ["snippet"]},
"optimizer": {"enabled": true},
"outputSelection": {
"*": {"*": ["ir", "irOptimized", "evm.assembly"]}
}
}
}
@@ -0,0 +1,12 @@
{
"errors":
[
{
"component": "general",
"formattedMessage": "To use 'snippet' with settings.debug.debugInfo you must select also 'location'.",
"message": "To use 'snippet' with settings.debug.debugInfo you must select also 'location'.",
"severity": "error",
"type": "JSONError"
}
]
}
@@ -0,0 +1 @@
--pretty-json --json-indent 4 --allow-paths .
@@ -0,0 +1,15 @@
/// @use-src 0:"input.sol"
object "C_6_deployed" {
code {
/// @src 0:60:101 "contract C {..."
mstore(64, 128)
// f()
fun_f_5()
/// @src 0:77:99 "function f() public {}"
function fun_f_5() {
}
/// @src 0:60:101 "contract C {..."
}
}
@@ -0,0 +1,12 @@
{
"language": "Yul",
"sources": {
"C": {"urls": ["standard_yul_debug_info_print_all/in.yul"]}
},
"settings": {
"debug": {"debugInfo": ["*"]},
"outputSelection": {
"*": {"*": ["evm.assembly"]}
}
}
}
@@ -0,0 +1,36 @@
{
"contracts":
{
"C":
{
"C_6_deployed":
{
"evm":
{
"assembly": " /* \"input.sol\":60:101 */
mstore(0x40, 0x80)
tag_2
tag_1
jump\t// in
tag_2:
/* \"input.sol\":77:99 */
jump(tag_3)
tag_1:
jump\t// out
tag_3:
"
}
}
}
},
"errors":
[
{
"component": "general",
"formattedMessage": "Yul is still experimental. Please use the output with care.",
"message": "Yul is still experimental. Please use the output with care.",
"severity": "warning",
"type": "Warning"
}
]
}
@@ -0,0 +1 @@
--pretty-json --json-indent 4 --allow-paths .
@@ -0,0 +1,15 @@
/// @use-src 0:"input.sol"
object "C_6_deployed" {
code {
/// @src 0:60:101 "contract C {..."
mstore(64, 128)
// f()
fun_f_5()
/// @src 0:77:99 "function f() public {}"
function fun_f_5() {
}
/// @src 0:60:101 "contract C {..."
}
}
@@ -0,0 +1,12 @@
{
"language": "Yul",
"sources": {
"C": {"urls": ["standard_yul_debug_info_print_location_only/in.yul"]}
},
"settings": {
"debug": {"debugInfo": ["location"]},
"outputSelection": {
"*": {"*": ["evm.assembly"]}
}
}
}
@@ -0,0 +1,36 @@
{
"contracts":
{
"C":
{
"C_6_deployed":
{
"evm":
{
"assembly": " /* \"input.sol\":60:101 */
mstore(0x40, 0x80)
tag_2
tag_1
jump\t// in
tag_2:
/* \"input.sol\":77:99 */
jump(tag_3)
tag_1:
jump\t// out
tag_3:
"
}
}
}
},
"errors":
[
{
"component": "general",
"formattedMessage": "Yul is still experimental. Please use the output with care.",
"message": "Yul is still experimental. Please use the output with care.",
"severity": "warning",
"type": "Warning"
}
]
}
@@ -0,0 +1 @@
--pretty-json --json-indent 4 --allow-paths .
@@ -0,0 +1,15 @@
/// @use-src 0:"input.sol"
object "C_6_deployed" {
code {
/// @src 0:60:101 "contract C {..."
mstore(64, 128)
// f()
fun_f_5()
/// @src 0:77:99 "function f() public {}"
function fun_f_5() {
}
/// @src 0:60:101 "contract C {..."
}
}
@@ -0,0 +1,12 @@
{
"language": "Yul",
"sources": {
"C": {"urls": ["standard_yul_debug_info_print_none/in.yul"]}
},
"settings": {
"debug": {"debugInfo": []},
"outputSelection": {
"*": {"*": ["evm.assembly"]}
}
}
}
@@ -0,0 +1,34 @@
{
"contracts":
{
"C":
{
"C_6_deployed":
{
"evm":
{
"assembly": " mstore(0x40, 0x80)
tag_2
tag_1
jump\t// in
tag_2:
jump(tag_3)
tag_1:
jump\t// out
tag_3:
"
}
}
}
},
"errors":
[
{
"component": "general",
"formattedMessage": "Yul is still experimental. Please use the output with care.",
"message": "Yul is still experimental. Please use the output with care.",
"severity": "warning",
"type": "Warning"
}
]
}
@@ -0,0 +1 @@
--pretty-json --json-indent 4 --allow-paths .
@@ -0,0 +1,15 @@
/// @use-src 0:"input.sol"
object "C_6_deployed" {
code {
/// @src 0:60:101 "contract C {..."
mstore(64, 128)
// f()
fun_f_5()
/// @src 0:77:99 "function f() public {}"
function fun_f_5() {
}
/// @src 0:60:101 "contract C {..."
}
}
@@ -0,0 +1,12 @@
{
"language": "Yul",
"sources": {
"C": {"urls": ["standard_yul_debug_info_print_snippet_only/in.yul"]}
},
"settings": {
"debug": {"debugInfo": ["snippet"]},
"outputSelection": {
"*": {"*": ["evm.assembly"]}
}
}
}
@@ -0,0 +1,12 @@
{
"errors":
[
{
"component": "general",
"formattedMessage": "To use 'snippet' with settings.debug.debugInfo you must select also 'location'.",
"message": "To use 'snippet' with settings.debug.debugInfo you must select also 'location'.",
"severity": "error",
"type": "JSONError"
}
]
}
@@ -0,0 +1 @@
--strict-assembly --debug-info all
@@ -0,0 +1 @@
Warning: Yul is still experimental. Please use the output with care.
@@ -0,0 +1,15 @@
/// @use-src 0:"input.sol"
object "C_6_deployed" {
code {
/// @src 0:60:101 "contract C {..."
mstore(64, 128)
// f()
fun_f_5()
/// @src 0:77:99 "function f() public {}"
function fun_f_5() {
}
/// @src 0:60:101 "contract C {..."
}
}
@@ -0,0 +1,32 @@
======= strict_asm_debug_info_print_all/input.yul (EVM) =======
Pretty printed source:
/// @use-src 0:"input.sol"
object "C_6_deployed" {
code {
/// @src 0:60:101
mstore(64, 128)
fun_f_5()
/// @src 0:77:99
function fun_f_5()
{ }
}
}
Binary representation:
6080604052600a600e565b6010565b565b
Text representation:
/* "input.sol":60:101 */
mstore(0x40, 0x80)
tag_2
tag_1
jump // in
tag_2:
/* "input.sol":77:99 */
jump(tag_3)
tag_1:
jump // out
tag_3:
@@ -0,0 +1 @@
--strict-assembly --debug-info location
@@ -0,0 +1 @@
Warning: Yul is still experimental. Please use the output with care.
@@ -0,0 +1,15 @@
/// @use-src 0:"input.sol"
object "C_6_deployed" {
code {
/// @src 0:60:101 "contract C {..."
mstore(64, 128)
// f()
fun_f_5()
/// @src 0:77:99 "function f() public {}"
function fun_f_5() {
}
/// @src 0:60:101 "contract C {..."
}
}
@@ -0,0 +1,32 @@
======= strict_asm_debug_info_print_location_only/input.yul (EVM) =======
Pretty printed source:
/// @use-src 0:"input.sol"
object "C_6_deployed" {
code {
/// @src 0:60:101
mstore(64, 128)
fun_f_5()
/// @src 0:77:99
function fun_f_5()
{ }
}
}
Binary representation:
6080604052600a600e565b6010565b565b
Text representation:
/* "input.sol":60:101 */
mstore(0x40, 0x80)
tag_2
tag_1
jump // in
tag_2:
/* "input.sol":77:99 */
jump(tag_3)
tag_1:
jump // out
tag_3:
@@ -0,0 +1 @@
--strict-assembly --debug-info none
@@ -0,0 +1 @@
Warning: Yul is still experimental. Please use the output with care.
@@ -0,0 +1,15 @@
/// @use-src 0:"input.sol"
object "C_6_deployed" {
code {
/// @src 0:60:101 "contract C {..."
mstore(64, 128)
// f()
fun_f_5()
/// @src 0:77:99 "function f() public {}"
function fun_f_5() {
}
/// @src 0:60:101 "contract C {..."
}
}
@@ -0,0 +1,28 @@
======= strict_asm_debug_info_print_none/input.yul (EVM) =======
Pretty printed source:
/// @use-src 0:"input.sol"
object "C_6_deployed" {
code {
mstore(64, 128)
fun_f_5()
function fun_f_5()
{ }
}
}
Binary representation:
6080604052600a600e565b6010565b565b
Text representation:
mstore(0x40, 0x80)
tag_2
tag_1
jump // in
tag_2:
jump(tag_3)
tag_1:
jump // out
tag_3:
@@ -0,0 +1 @@
--strict-assembly --debug-info snippet
@@ -0,0 +1 @@
To use 'snippet' with --debug-info you must select also 'location'.
@@ -0,0 +1 @@
1
@@ -0,0 +1,15 @@
/// @use-src 0:"input.sol"
object "C_6_deployed" {
code {
/// @src 0:60:101 "contract C {..."
mstore(64, 128)
// f()
fun_f_5()
/// @src 0:77:99 "function f() public {}"
function fun_f_5() {
}
/// @src 0:60:101 "contract C {..."
}
}