diff options
author | Araq <rumpf_a@web.de> | 2013-12-16 22:26:17 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-12-16 22:26:17 +0100 |
commit | 132b6b3efee8d1be7f94545ed5fefaf64de741dc (patch) | |
tree | cc2a24dd33eadc48a621d12e89294ecd451710c9 /doc | |
parent | 01661daf76daa713d25d06d202f83c842a6f1fe3 (diff) | |
download | Nim-132b6b3efee8d1be7f94545ed5fefaf64de741dc.tar.gz |
implemented 'injectStmt'; more debug support
Diffstat (limited to 'doc')
-rw-r--r-- | doc/manual.txt | 12 | ||||
-rw-r--r-- | doc/nimrodc.txt | 13 |
2 files changed, 25 insertions, 0 deletions
diff --git a/doc/manual.txt b/doc/manual.txt index dabff3d69..371f2b9bf 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -5053,6 +5053,18 @@ Note that this pragma is somewhat of a misnomer: Other backends will provide the same feature under the same name. +Extern pragma +------------- +Like ``exportc`` or ``importc`` the `extern`:idx: pragma affects name +mangling. The string literal passed to ``extern`` can be a format string: + +.. code-block:: Nimrod + proc p(s: string) {.extern: "prefix$1".} = + echo s + +In the example the external name of ``p`` is set to ``prefixp``. + + Bycopy pragma ------------- diff --git a/doc/nimrodc.txt b/doc/nimrodc.txt index d494a0922..f5fbf3ebb 100644 --- a/doc/nimrodc.txt +++ b/doc/nimrodc.txt @@ -468,6 +468,19 @@ proc is declared in the generated code: proc myinterrupt() {.codegenDecl: "__interrupt $# $#$#".} = echo "realistic interrupt handler" + + +InjectStmt pragma +----------------- + +The `injectStmt`:idx: pragma can be used to inject a statement before every +other statement in the current module. It is only supposed to be used for +debugging: + +.. code-block:: nimrod + {.injectStmt: gcInvariants().} + + # ... complex code here that produces crashes ... LineDir option |