为什么 WinDbg 无法从带有 Service Pack 2 x86 零售符号下载的 Windows Server 2003 加载符号?

发布于 2024-12-27 21:15:34 字数 5246 浏览 5 评论 0原文

我在 Windows XP Professional Version 2002 Service Pack 3 上使用 Microsoft Visual Studio 2005 Verison 8.0.50727.762 (SP.050727-7600) 编写了一个名为“Foo”的 C++ 项目。我将该项目构建到 Foo.exe 中。然后,我将文件 Foo.exe 复制到 Windows Server 2003 Enterprise Edition Service Pack 2。它运行良好。

现在,我尝试使用 WinDbg:6.12.0002.663 X86 版本 5.2 对其进行调试。

未设置符号路径、源路径或图像路径

当我从“文件>”打开C:\foo\Foo.exe时打开“可执行文件”菜单,我看到此错误:

*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll -

Foo.pdb 不存在于 Foo.exe 所在的同一文件夹中。为什么我没有看到 Foo.exe 的错误?

在 WinDbg 中运行命令 ld * 时,我看到以下错误:

0:000> ld *
*** ERROR: Module load completed but symbols could not be loaded for Foo.exe
Symbols loaded for Foo
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\system32\msvcrt.dll - 
Symbols loaded for msvcrt
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\system32\kernel32.dll - 
Symbols loaded for kernel32
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262B86\MSVCR80.dll - 
Symbols loaded for MSVCR80
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262B86\MSVCP80.dll - 
Symbols loaded for MSVCP80
Symbols already loaded for ntdll

现在,让我展示两次修复它的尝试。一个有效,另一个无效。

下载带有 Service Pack 2 x86 零售符号的 Windows Server 2003 不起作用

我访问了 http://msdn.microsoft.com/en-us/windows/hardware/gg463028 并下载:

带有 Service Pack 2 的 Windows Server 2003 x86 零售符号,所有语言(文件大小:154 MB - 大多数客户都需要这个包。)

我运行它并安装了符号在C:\Symbols中。在 WinDbg 中,我将符号路径设置为:

C:\Symbols;C:\MySymbols

C:\MySymbols 包含 Foo.exe 的符号,其文件名为:Foo.pdb。

从“文件>”打开C:\foo\Foo.exe打开“可执行文件”菜单,我得到了上一节中提到的相同错误。

不过,ld * 命令这次显示的错误较少。

0:000> ld *
Symbols loaded for Foo
Symbols loaded for msvcrt
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\system32\kernel32.dll - 
Symbols loaded for kernel32
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262B86\MSVCR80.dll - 
Symbols loaded for MSVCR80
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262B86\MSVCP80.dll - 
Symbols loaded for MSVCP80
Symbols already loaded for ntdll

使用 Microsoft Symbol Server 修复了这个问题

这次我将符号路径设置为:

SRV*C:\MicrosoftSymbols*http://msdl.microsoft.com/download/symbols;C:\MySymbols

现在,从“文件 > C:\foo\Foo.exe”打开 C:\foo\Foo.exe打开“可执行文件”菜单,我没有收到任何错误。我发现C:\microsoftsymbols\ntdll.pdb\F7024C7F15FE4BEA992FF38BE58AC11C2\ntdll.pdb被自动下载。

这次 ld * 命令也运行良好,没有任何错误。

0:000> ld *
Symbols loaded for Foo
Symbols loaded for msvcrt
Symbols loaded for kernel32
Symbols loaded for MSVCR80
Symbols loaded for MSVCP80
Symbols already loaded for ntdll

命令运行时会自动下载以下附加符号。

C:\microsoftsymbols\kernel32.pdb\BE496DC9472F4438B080C70594D8F9CC2\kernel32.pdb
C:\microsoftsymbols\msvcp80.i386.pdb\E8A9423E890A4ADDB38F8F756268437C1\msvcp80.i386.pdb
C:\microsoftsymbols\msvcr80.i386.pdb\54C9E2F351544D1CB39517DC4B299EA81\msvcr80.i386.pdb
C:\microsoftsymbols\msvcrt.pdb\A7F38CEE7E684B94B7AA9FFFCAB446851\msvcrt.pdb

问题

  1. 当未指定符号路径时,为什么我没有看到有关 Foo.exe 符号文件的错误?
  2. 为什么下载带有 Service Pack 2 x86 零售符号的 Windows Server 2003 并将其路径指定为符号路径不起作用?

更多信息

如果它可以帮助您回答我的问题,这里是从 winmsd.exe 获取的我的系统详细信息 >系统概要:

OS Name: Microsoft(R) Windows(R) Server 2003, Enterprise Edition
Version: 5.2.3790 Service Pack 2 Build 3790
Other OS Description : Not Available
OS Manufacturer: Microsoft Corporation
System Name: EULER
System Manufacturer: VMware, Inc.
System Model: VMware Virtual Platform
System Type: X86-based PC
Processor: x86 Family 16 Model 4 Stepping 2 AuthenticAMD ~2417 Mhz
Processor: x86 Family 16 Model 4 Stepping 2 AuthenticAMD ~2416 Mhz
BIOS Version/Date: Phoenix Technologies LTD 6.00, 7/22/2008
SMBIOS Version: 2.4
Windows Directory: C:\WINDOWS
System Directory: C:\WINDOWS\system32
Boot Device: \Device\HarddiskVolume1
Locale: United States
Hardware Abstraction Layer: Version = "5.2.3790.3959 (srv03_sp2_rtm.070216-1710)"
User Name: Not Available
Time Zone: India Standard Time
Total Physical Memory: 3,839.45 MB
Available Physical Memory: 1.56 GB
Total Virtual Memory: 5.60 GB
Available Virtual Memory: 3.33 GB
Page File Space: 2.00 GB
Page File: C:\pagefile.sys

I wrote a C++ project called 'Foo' using Microsoft Visual Studio 2005 Verison 8.0.50727.762 (SP.050727-7600) on Windows XP Professional Version 2002 Service Pack 3. I built the project into Foo.exe. Then, I copied the file Foo.exe to a Windows Server 2003 Enterprise Edition Service Pack 2. It runs fine.

Now, I try to debug it using WinDbg:6.12.0002.663 X86 Version 5.2.

No symbol path, source path or image path is set

When I open C:\foo\Foo.exe from the 'File > Open Executable' menu, I see this error:

*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll -

Foo.pdb is not present in the same folder where Foo.exe is present. Why do I not see an error for Foo.exe?

On running the command ld * in WinDbg, I see these errors:

0:000> ld *
*** ERROR: Module load completed but symbols could not be loaded for Foo.exe
Symbols loaded for Foo
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\system32\msvcrt.dll - 
Symbols loaded for msvcrt
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\system32\kernel32.dll - 
Symbols loaded for kernel32
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262B86\MSVCR80.dll - 
Symbols loaded for MSVCR80
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262B86\MSVCP80.dll - 
Symbols loaded for MSVCP80
Symbols already loaded for ntdll

Now, let me show two attempts to fix it. One worked, the other didn't.

Downloading Windows Server 2003 with Service Pack 2 x86 retail symbols didn't work

I went to http://msdn.microsoft.com/en-us/windows/hardware/gg463028 and downloaded:

Windows Server 2003 with Service Pack 2 x86 retail symbols, all languages (File size: 154 MB - Most customers want this package.)

I ran it and installed the symbols in C:\Symbols. In WinDbg, I set the symbol path as:

C:\Symbols;C:\MySymbols

C:\MySymbols contained the symbol for Foo.exe which had a file-name: Foo.pdb.

On opening C:\foo\Foo.exe from the 'File > Open Executable' menu, I got the same error mentioned in the previous section.

However, the ld * command showed fewer errors this time.

0:000> ld *
Symbols loaded for Foo
Symbols loaded for msvcrt
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\system32\kernel32.dll - 
Symbols loaded for kernel32
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262B86\MSVCR80.dll - 
Symbols loaded for MSVCR80
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262B86\MSVCP80.dll - 
Symbols loaded for MSVCP80
Symbols already loaded for ntdll

Using Microsoft Symbol Server fixed it

This time I set the symbol path as:

SRV*C:\MicrosoftSymbols*http://msdl.microsoft.com/download/symbols;C:\MySymbols

Now, on opening C:\foo\Foo.exe from the 'File > Open Executable' menu, I got no errors. I found that C:\microsoftsymbols\ntdll.pdb\F7024C7F15FE4BEA992FF38BE58AC11C2\ntdll.pdb was downloaded automatically.

This time ld * command also ran fine without any errors.

0:000> ld *
Symbols loaded for Foo
Symbols loaded for msvcrt
Symbols loaded for kernel32
Symbols loaded for MSVCR80
Symbols loaded for MSVCP80
Symbols already loaded for ntdll

The following additional symbols were downloaded automatically while the command was running.

C:\microsoftsymbols\kernel32.pdb\BE496DC9472F4438B080C70594D8F9CC2\kernel32.pdb
C:\microsoftsymbols\msvcp80.i386.pdb\E8A9423E890A4ADDB38F8F756268437C1\msvcp80.i386.pdb
C:\microsoftsymbols\msvcr80.i386.pdb\54C9E2F351544D1CB39517DC4B299EA81\msvcr80.i386.pdb
C:\microsoftsymbols\msvcrt.pdb\A7F38CEE7E684B94B7AA9FFFCAB446851\msvcrt.pdb

Questions

  1. Why did I not see an error regarding symbol file for Foo.exe when no symbol path was specified?
  2. Why downloading Windows Server 2003 with Service Pack 2 x86 retail symbols and specifying the path to it as the symbol path didn't work?

More information

In case it helps you to answer my question, here is my system details as obtained from winmsd.exe > System Summary:

OS Name: Microsoft(R) Windows(R) Server 2003, Enterprise Edition
Version: 5.2.3790 Service Pack 2 Build 3790
Other OS Description : Not Available
OS Manufacturer: Microsoft Corporation
System Name: EULER
System Manufacturer: VMware, Inc.
System Model: VMware Virtual Platform
System Type: X86-based PC
Processor: x86 Family 16 Model 4 Stepping 2 AuthenticAMD ~2417 Mhz
Processor: x86 Family 16 Model 4 Stepping 2 AuthenticAMD ~2416 Mhz
BIOS Version/Date: Phoenix Technologies LTD 6.00, 7/22/2008
SMBIOS Version: 2.4
Windows Directory: C:\WINDOWS
System Directory: C:\WINDOWS\system32
Boot Device: \Device\HarddiskVolume1
Locale: United States
Hardware Abstraction Layer: Version = "5.2.3790.3959 (srv03_sp2_rtm.070216-1710)"
User Name: Not Available
Time Zone: India Standard Time
Total Physical Memory: 3,839.45 MB
Available Physical Memory: 1.56 GB
Total Virtual Memory: 5.60 GB
Available Virtual Memory: 3.33 GB
Page File Space: 2.00 GB
Page File: C:\pagefile.sys

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

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

发布评论

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

评论(2

感性 2025-01-03 21:15:34

当未指定符号路径时,为什么我没有看到有关 Foo.exe 符号文件的错误?

答案1:

当windbg尝试加载Foo的符号时,你这样做了

0:000> ld *
   *** ERROR: Module load completed but symbols could not be loaded for Foo.exe
   Symbols loaded for Foo

第一次加载时它没有显示的原因是windbg一开始没有尝试加载foo的符号。很可能是因为 Foo 尚未被调用。程序刚刚启动,你的程序逻辑实际上还没有被调用。


为什么下载带有 Service Pack 2 x86 零售符号的 Windows Server 2003 并将其路径指定为符号路径不起作用?

对 2 的回答:

我不能 100% 肯定地说,但很可能已经应用了安全补丁,因此零售符号中包含的 pdb 不包含更改。当您访问 MS 站点时,您可以获得所有已发布版本的 DLL(包括修补版本)的所有符号。

Why did I not see an error regarding symbol file for Foo.exe when no symbol path was specified?

Answer to 1:

You did when windbg tried to load the symbols for Foo

0:000> ld *
   *** ERROR: Module load completed but symbols could not be loaded for Foo.exe
   Symbols loaded for Foo

The reason that it didn't show up when you first loaded was that windbg didn't try to load the symbols at first for foo. Most likely because Foo had yet to be called. The program was just starting up and your program logic hadn't actually been called yet.


Why downloading Windows Server 2003 with Service Pack 2 x86 retail symbols and specifying the path to it as the symbol path didn't work?

Answer to 2:

I can't say with 100% certainty, but most likely security patches had been applied so that the pdbs that were included with the retail symbols didn't include the changes. When you went to MS site you can get all the symbols for all released versions of the DLLs including patched versions.

人心善变 2025-01-03 21:15:34

当没有时,为什么我没有看到有关 Foo.exe 符号文件的错误
符号路径已指定?

虽然前面的答案是正确的,但请注意,图像文件默认包含对其 PDB 的构建位置的引用。因此,WinDBG 可以神奇地找到您在本地计算机上构建的映像的 PDB。这里有更详细的解释:

http://analyze-v.com/?p=245

Why did I not see an error regarding symbol file for Foo.exe when no
symbol path was specified?

While the previous answer is correct, note that image files contain a reference the build location of their PDBs by default. Thus, it's possible for WinDBG to magically find the PDB for an image that you built on your local machine. This is explained in more detail here:

http://analyze-v.com/?p=245

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文