如何让 Very Sleepy 探查器识别 C++ 中的函数名称二进制?

发布于 2024-12-22 02:14:19 字数 1536 浏览 3 评论 0原文

我有一个使用 Visual Studio 2010 构建的混合 C#/托管 C++/非托管 C++ 的工具。代码实际上分布在 .exe(我将其称为 mybinary.exe)和 .dll (mylib.dll) 中

。我们在项目上设置了 dll 和 exe 的构建设置,以便在发布版本中生成 PDB 文件。我已经确保 PDB 文件与 exe 和 pdb 位于同一目录中。但是当我调试该程序时,我仍然看不到函数的名称;我只看到地址。以下是当我在 Very Sleepy 的第一个屏幕中选择程序时,我在底部的小状态栏中得到的相关摘录:

DBGHELP: mybinary.vshost - public symbols  
         C:\Users\(me)\AppData\Local\sleepy\vshost32-clr2.pdb\(long hex string)\vshost32-clr2.pdb
...
DBGHELP: No debug info for C:\myproj\mylib.dll.  Searching for dbg file
DBGHELP: C:\myproj\mylib.dbg - file not found
DBGHELP: C:\myproj\dll\mylib.dbg - path not found
DBGHELP: C:\myproj\symbols\dll\mylib.dbg - path not found
SYMSRV:  C:\Users\peastlund\AppData\Local\sleepy\mylib.dbg\4EF1F48B13c000\mylib.dbg not found
DBGHELP: C:\myproj\mylib.dbg - file not found
DBGHELP: C:\myproj\dll\mylib.dbg - path not found
DBGHELP: C:\myproj\symbols\dll\mylib.dbg - path not found
DBGHELP: C:\myproj\mylib.dbg - file not found
DBGHELP: C:\myproj\mylib.dll missing debug info.  Searching for pdb anyway
DBGHELP: mylib - public symbols  
         C:\myproj\mylib.pdb - unmatched
...
DBGHELP: MOD: mybinary.vshost
...
DBGHELP: mybinary - private symbols & lines 
         C:\myproj\mybinary.pdb

因此,看起来 mylib.pdb 与 mylib.dll 匹配时出现问题,出于某种原因,我'我不清楚,但我会注意到我也没有获得来自 mybinary.exe 的函数的正确地址。我有一台新计算机,并且最近安装了所有内容,因此这不是“某些库已经过时”的问题。

如果有人可以提供帮助,我们将不胜感激!

编辑:实际上事实证明这并不是特定于优化代码的。其他分析器在优化 C++ 方面存在一些问题,这就是我切换到 Very Sleepy 的原因,但在测试中我现在意识到,使用 Very Sleepy 时,即使在调试模式下编译,我似乎也无法获取函数名称。

I have a tool that is mixed C#/managed C++/unmanaged C++ built with Visual Studio 2010. Code is actually spread across an .exe (I'll call it mybinary.exe) and a .dll (mylib.dll.)

I've set the build settings on the project for the dll and the exe in order to generate PDB files in release builds. I've made sure the PDB files are both in the same directory that the exe and pdb are in. But I still don't see the names of functions when I debug this program; I just see addresses. Here's the relevant excerpt of what I get in the little status bar at the bottom when I select the program in the first screen of Very Sleepy:

DBGHELP: mybinary.vshost - public symbols  
         C:\Users\(me)\AppData\Local\sleepy\vshost32-clr2.pdb\(long hex string)\vshost32-clr2.pdb
...
DBGHELP: No debug info for C:\myproj\mylib.dll.  Searching for dbg file
DBGHELP: C:\myproj\mylib.dbg - file not found
DBGHELP: C:\myproj\dll\mylib.dbg - path not found
DBGHELP: C:\myproj\symbols\dll\mylib.dbg - path not found
SYMSRV:  C:\Users\peastlund\AppData\Local\sleepy\mylib.dbg\4EF1F48B13c000\mylib.dbg not found
DBGHELP: C:\myproj\mylib.dbg - file not found
DBGHELP: C:\myproj\dll\mylib.dbg - path not found
DBGHELP: C:\myproj\symbols\dll\mylib.dbg - path not found
DBGHELP: C:\myproj\mylib.dbg - file not found
DBGHELP: C:\myproj\mylib.dll missing debug info.  Searching for pdb anyway
DBGHELP: mylib - public symbols  
         C:\myproj\mylib.pdb - unmatched
...
DBGHELP: MOD: mybinary.vshost
...
DBGHELP: mybinary - private symbols & lines 
         C:\myproj\mybinary.pdb

So it looks like there's a problem matching mylib.pdb to mylib.dll, for some reason I'm unclear on, but I'll note that I don't get proper addresses for functions that are from mybinary.exe either. I have a new computer with all-recent installs so this isn't a "some library is way outdated" problem.

Much appreciated if anyone can assist with this!

EDIT: Actually it turns out this is not specific to optimized code. Other profilers had some issues with optimized C++, which is why I switched to Very Sleepy, but on testing I realize now that with Very Sleepy I don't seem to be able to get function names even when I compile in debug mode.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡莣 2024-12-29 02:14:20

确保以下各项:

  1. 您已将符号搜索路径(工具 -> 选项)设置为本地路径
  2. 首先启动应用程序,然后启动 sleepy 和配置文件
  3. 在应用程序终止之前停止分析

Ensure the following:

  1. You have set the symbols search path (tools->options) to your local path
  2. Start your application first, then start the sleepy and profile
  3. Stop profiling before application terminates
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文