From db9766ac746b7f2d34a6f09a2f528be07b4226ea Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Wed, 15 Feb 2023 13:49:19 +0300 Subject: [PATCH] Add DBG_CALL and DBG_RETURN --- include/aeb_opcodes.hrl | 2 ++ src/aeb_fate_generate_ops.erl | 2 ++ src/aeb_opcodes.erl | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/include/aeb_opcodes.hrl b/include/aeb_opcodes.hrl index 9d0638c..a0e8418 100644 --- a/include/aeb_opcodes.hrl +++ b/include/aeb_opcodes.hrl @@ -146,6 +146,8 @@ -define( 'DBG_LOC', 16#b1). -define( 'DBG_DEF', 16#b2). -define( 'DBG_UNDEF', 16#b3). +-define( 'DBG_CALL', 16#b4). +-define( 'DBG_RETURN', 16#b5). -define( 'STATICCALL', 16#fa). diff --git a/src/aeb_fate_generate_ops.erl b/src/aeb_fate_generate_ops.erl index 3cba631..8f0483f 100644 --- a/src/aeb_fate_generate_ops.erl +++ b/src/aeb_fate_generate_ops.erl @@ -245,6 +245,8 @@ ops_defs() -> , { 'DBG_LOC', 16#b1, false, true, true, ?GAS(0), [a, a], dbg_loc, {string, integer}, none, "Arg" } , { 'DBG_DEF', 16#b2, false, true, true, ?GAS(0), [a, a], dbg_def, {string, any}, none, "Arg" } , { 'DBG_UNDEF', 16#b3, false, true, true, ?GAS(0), [a, a], dbg_undef, {string, any}, none, "Arg" } + , { 'DBG_CALL', 16#b4, false, true, true, ?GAS(0), [a, a, a], dbg_call, {address, string, boolean}, none, "Arg" } + , { 'DBG_RETURN', 16#b5, false, true, true, ?GAS(0), [], dbg_return, {}, none, "Arg" } , { 'DEACTIVATE', 16#fa, false, true, true, ?GAS(10), [], deactivate, {}, none, "Mark the current contract for deactivation."} , { 'ABORT', 16#fb, true, true, true, ?GAS(10), [a], abort, {string}, none, "Abort execution (dont use all gas) with error message in Arg0."} diff --git a/src/aeb_opcodes.erl b/src/aeb_opcodes.erl index 417abfe..bc9e5fd 100644 --- a/src/aeb_opcodes.erl +++ b/src/aeb_opcodes.erl @@ -165,6 +165,8 @@ opcode({comment,X}) -> ?COMMENT(X); opcode(?DBG_LOC) -> ?DBG_LOC; opcode(?DBG_DEF) -> ?DBG_DEF; opcode(?DBG_UNDEF) -> ?DBG_UNDEF; +opcode(?DBG_CALL) -> ?DBG_CALL; +opcode(?DBG_RETURN) -> ?DBG_RETURN; opcode(?SUICIDE) -> ?SUICIDE. @@ -309,6 +311,8 @@ mnemonic({comment,_}) -> 'COMMENT' ; mnemonic(?DBG_LOC) -> 'DBG_LOC' ; mnemonic(?DBG_DEF) -> 'DBG_DEF' ; mnemonic(?DBG_UNDEF) -> 'DBG_UNDEF' ; +mnemonic(?DBG_CALL) -> 'DBG_CALL' ; +mnemonic(?DBG_RETURN) -> 'DBG_RETURN' ; mnemonic(?SUICIDE) -> 'SUICIDE' . @@ -455,6 +459,8 @@ m_to_op('SUICIDE') -> ?SUICIDE ; m_to_op('DBG_LOC') -> ?DBG_LOC ; m_to_op('DBG_DEF') -> ?DBG_DEF ; m_to_op('DBG_UNDEF') -> ?DBG_UNDEF ; +m_to_op('DBG_CALL') -> ?DBG_CALL ; +m_to_op('DBG_RETURN') -> ?DBG_RETURN ; m_to_op(Data) when 0= Data .