zz: Windbg: debugging commands

zz from : http://karthikkv.blogspot.tw/2012/06/windbg-debugging-commands.html
Windbg: debugging commands

1.      !thread/!process [address] e - on x64 will not show you the meaningless Args to Child information.
2.      .frame /c [FrameNumber] - sets context to specificied stack frame. On x64 provides more reliable register information than .trap.
3.      kn - Dumps call stack with frame numbers, easier than counting stacks for .frame.
4.      .frame /r [FrameNumber] - same as .frame /c, but shows registers without changing context.Note: With .frame /c or /r you can only trust the nonvolatile registers. 
5.      k=rbp rip FrameCount - Dumps call stack starting at rbp/rip on x64. Useful when the stack is corrupt.
6.      .process/.thread /p /r [address] - sets new process context, sets .cache forcedecodeuser, and reloads user symbols.
7.      !process [address] 17 - Sets the context for this command, avoids the need for .process to see user stacks. Try !process 0 17
8.      ~~[ThreadID]s - Changes threads in user mode. Use Thread ID number from output such as !locks. Ex: ~~[1bd4]s
9.      !heap -p -a <address> - Shows information about the heap block containing <address>, even if you aren't using pageheap.
10.    ub - Unassembles starting at a location prior to your address. Accepts l<number> to specify how many instructions to go back. ub . l20
11.    !stacks 2 [FilterString] - Finds kernel mode call stacks that contain the FilterString in a symbol.
12.    !thread [address] 17 (or 1e on x64) - Sets context for this command, avoids the need for .thread/.process for user stacks.
13.    .hh [Text] - Opens the debugger help. [Text] is the topic to lookup in the index. Example: .hh !pte
14.    ?? can dump structs using C++ style expressions. Ex: ??((nt!_KTHREAD*)(0xfffffa800ea43bb0))->ApcState
15.    bp /t EThread - Sets a kernel mode breakpoint that only triggers when hit in the context of this thread.
16.    bp /p EProcess - Sets a kernel mode breakpoint that only triggers when hit in the context of this process.
17.    gc - If you run 'p' and hit a breakpoint, gc takes you where p would have gone if you had not hit the bp.
18.    gu - Go until the current function returns. Effectively this unwinds one stack frame. #windbg
19.    pc - Steps through until the next 'call' instruction. Combine with other commands to find who returned your error> pc;p;r eax
20.    pt - Steps through until the next 'ret' instruction. Similar to gu, but pt stops on the ret and gu stops after the ret.
21.    .ignore_missing_pages 1 - supresses the error: "Page 2a49 not present in the dump file. Type ".hh dbgerr004" for details"
22.    .exr -1 shows the most recent exception. Useful in user dumps of crashes, especially for no execute crashes (NX/DEP).
23.    wt - Trace calls until they return to the current address. More useful with -or to get return values. Use -l for depth.
24.    .thread /w - Changes to the WOW64 32-bit context from 64-bit kernel mode. Wow64exts doesn't work in kernel mode.
25.    ??sizeof(structure) - Gets the size of a structure, it's easier than counting.
26.    sxe ld:module.dll - Enables an exception which will break into the debugger when module.dll is loaded.
27.    vertarget - Shows OS version of the debug target. Also shows machine name, uptime, and session time (when the dump was taken).
28.    !vm 1 - In a kernel debugger, shows basic information about memory usage. Available, committed, pagefile, pool, sysptes, etc.
29.    .time - Shows session time (when dump was taken) and system uptime. In user mode shows process uptime, kernel/user time.
30.    ba w size [address] - Break on write access only. Replace size with the num bytes you want to watch. Ex: ba w 4 005d5f10
31.    .process -i <address> - Make the process active and break into the debugger. Use in live kernel debugs to get into process context.
32.    .reload /f /o - Overwrites cached files in your downstream symbol store. Useful when your store has corrupt pdbs.
33.    ->* - Use with dt to dump pointers. Example: dt _EPROCESS [Address] ObjectTable->*
34.    !for_each_module s -a @#Base @#End "PTag" - Find the drivers using pool tag "PTag".
35.    .unload [DllName] - Unloads the debug extension you didn't intend to load. Omit DllName to unload the last dll loaded.
36.    !exqueue dumps the executive worker queues. Use flags 7f to dump the worker threads and the queues.
37.    lmvm <module> - Dumps information about the module. Remember to use <module> and not <module.dll>.
38.    !thread -t TID - Dump a thread using thread ID rather than thread address. Useful when working with a critical section.
39.    !list - Walks a linked list and displays informatino for each element in a list. See blog later today for an example.
40.    .time -h # - Shows the debug session time using the timezone offset of #. Ex: .time -h 0 shows when a dump was taken in UTC.
41.    !session - Lists all of the user session IDs. A quick way to list the active sessions from a dump of a terminal server.
42.    !session -s SessionID - Changes the current session context to SessionID. Useful when looking at GDI, or other per session data.
43.    | ProcNum s - Switches to process number ProcNum. Use when debugging multiple dumps, or processes, in one windbg.
44.    !! - Launches a shell process and redirects its output to the debugger. The same as .shell, but "bang bang" sounds cooler.
45.    uf Function - Dumps the assembly for Function (name or address). Useful for optimized code that is not contiguous in memory.
46.    uf /c Function - Shows all of the calls made by Function (can be function name or address).
47.    !wow64exts.sw - switches between x64 and x86 contexts. Often used to reverse .thread /w context switch.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: Windbg10是一款面向Windows 10的调试工具,它拥有强大的调试功能和精准的代码分析能力,可以帮助我们在开发和调试过程中快速定位和修复问题。 通过Windbg10,我们可以进行内存和寄存器的实时监测,控制线程和进程的调度,查看内存分配和释放状态,分析崩溃信息,并深入了解系统行为和执行路径。同时,Windbg10还支持一系列高级调试命令和脚本语言,可以进行更加复杂和细致的调试操作。 作为一款专业的调试工具,Windbg10的学习曲线可能较为陡峭,需要对汇编语言和操作系统原理有一定的了解。但是,一旦掌握了它的基本用法,就能够有效地提高代码开发和调试效率,为软件开发和测试带来更多便利。 ### 回答2: Windbg10是一个针对Windows 10的调试工具。它是微软官方提供的强大的应用程序调试工具。它可以帮助程序开发人员识别和修复Windows应用程序的错误,并提供精确的调试信息。Windbg10可以用来分析Windows应用程序的崩溃、死锁、性能瓶颈和其他问题。 Windbg10支持多种调试技术,如内核调试、用户模式调试和远程调试。它可以分析内存转储文件,提供精确的错误信息来诊断问题。除此之外,该工具还支持脚本编程,可以用脚本自动化分析和排除问题。 总的来说,Windbg10是一个非常有用的工具,对于开发Windows应用程序的人来说,它是一个必不可少的工具。它可以帮助开发人员更快地找出错误并解决问题,从而提高应用程序的性能和可靠性。虽然Windbg10的使用可能需要一些学习和掌握,但是它的强大和效益使它成为Windows开发的必要工具之一。 ### 回答3: Windbg10是适用于Windows 10的调试工具,它能够帮助开发者对应用程序和操作系统进行调试。Windbg10可以在不同机器上远程调试运行的应用程序,并提供了用户界面和命令行两种不同的操作选择。Windbg10包含多种调试分析工具,例如命令行调试分析器(kd),调试信息文件分析器(dumpbin),性能分析器(perfview)等。通过使用Windbg10,开发者可以运用各种调试命令,例如断点(breakpoints)、单步调试(step)、查看内存(memory inspection)以及观察程序状态(watch variables)等,来定位和解决应用程序和操作系统可能存在的问题,以确保应用程序和操作系统的稳定性和可靠性。Windbg10界面简洁清晰,操作易懂,对于Windows 10开发者而言,是一款必不可少的优秀调试工具。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值