0

我正在使用带有 xp 嵌入的windbg。尝试获取操作系统符号失败,并显示消息“找不到符号文件。默认为 ntdll.dll 导出符号”。(这对于 xp 嵌入式来说是典型的吗???)

我可以毫无问题地为自己的代码定位和加载符号和源代码。但是,单步执行代码表明代码和符号文件之间存在严重不匹配,因为 dv 返回的内存中变量的位置似乎与实际内存内容不一致(例如,分配一个变量,但之后,地址dv 声明对应于它似乎没有改变)。

我的 sympath 首先列出符号目录,然后是缓存,然后是服务器,因此缓存的符号文件不应该受到干扰。

这是没有找到 ntdll 符号文件并使用另一个不正确匹配的潜在影响,还是有其他可能导致这种情况的原因?

例子:
.sympath D:/Symbols
.symfix+
.srcpath D:/Symbols ** Yes, currently the source is in with the symbols
.reload
** (defaults to export symbols for ntdll.dll since symbol file can't be found)
bp 00401000 (break at a constructor)
g
(program runs till it hits constructor)
l+t
dv /i /t /V ** look up this pointer memory location to check constructor
** We bring up a memory window at the location the this pointer refers to and
** step through the code, but no changes appear in that memory window
** moreover a local LARGE_INTEGER whose value is set with QueryPerformanceCounter
** also appears unchanged after the call
** when the constructor returns we assign the memory address returned by
** new to a global pointer, whose memory address we look up with dt, but
** after the call that address still has 0 in it

谁能告诉我如何真正解决这个问题?

附带说明一下,我们实际上将 cdb 作为 xp 嵌入式机器上的服务器运行,并使用 windbg 的“连接到远程会话”选项。以上命令都是通过windbg执行的。

4

1 回答 1

1

在 .reload 之前执行 !sym noise 会让你知道为什么它没有找到 ntdll.dll 的符号。完全有可能它们根本没有在符号服务器上建立索引,这通常意味着你运气不好(不幸的是,真的没有人可以联系来解决这个问题)。

至于您的其他符号问题:

1)这是您的代码的发布版本吗?如果是这样,这完全是意料之中的

2)如果是调试版本,您是否 100% 确定您指向的源与目标机器匹配?在回答之前确保你是 100% :)

-斯科特

于 2010-08-31T15:50:19.673 回答