Skip to content
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

Compatibility warning about debuginfo between neo-devpack-dotnet 3.6.2 and 3.7.1 #5

Open
Hecate2 opened this issue Feb 27, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@Hecate2
Copy link
Owner

Hecate2 commented Feb 27, 2024

The sequence points of debuginfo had been changed. Each assembly instruction now has an original piece of source code. This will affect the debugging features of Fairy.

@Hecate2 Hecate2 added the bug Something isn't working label Feb 27, 2024
@Hecate2 Hecate2 changed the title Compatibility warning Compatibility warning about debuginfo May 13, 2024
@Hecate2
Copy link
Owner Author

Hecate2 commented May 14, 2024

Should be resolved in https://github.com/Hecate2/neo-fairy-test/releases/tag/3.7.1.2 , but there may still be bugs. Feel free to comment here.

@Hecate2
Copy link
Owner Author

Hecate2 commented May 14, 2024

using Neo.SmartContract.Framework;
using Neo.SmartContract.Framework.Attributes;
using Neo.SmartContract.Framework.Services;
using System.ComponentModel;

namespace ContractTemplate
{
    [DisplayName(nameof(TestContract))]
    [ContractPermission("*", "*")]
    public class TestContract : SmartContract
    {
        public static void Main()
        {
            Runtime.BurnGas(1000);
            for (int i = 0; i < 10; ++i )
            {
                Runtime.BurnGas(1000);
                uint n = Runtime.GetNetwork();
            }
        }
    }
}

dumpnef with devpack 3.7.1:

# Method Start Main.ContractTemplate.TestContract
00 INITSLOT 02-00 # 2 local variables, 0 arguments
# Code drain_contract.cs line 14: "1000"
03 PUSHINT16 E8-03 # 1000
# Code Runtime.cs line 100: "Syscall("System.Runtime.BurnGas")"
06 SYSCALL C3-5A-8C-BC # System.Runtime.BurnGas SysCall
# Code drain_contract.cs line 15: "0"
11 PUSH0
# Code drain_contract.cs line 15: "i = 0"
12 STLOC0
13 JMP 43 # pos: 80 (offset: 67)
# Code drain_contract.cs line 17: "1000"
15 PUSHINT16 E8-03 # 1000
# Code Runtime.cs line 100: "Syscall("System.Runtime.BurnGas")"
18 SYSCALL C3-5A-8C-BC # System.Runtime.BurnGas SysCall
# Code Runtime.cs line 106: "Syscall("System.Runtime.GetNetwork")"
23 SYSCALL C5-FB-A0-E0 # System.Runtime.GetNetwork SysCall
# Code drain_contract.cs line 18: "n = Runtime.GetNetwork()"
28 STLOC1
# Code drain_contract.cs line 15: "++i"
29 LDLOC0
# Code drain_contract.cs line 15: "++i"
30 INC
# Code drain_contract.cs line 15: "++i"
31 DUP
# Code drain_contract.cs line 15: "++i"
32 PUSHINT32 00-00-00-80 # -2147483648
# Code drain_contract.cs line 15: "++i"
37 JMPGE 04 # pos: 41 (offset: 4)
# Code drain_contract.cs line 15: "++i"
39 JMP 0A # pos: 49 (offset: 10)
# Code drain_contract.cs line 15: "++i"
41 DUP
# Code drain_contract.cs line 15: "++i"
42 PUSHINT32 FF-FF-FF-7F # 2147483647
# Code drain_contract.cs line 15: "++i"
47 JMPLE 1E # pos: 77 (offset: 30)
# Code drain_contract.cs line 15: "++i"
49 PUSHINT64 FF-FF-FF-FF-00-00-00-00 # 4294967295
# Code drain_contract.cs line 15: "++i"
58 AND
# Code drain_contract.cs line 15: "++i"
59 DUP
# Code drain_contract.cs line 15: "++i"
60 PUSHINT32 FF-FF-FF-7F # 2147483647
# Code drain_contract.cs line 15: "++i"
65 JMPLE 0C # pos: 77 (offset: 12)
# Code drain_contract.cs line 15: "++i"
67 PUSHINT64 00-00-00-00-01-00-00-00 # 4294967296
# Code drain_contract.cs line 15: "++i"
76 SUB
# Code drain_contract.cs line 15: "++i"
77 DUP
# Code drain_contract.cs line 15: "++i"
78 STLOC0
# Code drain_contract.cs line 15: "++i"
79 DROP
# Code drain_contract.cs line 15: "i"
80 LDLOC0
# Code drain_contract.cs line 15: "10"
81 PUSH10
# Code drain_contract.cs line 15: "i < 10"
82 LT
83 JMPIF BC # pos: 15 (offset: -68)
# Code drain_contract.cs line 20: "}"
85 RET
# Method End Main.ContractTemplate.TestContract
86 SYSCALL C3-5A-8C-BC # System.Runtime.BurnGas SysCall
91 RET
92 SYSCALL C5-FB-A0-E0 # System.Runtime.GetNetwork SysCall
97 RET

dumpnef with devpack 3.6.2:

# Method Start Main.ContractTemplate.TestContract
00 INITSLOT 02-00 # 2 local variables, 0 arguments
# Code drain_contract.cs line 14: "Runtime.BurnGas(1000);"
03 PUSHINT16 E8-03 # 1000
06 SYSCALL C3-5A-8C-BC # System.Runtime.BurnGas SysCall
# Code drain_contract.cs line 15: "i = 0"
11 PUSH0
12 STLOC0
13 JMP 15 # pos: 34 (offset: 21)
# Code drain_contract.cs line 17: "Runtime.BurnGas(1000);"
15 PUSHINT16 E8-03 # 1000
18 SYSCALL C3-5A-8C-BC # System.Runtime.BurnGas SysCall
# Code drain_contract.cs line 18: "n = Runtime.GetNetwork()"
23 SYSCALL C5-FB-A0-E0 # System.Runtime.GetNetwork SysCall
28 STLOC1
# Code drain_contract.cs line 15: "++i"
29 LDLOC0
30 INC
31 DUP
32 STLOC0
33 DROP
# Code drain_contract.cs line 15: "i < 10"
34 LDLOC0
35 PUSH10
36 LT
37 JMPIF EA # pos: 15 (offset: -22)
# Code drain_contract.cs line 20: "}"
39 RET
# Method End Main.ContractTemplate.TestContract
40 SYSCALL C3-5A-8C-BC # System.Runtime.BurnGas SysCall
45 RET
46 SYSCALL C5-FB-A0-E0 # System.Runtime.GetNetwork SysCall
51 RET

@Hecate2 Hecate2 changed the title Compatibility warning about debuginfo Compatibility warning about debuginfo between neo-devpack-dotnet 3.6.2 and 3.7.1 May 14, 2024
@Hecate2 Hecate2 added enhancement New feature or request and removed bug Something isn't working labels May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant