为什么在 Windows 7 64 位(使用 Eclipse/Photran/Cygwin)上使用 GDB 调试 Fortran 代码时会出现缺少 DLL 错误?
我的设置如下:
- 操作系统:Windows 7 Home Premium 64位
- Eclipse:Helios 3.6.1 64位带CDT 和 Photran
- Java SE 运行时 环境:1.6.0_21
- Java 热点:64 位服务器虚拟机 (构建 17.0-b17,混合模式)
- Cygwin 1.7.2(32 位)
我的初始测试 Fortran 应用程序仅打印“Hello World!”并退出。 代码构建并运行良好,尽管 Eclipse 的“问题”选项卡中出现以下 2 个警告
Description Resource Path Location Type
Error launching external scanner info generator (gcc -E -P -v -dD C:/Users/Joe/workspace/.metadata/.plugins/org.eclipse.cdt.make.core/specs.c) HelloFortran Unknown C/C++ Problem
Error launching external scanner info generator (gcc -E -P -v -dD C:/Users/Joe/workspace/.metadata/.plugins/org.eclipse.cdt.make.core/specs.c) HelloFortran Unknown C/C++ Problem
尝试将应用程序作为本地 Fortran 应用程序进行调试时出现问题,这会导致此错误:
cygwin warning:
MS-DOS style path detected: C:\Users\Joe\workspace\HelloFortran
Preferred POSIX equivalent is: /cygdrive/c/Users/Joe/workspace/HelloFortran
.gdbinit: No such file or directory.
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
auto-solib-add on
Undefined command: "auto-solib-add". Try "help".
Error: dll starting at 0x76ba0000 not found.
Error: dll starting at 0x75230000 not found.
Error: dll starting at 0x76ba0000 not found.
Error: dll starting at 0x76aa0000 not found.
[New thread 7060.0x10dc]
[New thread 7060.0x16c0]
我猜找不到入口点因为它需要 32 位/64 位 DLL 并获取其他类型(如果我错了,请纠正我)。 GDB 版本如下:
GNU gdb 6.8.20080328 (cygwin-special)
GDB configured as "i686-pc-cygwin"
从命令行运行 GDB 给出:
[New thread 5768.0x15a0]
Error: dll starting at 0x76ba0000 not found.
Error: dll starting at 0x75230000 not found.
Error: dll starting at 0x76ba0000 not found.
Error: dll starting at 0x76aa0000 not found.
[New thread 5768.0x46c]
hellofortran () at ../HelloFortran.f90:1
1 program HelloFortran
Current language: auto; currently fortran
如果我没看错的话,应用程序确实在 GDB 中运行,并且我能够单步执行它,但是缺少 DLL 错误是关于什么的?
Dependency Walker 为我的 HelloFortran.exe 提供了以下错误
Error: Modules with different CPU types were found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
缺少的 DLL 似乎是 IESHIMS.DLL (2),从我的快速研究来看,这似乎不是一个大问题,但我不认为我的应用程序需要这样做引用这个 DLL,所以我不认为这会导致 GDB 中的错误。
所有模块的 CPU 类型均为 x64,除了:
CYGGCC_S-1.DLL
CYGGFORTRAN-3.DLL
CYGWIN1.DLL
HELLOFORTRAN.EXE
CPU 类型为 x86
我担心缺少 DLL 错误可能会损害我正确调试程序的能力(尽管该程序最终将在基于 Unix 的 HPC 上运行)所以我不应该在那里遇到这些问题,因为所有这些 DLL 似乎都与 Cygwin 有关)。
我的问题:
- 为什么会出现缺少 DLL 错误? (切换到 Eclipse/JVM 等 32 位版本可以解决这个问题吗?
- ) 可以继续,还是我应该解决 缺少 DLL 错误(如果是这样, 如何)?
编辑:我的测试程序如下:
program HelloFortran
! Force variable declaration
implicit none
! Print 'Hello World!' to the main output
write (*,*) 'Hello World!'
! End program
end program HelloFortran
My setup is as follows:
- OS: Windows 7 Home Premium 64-bit
- Eclipse: Helios 3.6.1 64-bit with CDT
and Photran - Java SE Runtime
Environment: 1.6.0_21 - Java Hotspot: 64-bit Server VM
(build 17.0-b17, mixed mode) - Cygwin 1.7.2 (32-bit)
My initial test Fortran application simply prints 'Hello World!' and exits.
The code builds and runs fine, albeit with the following 2 Warnings in the Problems tab in Eclipse
Description Resource Path Location Type
Error launching external scanner info generator (gcc -E -P -v -dD C:/Users/Joe/workspace/.metadata/.plugins/org.eclipse.cdt.make.core/specs.c) HelloFortran Unknown C/C++ Problem
Error launching external scanner info generator (gcc -E -P -v -dD C:/Users/Joe/workspace/.metadata/.plugins/org.eclipse.cdt.make.core/specs.c) HelloFortran Unknown C/C++ Problem
The problem comes when trying to debug the app as a Local Fortran Application which results in this error:
cygwin warning:
MS-DOS style path detected: C:\Users\Joe\workspace\HelloFortran
Preferred POSIX equivalent is: /cygdrive/c/Users/Joe/workspace/HelloFortran
.gdbinit: No such file or directory.
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
auto-solib-add on
Undefined command: "auto-solib-add". Try "help".
Error: dll starting at 0x76ba0000 not found.
Error: dll starting at 0x75230000 not found.
Error: dll starting at 0x76ba0000 not found.
Error: dll starting at 0x76aa0000 not found.
[New thread 7060.0x10dc]
[New thread 7060.0x16c0]
I'm guessing the entry points aren't found because it's expecting 32-/64-bit DLL and getting the other type (correct me if I'm wrong). The GDB version is as follows:
GNU gdb 6.8.20080328 (cygwin-special)
GDB configured as "i686-pc-cygwin"
Running GDB from the command-line gives:
[New thread 5768.0x15a0]
Error: dll starting at 0x76ba0000 not found.
Error: dll starting at 0x75230000 not found.
Error: dll starting at 0x76ba0000 not found.
Error: dll starting at 0x76aa0000 not found.
[New thread 5768.0x46c]
hellofortran () at ../HelloFortran.f90:1
1 program HelloFortran
Current language: auto; currently fortran
If I'm reading that correctly the application does run in GDB and I am able to step through it, but what are the missing DLL errors about?
Dependency Walker gives the following errors for my HelloFortran.exe
Error: Modules with different CPU types were found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
The missing DLLs seem to be IESHIMS.DLL (2) which from my quick research doesn't seem to be a big issue but I don't see any reason my application would need to reference this DLL so I don't think this is leading to the errors in GDB.
All of the modules have a CPU type of x64 except for:
CYGGCC_S-1.DLL
CYGGFORTRAN-3.DLL
CYGWIN1.DLL
HELLOFORTRAN.EXE
which have a CPU type of x86
I'm concerned the missing DLL errors could harm my ability to debug my program properly (although the program will eventually run on a Unix-based HPC so I shouldn't run into these issues there since all those DLLs seem to be to do with Cygwin).
My questions:
- Why do I get missing DLL errors? (Would switching to 32-bit versions of Eclipse/JVM etc fix this?)
- Am I
okay to continue, or should I solve
the missing DLL errors (and if so,
how)?
Edit: My test program is as follows:
program HelloFortran
! Force variable declaration
implicit none
! Print 'Hello World!' to the main output
write (*,*) 'Hello World!'
! End program
end program HelloFortran
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当 Win/x64 向 32 位进程发送关于属于该进程一部分的 64 位 DLL 的 DebugEvent 时,它必然会截断加载地址(64 位加载地址不适合 32 位进程) -位
LPVOID
)。最终结果是调试器看到 DLL 加载事件,但在该地址找不到任何 DLL;所以警告你。否:这是在 x64 上调试任何 32 位进程的基础(至少使用 32 位调试器)。我认为如果您使用 x64 版本的 GDB,您会摆脱警告,但我不确定 GDB/x64 是否可以在 Windows 上调试 32 位进程(x86_64 GDB 对于 i386 进程没有问题在 Linux 上,由于“多架构”支持;我不知道 Windows 版本中是否存在“多架构”)。
您不应该这样做。
是什么让您认为它是
IESHIMS.DLL
?您看到的更有可能是 WoW64.dll 和朋友。
每个在 Win/x64 上运行的 32 位应用程序都会引用
WoW64
。When Win/x64 sends a
DebugEvent
to 32-bit process about a 64-bit DLL that is part of that process, it necessarily truncates the load address (64-bit load address doesn't fit into 32-bitLPVOID
). The end result is that the debugger sees a DLL load event, but can't find any DLL at that address; so warns you.No: this is fundamental to debugging any 32-bit process on x64 (at least with 32-bit debugger). I think you would get rid of the warning if you use x64 version of GDB, but I am not sure if GDB/x64 can debug 32-bit processes on Windows (x86_64 GDB has no trouble with i386 processes on Linux due to "multi-arch" support; I don't know if "multi-arch" is present in Windows version).
You shouldn't be.
What made you think it's
IESHIMS.DLL
?More likely what you see is WoW64.dll and friends.
Every 32-bit application running on Win/x64 references
WoW64
.