繁体   English   中英

C++ - Windows 上是否有类似 addr2line 的命令

[英]C++ - Is there any command likes addr2line on Windows

如果 Windows 应用程序在没有 pdb 的情况下在用户设备上崩溃,它将产生如下调用堆栈:

TestGame  0x000000003f790000 + 1c0c9f1 
TestGame  0x000000003f790000 + 4b8a97c 
TestGame  0x000000003f790000 + 4b8a4f1 
TestGame  0x000000003f790000 + 3608413 
TestGame  0x000000003f790000 + 3630e94 
TestGame  0x000000003f790000 + 413a33e 
TestGame  0x000000003f790000 + 4151d46 
TestGame  0x000000003f790000 + 149c9e6 
TestGame  0x000000003f790000 + 149cc90 
TestGame  0x000000003f790000 + 419cddd 
TestGame  0x000000003f790000 + 41ab698 
TestGame  0x000000003f790000 + 3a909df 
TestGame  0x000000003f790000 + 3a999ff 
TestGame  0x000000003f790000 + 38fd369 
TestGame  0x000000003f790000 + 338688  
TestGame  0x000000003f790000 + 34827c  
TestGame  0x000000003f790000 + 3482da  
TestGame  0x000000003f790000 + 355e16  
TestGame  0x000000003f790000 + 5169f2e 
kernel32      0x0000000076ec0000 + 159cd   
ntdll         0x0000000076fe0000 + 5383d   

但我在开发设备上有 .PDB 文件,所以我想通过 .PDB 处理源代码行。 我知道一个命令addr2line可以通过Linux上的.so文件寻址,不知道addr2line上有没有addr2line之类的命令。

在windbg中打开TestGame.exe,您需要完全相同的二进制文件。 中断执行。 加载该版本的.pdb。 运行以下命令:

ln TestGame.exe+0x1c0c9f1

正好找到了这个: https://drmemory.org/page_symquery.html如果没有获取到模块基址,试试VS的dumpbin.exe /headers xxx.exe获取镜像基址。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM