2008年1月23日
更新:程序员的思维模式都差不多,Kerem Kusmezer 和 John Robbin 发布了一个类似的工具.NET Mass Downloader。既然有的用我就不重新发明轮子了,下面那个项目停止维护,有需求的朋友直接用那个工具好了,具体使用说明可以参考
Download All the .NET Reference Source Code at Once with Net Mass Downloader
更新:在 sourceforge 上申请了一个项目,有兴趣的朋友可以上去下载代码,或者提交bug和改进建议。不过我估计也就年后才有时间继续处理,暂且挖个坑反正这里吧,呵呵
从去年MS就开始喊着要开放.NET源代码,如今终于在一个含糊不清的授权协议下,通过Source Server的方式放了出来。虽然是如愿开源,但目前只提供几个核心模块,而且还限制必须在VS2008里面在线访问。 其实既然决定开放,何必搞那么多限制出来,让偶等用着不爽还得自己动手丰衣足食,写个程序直接模拟VS2008获取源码的行为,一次性全部拖回来备用。 空口无凭,上载一个 System.Xml 的源码包,和一个理论上能跑的程序原型,有兴趣的朋友可以试试。回头有时间了把相关代码整理一下再放出来,下面先大概说一下思路。 首先,VS2008虽然要打个补丁才能用源码调试,但这并不是下载源码的必要条件。MS发布源码所依赖的Source Server的机制,很早就通过 WinDbg 的发布包引入了。有兴趣的朋友可以使用 WinDbg 工具自己架设 Source Server,具体步骤请参考 %Debugging Tools for Windows%\sdk\srcsrv\ 目录下文档和脚本。 而这个 Source Server 说白就是从 .pdb 调试符号文件里面,获取被绑定的已索引文件列表,然后根据系统_NT_SOURCE_PATH环境变量指定的服务器,拼接出一个 URL 然后通过http下载。具体这块的配置,可以参考 Configuring Visual Studio to Debug .NET Framework Source Code 讨厌的是MS在dbghelp.dll里面做了一些手脚,直接通过url去下载调试符号和源码是不被允许的。刚好scz前面研究过symbol server的行为,基本确定ms服务端是根据user agent来进行判断的。也就是说在发起请求时,把当前http的user agent改成ms认可的方式,就能够模拟dbghelp.dll通过srcsrv.dll完成的工作,具体代码类似
posted @ 2008-01-23 02:50 Flier Lu 阅读(4511) | 评论 (21) | 编辑
2006年2月19日
posted @ 2006-02-19 23:40 Flier Lu 阅读(5144) | 评论 (7) | 编辑
2006年2月18日
posted @ 2006-02-18 00:49 Flier Lu 阅读(4530) | 评论 (4) | 编辑
2006年2月17日
posted @ 2006-02-17 00:16 Flier Lu 阅读(5565) | 评论 (11) | 编辑
2005年12月30日
posted @ 2005-12-30 01:36 Flier Lu 阅读(3360) | 评论 (2) | 编辑
2005年12月27日
posted @ 2005-12-27 00:28 Flier Lu 阅读(8703) | 评论 (10) | 编辑
2005年11月20日
posted @ 2005-11-20 16:11 Flier Lu 阅读(2050) | 评论 (3) | 编辑
2005年8月28日
原文:http://www.blogcn.com/User8/flier_lu/blog/24143356.html Yun Jin 的 blog 上最近有两篇有趣的文章,介绍了 CLR 中线程概念的内部实现以及缺省提供的特殊线程。 Thread, System.Threading.Thread, and !Threads (I) Special threads in CLR 其中提到 EE 在启动时会初始化一个专用的调试线程。2. Debugger helper thread. As its name suggests, this thread helps interop debugger to get information of the managed process and to execute certain debugging operations. The thread is created when EE initializes debugger during start up. In Rotor, the thread proc for this thread is DebuggerRCThread::ThreadProcStatic (debug\ee\Rcthread.cpp). Also see Mike Stall's blog about impact of this helper thread。 与传统的 Native Win32 程序不同,CLR 对调试的支持是通过 In-Proc 模式提供的。Mike Stall 在其 blog 上介绍了这种模式的优劣: Implications of using a helper thread for debugging 首先,我们来看看运行时的调试支持情况。 用 windbg 启动一个 CLR 程序后,可以用 ~ 命令和 sos 的 ~threads 命令,看看 Native 线程和 CLR 线程的对应情况如下:
posted @ 2005-08-28 22:15 Flier Lu 阅读(3683) | 评论 (10) | 编辑
2005年8月24日
posted @ 2005-08-24 22:55 Flier Lu 阅读(1159) | 评论 (1) | 编辑
2005年8月21日
posted @ 2005-08-21 11:29 Flier Lu 阅读(1127) | 评论 (3) | 编辑
Powered by: 博客园 Copyright © Flier Lu