Updated Debugging the compiler (markdown)
This commit is contained in:
parent
b008822633
commit
1c7cab6c6b
|
@ -60,7 +60,7 @@ Obviously, the above assumes that "nimd" was also linked in "/usr/local/bin" or
|
|||
|
||||
### Printf debugging
|
||||
|
||||
"Printf debugging" is still the most appropriate way to debug many problems arising in compiler development. The typical usage of break points to debug the code is often less practical, because almost all of the code paths in the compiler will be executed hundreds of times before a particular section of the tested program is reached, and where the newly developed code must be activated.
|
||||
"Printf debugging" is still the most appropriate way to debug many problems arising in compiler development. The typical usage of break points to debug the code is often less practical, because almost all of the code paths in the compiler will be executed hundreds of times before a particular section of the tested program is reached where the newly developed code must be activated.
|
||||
|
||||
To work-around this problem, you'll typically introduce an if statement in the compiler code detecting more precisely the conditions where the tested feature is being used. One very common way to achieve this is to use the `mdbg` condition, which will be true only in contexts, processing expressions and statements from the currently compiled main module.
|
||||
|
||||
|
|
Loading…
Reference in New Issue