今天好不容易把sslic2.0調試好。Hello world!!也終於面試。激動之餘,開始了我的sscli之旅。
由於調試sscli的那幾天,我沒有停歇,直接看sscli2.0的書籍,都是英文版的。煩啊。所以就直接開始了第一個程式echo.cs。看過《Shared Source CLI 2.0 Internals》的朋友都應該知道這個程式吧,是第一個教學程式。Ctrl+c、ctrl+v。進行調試,運行csc /target:library /debug echo.cs。很簡單的啊,我完全沒想到這都會報錯:
error CS0583: Internal Compiler Error (0x80000003 at address 7C921230): likely culprit is 'PARSE'.
無語啊。後來我想到我進入sscli是運行env的時候用的checked,會不會是這個問題呢?我重新進入,env free;然後再csc /target:library /debug echo.cs。果然成功。看來是free、checked、fastchecked的問題了。
現在來看看書上對這三個模式的講解:
One of three different build variants can be established using command-line arguments to the script.
In the checked build, symbols are generated for debugging and no compiler optimizations are used when building code. Some extra instrumentation is also built into the CLI execution engine. This mode is slow but very useful when debugging.
Free mode, in contrast, is built without debugging instrumentation. It is also built using compiler optimizations so that it can be as fast as possible and will have the best performance of the three variants.
Fastchecked is a compromise between the free and checked: it preserves debug symbols and instrumentation but also uses some compiler optimizations.
本人英語比較差,自己翻譯了一點點,還是不拿出來獻醜了,大家自己看吧。