windbg

Cannot use WinDbg and SOS in Visual Studio Immediate window

白昼怎懂夜的黑 提交于 2019-11-28 08:06:45
问题 I'm following this tutorial: link. At step 8, when I say .load sos in the Immediate Window, it just pukes expected expression . System: Win 7 x64, Visual Studio 2012 Premium. I have an installed Debugging Tools for Windows (x64) 11/14/2012, Now I installed X64 Debuggers And Tools. I have Windows SDK for Windows 7 (7.1). WinDbg.exe is in c:\Program Files\Debugging Tools for Windows (x64)\ and I can start it from start menu. However I cannot find sos.dll, which supposed to come with the

windbg命令行选项

社会主义新天地 提交于 2019-11-28 07:14:38
我们不仅可以通过GUI的方式使用Windbg,还可以通过命令行的方式使用它,且在有些需求和使用场景下,只能使用命令行模式 windbg命令行使用以下语法: windbg [ -server ServerTransport | -remote ClientTransport ] [-lsrcpath ] [ -premote SmartClientTransport ] [-?] [-ee {masm|c++}] [-clines lines] [-b] [-d] [-aExtension] [-e Event] [-failinc] [-g] [-G] [-hd] [-j] [-n] [-noshell] [-o] [-Q | -QY] [-QS | -QSY] [-robp] [-secure] [-ses] [-sdce] [-sicv] [-sins] [-snc] [-snul] [-sup] [-sflags 0xNumber] [-T Title] [-v] [-log{o|a} LogFile] [-noinh] [-i ImagePath] [-y SymbolPath] [-srcpath SourcePath] [-k [ConnectType] | -kl | -kx ExdiOptions] [-c "command"] [-pb] [-pd] [-pe]

What the “EE” means in SOS?

被刻印的时光 ゝ 提交于 2019-11-28 06:52:23
I found "EE" is a magic word for me. Inside CLR, there is a "EEClass", which is created by CLR class loader. And I don't know why it is called EEClass. Now, come to the SOS world, there are more EE here, like EEHeap, EEStack [-EE], Name2EE.... Do they stand for the same meaning here ? The CLR started life long before it was adopted to run .NET code. Started as the Universal Runtime in Project 42, a highfaluting project that failed but whose parts survived in subsequent projects, like .NET. Continued into NGWS (Next Generation Windows Services) before it evolved as the execution engine for .NET

Windbg的主题---Theme

Deadly 提交于 2019-11-28 05:08:53
主题是预配置的windbg工作区,其中包含调试信息窗口的有用配置。任何主题都可以保存为基本工作区。 Windows调试工具包中的主题作为一组注册表文件(扩展名为.reg)提供。 当您积累更多的调试会话时,会自动设置各种默认工作区。 这些默认工作区使用基本工作区作为起点。 有关默认工作区的详细信息,请参见 WinDbg的工作空间---Work Space 。 一、加载主题 在加载主题之前,我们建议您清除所有工作区数据。 这可以通过三种方式实现: 使用Windbg用户操作接口,在菜单“File”下的“ Clear Workspace ”的弹出窗体,选择所有,然后点击"OK" 删除注册表键HKCU\Software\Microsoft\Windbg\Workspaces下的内容 通过命令行删除 reg delete HKCU\Software\Microsoft\Windbg. 清除所有工作区数据后,运行其中一个主题。这些文件作为.reg文件存储在Windows安装调试工具的主题目录中。运行主题会将其设置导入注册表,重新定义基本工作区。加载主题后,可以将其更改为更符合您的偏好。 二、自定义主题 在自定义主题之前,必须先加载该主题。 加载主题后,在没有命令行参数的情况下启动windbg。这将打开基本工作区。 自定义主题有两个常见的焦点区域:设置路径和调整窗口位置。完成任何需要的调整后

WinDbg的工作空间---Work Space

