《CLR Via C#》Visual Studio編譯之後的.pdb檔案

來源:互聯網
上載者:User

標籤:.pdb   c# comipler   debug   clr   

在用Visual Studio建立項目之後,進行編譯,總會發現.pdb檔案:

650) this.width=650;" src="http://s2.51cto.com/wyfs02/M02/7D/BB/wKiom1buleaTbVZwAAAaXSrYIu0064.png" title="pdb_file.png" alt="wKiom1buleaTbVZwAAAaXSrYIu0064.png" />

在CLR Via C#中講到,.pdb檔案是用來調試用的。pdb是Program Database的簡寫,它能夠進行source code和IL之間的映射。


The compiler produces a Program Database (PDB) file only if you specify the /debug(+/full/pdbonly) switch. The PDB file helps the debugger find local variables and map the IL instructions to source code.【這是IL和Source Code之間的映射】 The /debug:full switch tells the JIT compiler that you intend to debug the assembly, and the JIT compiler will track what native code came from each IL instruction【這是IL和native code之間的映射】. This allows you to use the just-in-time debugger feature of Visual Studio to connect a debugger to an already-running process and debug the code easily【/debug:full提供的功能,是不是指“附加到進程”呢?】. Without the /debug:full switch, the JIT compiler does not, by default, track the IL to native code information, which makes the JIT compiler run a little faster and also uses a little less memory. If you start a process with the Visual Studio debugger, it forces the JIT compiler to track the IL to native code information (regardless of the /debug switch) unless you turn off the Suppress JIT Optimization On Module Load (Managed Only) option in Visual Studio.


When you create a new C# project in Visual Studio, the Debug configuration of the project has /optimize-- and /debug:full switches, and the Release configuration has /optimize+ and /debug:pdbonly switches specified.【在Visual Studio中Debug和Release兩個選項,對這兩個參數的影響】



《CLR Via C#》Visual Studio編譯之後的.pdb檔案

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.