【发布时间】:2009-10-25 14:32:43
【问题描述】:
我做了一个非常简单的程序,它为我自动完成了一些事情。我用 C++ 编写了它,它在 Windows 上运行。在 Codeblocks IDE 内部使用 GDB 对其进行调试时,我突然得到了许多断点。我不知道是什么导致了这个问题。断点似乎与内存问题有关......因为当我修复检测到的内存泄漏时,断点数量明显减少。
gdb 告诉我的确切内容是:
Program received signal SIGTRAP, Trace/breakpoint trap.
In ntdll!TpWaitForAlpcCompletion () (C:\Windows\system32\ntdll.dll)
我在我的程序中多次遇到这种情况。我认为我可能做错了什么,即使该程序似乎运行得很好并且它完成了我想要它做的事情。谁能告诉我是什么问题,因为我不知道在哪里看?另外,如果这不是问题,那么有谁知道如何禁用它,因为这会阻止我到达我自己设置的断点?
提前致谢!
编辑:(添加 GDB 的 where 命令的输出): 我在哪里可以检查每个函数的作用,以便我可以看到我做错了什么?
#0 0x76fefadd in ntdll!TpWaitForAlpcCompletion () from C:\Windows\system32\ntdll.dll
#1 0x0028e894 in ?? ()
#2 0x76fb272c in ntdll!RtlCreateUserStack () from C:\Windows\system32\ntdll.dll
#3 0x00657fb8 in ?? ()
#4 0x00657fb8 in ?? ()
#5 0x76f4b76a in ntdll!RtlDowncaseUnicodeChar () from C:\Windows\system32\ntdll.dll
#6 0x02070005 in ?? ()
#7 0x00000b10 in ?? ()
#8 0x0028e8dc in ?? ()
#9 0x76ff0b37 in ntdll!TpQueryPoolStackInformation () from C:\Windows\system32\ntdll.dll
#10 0x038b0000 in ?? ()
#11 0x00657fb8 in ?? ()
#12 0x76f4b76a in ntdll!RtlDowncaseUnicodeChar () from C:\Windows\system32\ntdll.dll
#13 0x6e6e9a5e in ?? ()
#14 0x038b0000 in ?? ()
#15 0x038b0000 in ?? ()
#16 0x00000000 in ?? ()
【问题讨论】:
-
当您获得 SIGTRAP 时,调用堆栈的其余部分是什么样的?请发布 GDB“where”命令的输出。
-
感谢您的回复,我将在问题中附加“where”的输出。正在编辑...