和自甴很熟 提交于 2019-11-28 04:58:46
一、什么是工作空间 Windbg把和调试相关的所有配置称为 workspace 。 WinDbg使用工作空间来描述和存储调试项目的属性、参数及调试器设置等信息。工作空间与vc中的项目文件很相似。退出windbg时,它会将会话配置保存在工作区中。工作区使您能够轻松地保留从一个会话到另一个会话的设置。您还可以手动保存或清除工作区,甚至可以使用工作区保存仍在进行中的调试会话。 二、工作空间保存的信息 WinDbg的工作空间中保存了一下信息: 调试会话状态:包括,断点、打开的源文件、用户自定义别名。 调试器设置:包括符号文件路径,可执行映像文件路径,源文件路径,用I+/I-命令设置的源文件选项,日志文件设置,通过启动内核调试对话框设置内核调试连接设置,最近一次打开文件对话框所使用的路径和输出设置等 WinDbg图形界面信息:包括WinDbg窗口标题、默认字体、是否自动打开反汇编窗口、窗口在桌面的位置、打开的子窗口、以及每个子窗口的状态等。 当您使用windbg作为调试客户机时,它的工作区只保存您通过图形界面设置的值。不会保存通过调试器命令窗口所做的更改。(此限制保证只反映本地客户端所做的更改,因为调试器命令窗口接受来自所有客户端和调试服务器的输入。 此外,断点信息保存在工作区中,包括断点地址和状态。会话结束时处于活动状态的断点在下一个会话启动时处于活动状态。但是,如果尚未加载适当的模块

无聊的笔记

佐手、 提交于 2019-11-28 04:17:57
1.今天写驱动时突然发现DbgPrint在windbg里并没有输出,依稀记得那天唐鹏老哥说的ed Kd_Default_Mask 8就可以输出了。之前只是记住这个命令就完事了,但是今天突然想了解一下为啥要这么写。然后在winddbg帮助文档中找到了相应的资料。   原来我们用DbgPrintEx或者KdPrintEx输出的时候的第一个参数选择的是对应的ComponentId,第二个参数为Level。我们可以在windbg中通过修改 Kd_(ComponentId)_Mask 的值(这个值被widnbg称为importance bit field)来决定相应的消息是否被输出。     以上就是Level的一些定义的值,在windbg文档中写到:当0<=Level<=31时,Level被视为shift bit,即 importance bit field = Level<<1 。当32<=Level<=0xffffffff时, importance bit field = Level 。当我们在DbgPrintEx或者KdPrintEx中设置的Level转换成相应的importance bit field之后与我们在windbg设置的 Kd_(ComponentId)_Mask 值进行and运算之后不为0,那么这个消息将被输出。      在windbg文档中发现在windows

WinDbg 图形界面功能(一)

一曲冷凌霜 提交于 2019-11-28 02:59:48
当我们启动windbg后,我们就能看到Windbg的样子了,如下: 本部分讨论 WinDbg 图形用户界面的元素。 这些元素包括以下各项:菜单、工具栏和快捷键。菜单有: 文件菜单、编辑菜单、视图菜单、调试菜单、窗口菜单、帮助菜单。下面分别一 一简单介绍下。 一、菜单 1.1、文件菜单 打开源文件 加载特定的源文件。 此命令相当于按 CTRL + O 或单击开放源代码文件 (Ctrl + O) 按钮 ( )。 当您单击打开源文件,则打开源文件对话框随即出现。 若要打开一个文件,请执行以下操作: 在中查找列表中,选择该文件所在的目录。 默认情况下,选择上一次打开的目录。 在中类型的文件列表中,选择你想要打开的文件的类型。 仅使用所选扩展的文件将显示在打开源文件对话框。 请注意 还可以使用中的通配符模式文件名框,以显示仅具有特定扩展名的文件。 在更改之前的会话中保留新的通配符模式。 可以使用通配符模式,之间用分号分隔的任意组合。 例如,输入 *。非独占;*.H;*.CPP显示具有这些扩展名的所有文件。 最大的行中的字符数为 251。 如果找到该文件所需,双击文件名称,或单击文件名称并单击打开。若要放弃更改并关闭对话框,请单击取消。 当你指向时显示在 WinDbg 中最近打开的四个文件的名称最近使用的文件上文件菜单。 若要打开这些文件之一,请单击其名称。 关闭当前窗口

Getting windbg without the whole WDK?

落爺英雄遲暮 提交于 2019-11-28 02:51:28
Does anyone know how to get ahold of windbg without having to download the entire 620MB WDK ISO? All I can find on the net to download the debugger is this link, which says you have to get the whole WDK: http://www.microsoft.com/whdc/devtools/debugging/default.mspx . Dave Black Actually, Microsoft has now made the Debugging Tools downloadable separately from the SDK. Look for the section "Standalone Debugging Tools for Windows (WinDbg)" about mid-page: for Windows 8.1 for Windows 10 Alex Budovski Officially, you can't . But someone's been extracting them for your convenience and hosting them .

Got the error “Symbol clr!XXX not found” when debugging the CLR object\class

半城伤御伤魂 提交于 2019-11-28 02:13:46
问题 I tried to print the CLR object/class by WinDbg, however it failed. Firstly, I tried to run x clr!Thread* to get some CLR class name, the output like below. 00007ffd`68957f18 clr!ThreadStore::s_pOSContext = <no type information> 00007ffd`685b0bf0 clr!ThreadNative::SetApartmentState (<no parameter info>) 00007ffd`685b12c0 clr!ThreadNative::YieldThread (<no parameter info>) 00007ffd`6806be60 clr!Thread::ResetManagedThreadObjectInCoopMode (<no parameter info>) 00007ffd`6895e928 clr!ThreadpoolMgr

windbg crash dump analysis, high cpu usage -

三世轮回 提交于 2019-11-28 01:46:53
My application(web api) is suffering with high cpu, while analyzing dump, I see my most of the threads have this !dumpstack -: Child-SP RetAddr Caller, Callee 00000030497bec00 00007ffbb19e1118 KERNELBASE!WaitForSingleObjectEx+0x94, calling ntdll!NtWaitForSingleObject 00000030497beca0 00007ffba8375dda clr!CLRSemaphore::Wait+0xee, calling kernel32!WaitForSingleObjectEx 00000030497becd0 00007ffba837345d clr!GCCoop::GCCoop+0xe, calling clr!GetThread 00000030497bed60 00007ffba8375842 clr!ThreadpoolMgr::WorkerThreadStart+0x482, calling clr!CLRSemaphore::Wait 00000030497bee00 00007ffba8393e1e clr