使用Windbg 调试.Net程序

Windebug调试工具 WinDebug 是一款调试工具可以调试进程的。 立即下载

一直都在使用.net做Windows Forms和WPF方面的开发,最近正在读 CLR via C#,初识.net核心的一些东东。又由看了熊力blog上用Windbg 调试分析WPF的的一些文章。

感觉Windbg这个东西还是不太容易上手的,关键是需要配置好一些东西和知道一些常用的指令。

下面就从安装Windbg开始说起。

使用windbg,首先要到微软网站上下载最先的windbg程序。网址是:http://www.microsoft.com/whdc/DevTools/Debugging/default.mspx。

安装后就可以在开始菜单找到windbg了。

要先调试.net的程序,需要使用一个扩展的dll,它在C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727路径下,文件名是sos.dll。有了它我们才能运行命令(!clrstack),拷贝一份到Windbg.exe所在的目录。

另一个关键就是调试所需的符号文件Symbol File。参考微软官网:

具体链接是:http://www.microsoft.com/whdc/devtools/debugging/debugstart.mspx#a

我们需要连接微软的symbol服务器:在Windbg File菜单下,Symbol File Path中加入这一项,

srv*c:/symbolcache*http://msdl.microsoft.com/download/symbols;

另外就是你所编写的程序的符号文件,它应该在debug目录下,扩展名是pdb的文件,把这个路径也加进来。

这样准备工作就做好了。

运行你要调试的.net程序,切换到Windbg,按F6,出现附加进程对话框。在最下面可以找到你刚启动的程序的进程,OK。

如果是第一次用的话,会需要从微软服务器上下载很多.pdb符号文件,好几十M,需要等待一些时间,尤其是如果网速不好的话。

这时,在Windbg界面的最下面会出现一个命令输入行,我们首先将sos.dll扩展加进来。

输入:.load sos.dll

确保符号文件路径已重新加载:输入:.reload

这时我们就都准备好,可以开始调试了!

输入:~,可以查看当前程序的所有线程。回显中最前面的一列是线程的编号,在输入提示符前面的0:001>表示当前的线程是1号线程。使用k命令可以显示当前线程的Stack Backtrace。

要切换到其他的线程,输入~2s,表示切换到线程2。

对于.net的托管线程,我们可以使用命令!threads查看,切换到启动的托管线程STA才能使用!clrstack命令查看。一般要切换到线程0,即输入~0s,再输入!clrstack。

本人也是刚刚开始使用windbg,难免会有很多错误,希望和大家多多交流。

windbg windebug 最新版 for win10 windbg最新版,支持win10和vs2017,包括32位和64位两个版本,共享给大家 立即下载

相关推荐

英飞凌TC377的Flash管理、UCB配置与HSM安全机制解析

本文深入解析了英飞凌TC377微控制器的Flash存储结构、UCB配置机制与HSM安全模块。详细阐述了带Cache与不带Cache的PFlash地址访问差异、利用SOTA与AB Swap实现无感OTA更新的原理,以及如何通过UCB安全配置启动流程与写保护。重点剖析了HSM硬件安全模块在密钥管理、安全启动与安全OTA中的核心作用,为开发高可靠性嵌入式系统提供实战指南。

weixin_29170327的博客 530

Windbg调试WPF的依赖属性

我们用wndbg调试时,很多时候需要查看某个控件的依赖属性值。比如:我们查看DataGridColumnHeader的Content依赖属性  1.我们用到的windbg的命令有:!do, !da -details, .formats 2.利用!do查看依赖对象的成员变量, 找到具体依赖属性的地址0:000> !do 00000000039a71d8Name:        System.Wi

muzizongheng的专栏 2400

[WeChatMsg]导出csv格式微信聊天记录的手把手教程

手把手教大家如何导出自己的聊天记录得到csv文件,即使是电脑小白也可以轻松学会o(* ̄▽ ̄*)ブ

weixin_51094633的博客 1万+

Windebug 专题

Windebug 专题 查找资料的常用网站,分享给大家 http://www.debuginfo.com/articles/easywindbg.html http://blogs.msdn.com/b/debuggingtoolbox/ http://bbs.cracktool.com/thread-12631-1-2.html http://analyze-v.com/?p=716 ...

flyingleo1981的专栏 1011

H3C-HCL模拟器-STP生成树协议实验

边缘接口的存在是为了提高网络的收敛速度和性能。由于边缘接口连接的是终端设备,这些设备通常不会产生环路,因此不需要参与生成树协议的计算和决策。边缘接口通常是指那些不会连接到其他交换机或生成树的冗余路径的接口。H3C交换机千兆口的cost默认是20,把SW2的g1/0/2接口的cost改为100;SW4是根网桥,根据STP计算,闭塞端口应该在SW1上;方法:使得SW2到SW1的cost比SW4到SW1更大;7)修改配置:把SW1连接PC的所有接口配置为边缘接口。协议的计算开销,提高网络的收敛速度。

网络工程 3001

AI编程助手驱动3D模型生成:WorkBuddy与混元生3D实战指南

3D建模是数字内容创作的核心环节,传统方法学习成本高、周期长。随着AI技术的发展,基于深度学习的3D内容生成模型正逐步改变这一现状。其原理是通过理解文本描述,自动生成对应的三维网格与纹理,极大降低了从创意到三维资产的转化门槛。这项技术的核心价值在于赋能非专业开发者与设计师,使其能快速验证想法、构建原型。在游戏开发、产品设计、虚拟展示等应用场景中,AI生成3D模型能显著提升内容生产效率。本文以腾讯云AISkills平台为依托,详细介绍了如何通过WorkBuddy智能体调用混元生3D模型,实现从自然语言指令到高

