neo-debugger icon indicating copy to clipboard operation
neo-debugger copied to clipboard

Debugger does not detect when there is a source-code/binary mismatch

Open djnicholson opened this issue 5 years ago • 3 comments

Make a single line change to your contract, forget to build and then start debugging. The debugger will give you the illusion that you are stepping through your changed code, but you are not because you forgot to build!

The debugger should detect this and warn you or dishonor breakpoints (like when debugging regular C# code)

djnicholson avatar Jan 05 '21 03:01 djnicholson

I'm not sure how we can do this. C# debugger has the same issue if source/debug symbols are mismatched

devhawk avatar May 05 '21 00:05 devhawk

I thought that the C# debugger used to be capable of detecting this? (I assumed that the compiler was storing a hash of the source code in the PDB). Regardless though, could we not do this in the Neo compiler? (Store a hash of the input DLL(s) in the nefdbgnfo file)

djnicholson avatar May 05 '21 22:05 djnicholson

I just realized we could calculate the hash of the script in the NEF file and compare it to the hash stored in the debug info.

I just realized this is not what you meant

devhawk avatar May 06 '21 00:05 devhawk