当前位置: 首页 > news >正文

WinDbg命令

WinDbg官方文档

  1. 设置源代码路径:

    .srcpath C:\SourceCode
    .srcpath C:\SrcPath1;C:\SrcPath2
    
  2. 附加源代码代码路径:

    .srcpath+ C:\SourceCode
    .srcpath+ C:\Qt\SourceCode
    
  3. 设置符号的语法相同,对应命令:

    .sympath
    .sympath+
    

    符号可以设置远程服务器

  4. 下断点:

    bp `main.cpp:100`
    
  5. 列出断点:

    bl
    
  6. 打开源代码文件:
    推荐用-a指定模块来打开文件

    .open -a MyModule!main
    

    或者得输入完整路径

    .open D:\SourceCode\main.cpp
    
  7. 断点删除/禁用

    1. 清除所有断点

      bc *	
      
    2. 清除特定断点

      bc <断点ID>
      
    3. 禁用所有断点(不删除,后续可通过be *重新启用)

      bd *
      
    4. 设置的断点会被保存到工作空间,即使清除后重新加载工作空间仍会恢复,需通过bc *再次清\除

      bu
      

.excr(显示异常上下文记录)

.call(调用函数)

?? (计算 C++ 表达式)


启动命令行

WindbgX.exe /?/accepteula - Accepts the End User License Agreement.
/c - Executes a command line after the debugger is attached.
/logo - Begins logging information to a log file. If the file exists, it will be overwritten.
/loga - Begins logging information to a log file. If the file exists, it will be appended to.
/e - Signals the event with the given handle after the next exception in a target.
/v - Enables verbose output in the debugger.
/Q - Deprecated command-line option.
/QY - Deprecated command-line option.
/QS - Deprecated command-line option.
/QSY - Deprecated command-line option.
/WX - Deprecated command-line option.
/sflags - Sets all the symbol handler options at once.
/sdce - Causes the debugger to display 'File access error' messages during symbol load.
/ses - Causes the debugger to perform a strict evaluation of all symbol files and ignore any questionable symbols.
/sicv - Causes the symbol handler to ignore the CV record.
/sins - Causes the debugger to ignore the symbol path and executable image path environment variables.
/snc - Causes the debugger to turn off C++ translation.
/snul - Disables automatic symbol loading for unqualified names.
/sup - Causes the symbol handler to search the public symbol table during every symbol search.
/n - Enables verbose output from symbol handler.
/y - Specifies the symbol path to use.
/i - Sets the image search path to use.
/premote - Connects to a process server (dbgsrv) that is already running.
/p - Specifies the decimal process ID to be debugged.
/tid - Specifies the thread ID of a thread to be resumed when the debugging session is started.
/psn - Specifies the name of the service contained in the process to be debugged. This is used to debug a process that is already running.
/pn - Specifies the name of the process to be debugged.
/z - Specifies the name of a crash dump file to debug.
/openPrivateDumpByHandle - Specifies the handle of a crash dump file to debug.
/remote - Connects to a debugging server that is already running.
/server - Creates a debugging server that can be accessed by other debuggers.
/plmPackage - Specifies the package name to launch
/plmApp - Specifies the packaged app name to launch
/debugArch - Specifies the target bitness for the debugger.
/targetArch - Specifies the architecture to use for the target when multiple are available.
/o - Debugs all processes launched by the target application (child processes).
/g - Ignores the initial breakpoint in target application.
/G - Ignores the final breakpoint in target application.
/pv - Specifies that the debugger should attach to the target process noninvasively.
/hd - Specifies that the debug heap should not be used.
/cimp - Specifies that any processes created will use an implicit command-line set by the server instead of a user-given command-line string from the client.
/T - Sets the window title.
/benchmarkStartup - Runs a startup benchmark and appends the result to a file.
/x - Enable second-chance handling only for access violation exceptions.
/xe - Enable first-chance exception handling for the specified exception.
/xd - Enable second-chance exception handling for the specified exception.
/xn - For the given exception, disable first- and second-chance-handling, and only display a message on the console.
/xi - Completely ignore the given exception, disabling first- and second-chance handling, and not outputing anything to the console.
/k - Starts a kernel debugging session.
/d - After a reboot, the debugger will break into the target computer as soon as a kernel module is loaded.
/kqm - Starts KD in quiet mode.
/kl - Starts a kernel debugging session on the same machine as the debugger.
/kx - Starts a kernel debugging session using an EXDI driver.
/bonc - Break on connection to a kernel debugging connection.
/nobonc - Don't break on connection to a kernel debugging connection.
/srcpath - Specifies the source path to use.
/lsrcpath - Specifies the source path to use.
/I - Sets WinDbgNext as the default post-mortem debugger for the system.
/IS - Sets WinDbgNext as the default post-mortem debugger for the system silently, with only errors being reported.
/? - Displays a summary of commands available.
/setupFirewallRules - Configures the required firewall rules on the local system to allow kernel debugging.
/setupFirewallRulesQuietly - Configures the required firewall rules on the local system to allow kernel debugging, and then exit.
/EnableUsbPowerManagement - Enable selective suspend and allow OS power management of USB controllers/hubs
/DisableUsbPowerManagement - Disable selective suspend and allow OS power management of USB controllers/hubs
http://www.dtcms.com/a/285570.html

相关文章:

  • FastAdmin框架超级管理员密码重置与常规admin安全机制解析-卓伊凡|大东家
  • 本地部署DeepSeek-R1并打通知识库
  • 数字地与模拟地隔离
  • 【C语言】深入理解柔性数组:特点、使用与优势分析
  • Cursor替代,公测期间免费使用Claude4
  • 首个直播流扩散(LSD)AI模型:MirageLSD,它可以实时把任意视频流转换成你的自定义服装风格——虚拟换装新体验
  • mpiigaze的安装过程一
  • 【后端】.NET Core API框架搭建(10) --配置163邮件发送服务
  • 【锂电池剩余寿命预测】TCN时间卷积神经网络锂电池剩余寿命预测(Pytorch完整源码和数据)
  • C#之线程Thread
  • ARCS系统机器视觉实战(直播回放)
  • Huber Loss(胡贝损失)详解:稳健回归的秘密武器 + Python实现
  • Unity 堆栈分析实战指南 C#
  • Copula 回归与结构方程模型:R 语言构建多变量因果关系网络
  • 机器视觉的布料丝印应用
  • React条件渲染
  • 用 React-Three-Fiber 实现雪花下落与堆积效果:从零开始的 3D 雪景模拟
  • jvm分析篇---1、先认识下dump文件
  • Linux系统安装Docker及部署Node.js 20.15.0(含pnpm、pm2)完整指南
  • Docker部署前后端分离项目——多项目共享环境部署
  • GEV/POT/Markov/点过程/贝叶斯极值全解析;基于R语言的极值统计学
  • Camera相机人脸识别系列专题分析之十七:人脸特征检测FFD算法之libhci_face_camera_api.so 296点位人脸识别检测流程详解
  • vue2 面试题及详细答案150道(81 - 90)
  • 2025阿里云黑洞自救指南:从分钟级恢复到长效免疫的实战方案
  • RPG59.玩家拾取物品三:可拾取物品的提示UI
  • Excel批量生成SQL语句 Excel批量生成SQL脚本 Excel拼接sql
  • Android studio和gradle升级后的一些错误
  • YOLO 目标检测的改进方法
  • FastExcel:革新Java生态的高性能Excel处理引擎
  • [2025CVPR-目标检测方向]FSHNet:一种用于3D物体检测的全稀疏混合网络。