Add DBG_CONTRACT op

This commit is contained in:
Gaith Hallak 2023-03-19 13:03:42 +03:00
parent bf3a692e0d
commit d85e697679
3 changed files with 5 additions and 0 deletions

View File

@ -146,6 +146,7 @@
-define( 'DBG_LOC', 16#b1).
-define( 'DBG_DEF', 16#b2).
-define( 'DBG_UNDEF', 16#b3).
-define( 'DBG_CONTRACT', 16#b4).
-define( 'STATICCALL', 16#fa).

View File

@ -245,6 +245,7 @@ ops_defs() ->
, { 'DBG_LOC', 16#b1, false, true, true, ?GAS(0), [a, a], dbg_loc, {string, integer}, none, "Debug Op: Execution location. Args = {file_name, line_num}" }
, { 'DBG_DEF', 16#b2, false, true, true, ?GAS(0), [a, a], dbg_def, {string, any}, none, "Debug Op: Define a variable. Args = {var_name, register}" }
, { 'DBG_UNDEF', 16#b3, false, true, true, ?GAS(0), [a, a], dbg_undef, {string, any}, none, "Debug Op: Undefine a variable. Args = {var_name, register}" }
, { 'DBG_CONTRACT', 16#b4, false, true, true, ?GAS(0), [a], dbg_contract, {string}, none, "Debug Op: Name the current contract. Args: {contract_name}"}
, { '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."}

View File

@ -165,6 +165,7 @@ opcode({comment,X}) -> ?COMMENT(X);
opcode(?DBG_LOC) -> ?DBG_LOC;
opcode(?DBG_DEF) -> ?DBG_DEF;
opcode(?DBG_UNDEF) -> ?DBG_UNDEF;
opcode(?DBG_CONTRACT) -> ?DBG_CONTRACT;
opcode(?SUICIDE) -> ?SUICIDE.
@ -309,6 +310,7 @@ mnemonic({comment,_}) -> 'COMMENT' ;
mnemonic(?DBG_LOC) -> 'DBG_LOC' ;
mnemonic(?DBG_DEF) -> 'DBG_DEF' ;
mnemonic(?DBG_UNDEF) -> 'DBG_UNDEF' ;
mnemonic(?DBG_CONTRACT) -> 'DBG_CONTRACT' ;
mnemonic(?SUICIDE) -> 'SUICIDE' .
@ -455,6 +457,7 @@ 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_CONTRACT') -> ?DBG_CONTRACT ;
m_to_op(Data) when 0=<Data, Data=<255
-> Data .