C # debug skills and decompiler

Learned here, if we do take a break, where we learn about debugging skills.

I remember once, when I had just engaged in industrial control industry, the master took me to the site commissioning, had just graduated, is really two of a smear, what is not known. Equipment was a problem, need to debug PLC programs,

Where to find the problem in the, in the end to identify which sensor is not triggered, or program bug, or is it some other reason, watching the master in the program, interaction to interaction, to see my eyes, ridiculous.

Later, with the increase in length of service, the monitoring program has become commonplace. This analogy is to the commissioning of our C # program, I think the principle is roughly the same, where there is an exception, where it monitors, a little area to export the problem.

C # debugging, follow these steps:

(1) break point: local estimates procedural issues that may arise. If you can not determine exactly, you can break point at the entrance of the program. Step by step to narrow the scope

(2) executes a program (similar to the PLC ONLINE), observed during program execution.

(3) add the relevant variables, watch variables change process is in line with expectations, and summarize the law.

(4) analysis of the problem, the problem found by observing the value of variable

(5) to modify the code, re-run.

Commissioning of several commonly used keys:

F11: single-step operation

F10: process-by-process operation (not into the internal method)

Guess you like

Origin www.cnblogs.com/LiyuLi/p/12096931.html