weixin_34059951的博客 475

快速入门:使用WINDBG调试.NET 程序

1.      启动WinDBG附加到要调试的进程 2.      加载SOS a.      对于.Net Runtime 2.0 .loadby sos mscorwks b.     对于.Net Runtime 4.0 .loadby sos clr 3.      加载符号 .symfix c:\symbols 4.      重新加载模块的符号文件 .reload

草莽的专栏 4000

基于 国产USRP B210 的通信+侦测+干扰三合一实验平台,解锁无线攻防全场景!

在当代复杂电磁环境与多样化通信需求并存的背景下,软件定义无线电(SDR)技术正展现出前所未有的系统灵活性与功能可重构性。由两台USRP-LW B210软件无线电设备模拟无线链路通信过程,能够模拟多种无线通信信号传输及图像传输场景,适用于通信协议验证、抗干扰测试及教学实验。,支持"通信-侦测-干扰-优化"的闭环实验流程,为无线通信领域的教学科研与工程应用提供了一套经济高效、功能完备的解决方案。系统可对通信链路信号进行快速、自动化侦测、识别、告警,并支持多种干扰信号生成、模式切换及效果评估功能。

luowave2012的博客 836

如何用 WinDbg 调试Linux上的 .NET程序

一:背景1. 讲故事最新版本 1.2402.24001.0 的WinDbg真的让人很兴奋,可以将自己伪装成 GDB 来和远程的 GDBServer 打通来实现对 Linux 上 .NET程序进行调试,这样就可以继续使用熟悉的WinDbg 命令,在这个版本中我觉得 WinDbg 不再是 WinDbg,而是 XDbg 了,画个...

weixin_40326815的博客 131

异步复位同步释放:如何确保复位信号的可靠性与时序安全

本文深入探讨了异步复位同步释放技术在数字电路设计中的关键作用,详细分析了复位信号的可靠性与时序安全问题。通过对比异步复位与同步复位的本质区别,揭示异步复位的优势与潜在风险,并提供了标准的Verilog实现方案。文章还涵盖了多时钟域下的复位同步策略、复位网络时序约束方法以及实际工程中的经验教训,为数字系统设计者提供了全面的复位信号处理指南。

weixin_29213655的博客 404

别再自己造轮子了!用MONAI Model Zoo里的预训练模型,5分钟搞定医学影像AI项目

本文介绍了如何利用MONAI Model Zoo中的预训练模型快速搭建医学影像AI项目,大幅节省开发时间和计算资源。通过实战案例展示了UNet、DenseNet121等核心模型的应用技巧,帮助临床医生和研究者5分钟内启动高质量医学影像分析,特别适合小样本场景下的病灶分割和分类任务。

weixin_33704234的博客 246

使用Windbg调试.Net程序

使用Windbg调试.Net程序是比用VS痛苦的.当然没有工具的时候用一下也是可以顶一下的. 注:写这篇文章的时候,我也是刚学习Windbg几天时间. 开始 加载程序,有两种加载方式.附加和加载程序运行. 1附加程序 附加程序是就用Windbg附加正在运行的进程.通常来说,即是跳过Main函数的某些初始化部份,通调试都是持续提供服务部份. ...

蝴蝶君的记事本 451

番外篇 | 关于YOLO11算法的改进点总结

关于YOLO11算法的改进点总结。🌈

小哥谈 2319

Windbg断点调试.net程序

程序员都知道,在生产环境中,如果没有系统日志,对问题的分析将非常的困难。即使有日志,有时候也会因为日志记录的不全面,而导致问题不能分析清楚。其实,Windbg里面有Live Debug功能,正好可以借鉴应用。 本文介绍使用Windbg在.net程序中设置断点调试的方法。Windbg在Native Code里面下断点是比较方便的,bp加上一个内存地址就可以做到。下面进入正题...

weixin_30654583的博客 296

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

如何用WinDbg调试Linux上的.NET程序

一:背景 1. 讲故事最新版本 1.2402.24001.0 的WinDbg真的让人很兴奋,可以将自己伪装成 GDB 来和远程的 GDBServer 打通来实现对 Linux 上 .NET程序进行调试,这样就可以继续使用熟悉的WinDbg 命令,在这个版本中我觉得 WinDbg 不再是 WinDbg,而是 XDbg 了,画个简图如下:简图有了,接下来就要付出实践了。二:实操 Linux 上 .NE...

farway000的博客 176

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

使用Windbg和SoS扩展调试分析.NET程序

使用Windbg和SoS扩展调试分析.NET程序 在博客堂的不是我舍不得 - High CPU in GC(都是+=惹的祸,为啥不用StringBuilder呢?)、 不是我舍不得 - .NET里面的Out Of Memory 看到很多人在问如何分析dump,所以就写下了这篇短文,抛砖引玉。一、安装 DebuggingToolsforWindows: 从以下 Microsoft 网站下载

tanliyoung的专栏 1753

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

上一篇: Learning WinDBG/SOS and Advanced Debugging by David Betz
下一篇: 常用sql
普通网友
博客等级 码龄21年 222粉丝 206原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值