首页 > 其他分享 >NTSD(Command Line)调试DMP格式文件

NTSD(Command Line)调试DMP格式文件

时间:2023-06-11 23:01:49浏览次数:54  
标签:DMP 源代码 错误 格式文件 Command NTSD


前言:之前介绍了利用VS2005进行Dump文件的调试,功能非常强大。但VS2005是一个大程序,本文将讨论利用NTSD的Command Line 实现Dump 文件的调试。

1、  载入DMP格式文件

利用CMD打开命令行窗口,切换到NTSD所在目录。利用命令载入DMP文件:

ntsd –z dumpfileName –y symbolPath –srcpath sourcecodePath

dumpfileName:DMP格式文件路径

symbolPath:PDB文件路径

sourcecodePath:程序的源代码路径

如图1.1,若载入成功,将弹出一个NTSD窗口,如图1.2。

图1.1 载入DMP格式文件

图1.2 NTSD界面

红色的圈中显示了BUG的原因,函数IsPrefix 存在错误。0x36是错误相对于函数的偏移值。这个错误是一个Access Violation的异常,异常地址为00401036。

Note:

l  若路径中存在空格,需要用在路径前后加上引号。

l  若提示错误,根据提示查看是否由于dbghelp.dll不存在导致,安装的调试工具包中存在该动态库。

2、  定位与源代码

利用如下命令可以定位错误到源代码中:

lsp  –a 500

lsa  .

第一行命令用于设置显示的源代码行数,第二行命令将错误定位与错误行。如图:

图1.3 Analysis Result: Line of Source Code Causing Crash

从图中可以看出,第13号是导致程序错误的位置。如果希望看到变量的值,使用命令:

x

若需要详细查看某个变量的值,使用命令:

??  variableName

图1.4 Analysis Result: Value of Variable Causing Crash

 

Module Address of Your Application(显示程序模块地址)

Command:

x *!

图1.5 Application Module Information

It shows all the module address in your application.

 

Crash Stack Trace(显示程序调用堆栈)

If you want to trace the stack of application, use this command:

Command:

kb

图1.6 Application Stack Trace

It shows that function main invokes function IsPrefix then application crashes.

For more commands of NTSD, refer to debugger.chm in Microsoft Debugger Tools package.

标签:DMP,源代码,错误,格式文件,Command,NTSD
From: https://blog.51cto.com/u_130277/6459270

相关文章

  • 第16章 命令模式(Command Pattern)
    命令模式(CommandPattern)——.NET设计模式系列之十七TerryLee,2006年7月概述在软件系统中,“行为请求者”与“行为实现者”通常呈现一种“紧耦合”。但在某些场合,比如要对行为进行“记录、撤销/重做、事务”等处理,这种无法抵御变化的紧耦合是不合适的。在这种情况下,如何将“行为请求......
  • Macros for Build Commands and Properties
    //z2012-5-1712:35:17PMIS2120@CSDNPre:IFNOTEXIST$(IntDir)..\..\libmkdir$(IntDir)..\..\libPost:copy$(IntDir)$(ProjectName).lib$(IntDir)..\..\libupx.exe$(OutDir)../xxx.dll//z2012-5-1712:47:52PMIS2120@CSDNAddacallstatementbeforeal......
  • 【Checkpoint】Command for log's checkpoint - SQLserver, Oracle, PostgreSQL
    文档引子最近,SQLserver环境中的SQLalwayson因事务爆满导致磁盘持续告警,通过这次事件,记载下SQLserverAG的事务日志处理的正确方式,同时也把Oracle以及PG的相关的checkpoint问题一并做个简单的总结,并且只从结果的角度给出过程,至于具体的理论,请移步官方文档查阅。SQLserver检......
  • -bash: jps: command not found
    Linux安装openJDK找不到jps 解决办法 执行安装java-1.8.0-openjdk-develyuminstalljava-1.8.0-openjdk-devel ......
  • pip 安装错误 Command "python setup.py egg_info" failed with error code
    pythonsetup.pyinstallFile"setup.py",line7defread(rel_path:str)->str:^SyntaxError:invalidsyntax wgethttps://bootstrap.pypa.io/pip/2.7/get-pip.pypythonget-pip.pypipinstall--upgradesetuptools......
  • Linux shell command ln All In One
    LinuxshellcommandlnAllInOne硬连接vs软连接ln$manln>./man-docs/ln.md$cat./man-docs/ln.mdLN(1)UserCommandsLN(1)NAMEln-makelinksbetwe......
  • Linux shell command cut All In One
    LinuxshellcommandcutAllInOnecut截取指定符号等号后面的字符串cut截取等号后面的字符串#获取env$env#获取登录当前用户信息$env|grepUSER$env|grepUSER|cut-d"="-f2#获取登录当前用户信息$whomai$echo$USERdemos#!/usr/bin/env......
  • Raspberry Pi command line tools vcgencmd All In One
    RaspberryPicommandlinetoolsvcgencmdAllInOnevcgencmd$vcgencmd-h$vcgencmd--helpUsage:vcgencmd[-t]commandSendacommandtotheVideoCoreandprinttheresult.-tTimehowlongthecommandtakestocomplete-h,--helpShowt......
  • 【论文】基于DMPC的路径规划
    DMPC论文:《TrajectoryGenerationforMultiagentPoint-To-PointTransitionsviaDistributedModelPredictiveControl》摘要介绍了一种基于分布式模型预测控制(DMPC)的多智能体offline轨迹生成算法。通过预测未来状态并与附近的agents共享此消息,agent能够在朝着目标前......
  • centos7 dotnet command not found
    官方文档:https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/installubuntu,generic内核,安装失败解决方案:如果提示:-bash:donet:commandnotfound则执行命令试试:ln-s/usr/share/dotnet/dotnet/usr/bin/dotnet第一步:sudorpm-Uvhhttps://packages.microsoft.c......