gdb:设置断点时出现内部错误

发布于 2024-10-10 13:10:35 字数 1316 浏览 0 评论 0原文

我的程序是使用 -g 标志编译的。我遇到以下问题:

1)我在头文件中的函数中设置了断点。

断点有效。现在,当我向上两级时,它应该将我带到 C 文件 (Sizer.C:505)。确实如此,但我收到大量警告:

warning: (Internal error: pc 0xff6323 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0xff6324 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0xff6323 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0xff6323 in read in psymtab, but not in symtab.)
#2  0x0000000000ff6324 in SizePacketImpl<ZValue>::begin_x (this=warning: (Internal error: pc 0xff6323 in read in psymtab, but not in symtab.)
0x4888a88, bi=warning: (Internal error: pc 0xff6323 in read in psymtab, but not in symtab.)
0x56e6968) at Sizer.C:505
505         ASSERTo(...some parameters ....);
warning: (Internal error: pc 0xff6323 in read in psymtab, but not in symtab.)

2) 如果我现在(当程序处于中断状态时上升两级后)尝试直接在 Sizer.C 中设置断点,

(gdb) break Sizer.C:504
warning: (Internal error: pc 0xff6323 in read in psymtab, but not in symtab.)

Breakpoint 3 at 0xff1bc7: file Sizer.C, line 504.
warning: (Internal error: pc 0xff6323 in read in psymtab, but not in symtab.)

程序不会停止根本就在断点处。

3)只是为了完整性:如果我在程序运行之前在 Sizer.C 中设置断点,我不会收到警告,但程序仍然不会中断。

我想在 Sizer.C 中设置断点。我该如何调试并解决这个问题?

My program is compiled with the -g flag. I am having the following problem:

1) I have set a breakpoint in a function that is in a header file.

The breakpoint works. Now, when I go two level up, it is supposed to take me to a C file (Sizer.C:505). It does, but I get loads of warnings:

warning: (Internal error: pc 0xff6323 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0xff6324 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0xff6323 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0xff6323 in read in psymtab, but not in symtab.)
#2  0x0000000000ff6324 in SizePacketImpl<ZValue>::begin_x (this=warning: (Internal error: pc 0xff6323 in read in psymtab, but not in symtab.)
0x4888a88, bi=warning: (Internal error: pc 0xff6323 in read in psymtab, but not in symtab.)
0x56e6968) at Sizer.C:505
505         ASSERTo(...some parameters ....);
warning: (Internal error: pc 0xff6323 in read in psymtab, but not in symtab.)

2) If I NOW (after going two level up when program is in the break state) try to directly set breakpoint in Sizer.C

(gdb) break Sizer.C:504
warning: (Internal error: pc 0xff6323 in read in psymtab, but not in symtab.)

Breakpoint 3 at 0xff1bc7: file Sizer.C, line 504.
warning: (Internal error: pc 0xff6323 in read in psymtab, but not in symtab.)

The program does not stop at the breakpoint at all.

3) Just for completeness' sake: If I set breakpoint in Sizer.C before the program has run, I do not get the warnings, but the program still does not break.

I want to set breakpoints in Sizer.C. How can I debug and fix this issue?

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

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

发布评论

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

评论(1

玩物 2024-10-17 13:10:35

这似乎是 gdb 中的一个错误。检查此页面:http://sourceware.org/ml/gdb-patches /2003-01/msg00074.html 了解更多详细信息。
您使用的 gdb 版本是什么?尝试升级到最新版本并重试。升级应该可以解决你的问题。

[更新]

我还找到了这个链接:http:// /sourceware.org/ml/gdb/2006-06/msg00123.html

这里提到了一种解决方法。尝试按上述方式注释代码。

if (low == 0 && (bfd_get_file_flags (obfd) & HAS_RELOC) == 0) > return 0; 

This seems to be a bug in gdb. Check this page: http://sourceware.org/ml/gdb-patches/2003-01/msg00074.html for more details.
What's the version of gdb that you are using? try to upgrade to the latest version and try again. Upgrading should fix you problem.

[Update]

I also found this link: http://sourceware.org/ml/gdb/2006-06/msg00123.html

Here a workaround is mentioned. try commenting the code as mentioned.

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