glist.c:没有这样的文件或目录

发布于 2024-09-04 17:43:18 字数 356 浏览 3 评论 0原文

我有 c/gtk+ 应用程序和 GList,其中填充了三个元素,当我尝试使用 gdb 运行以下代码时:

if (g_list_length(mw->img_list) > 0)
   printf(">0");
else
   printf("<0");

我看到:

程序收到信号 SIGSEGV,分段错误。 [切换到线程0xb73c4700 (LWP 7936)] IA__g_list_length (list=0x6e6920) at glist.c:767 767 glist.c:没有这样的文件或目录。 在glist.c中

它是什么?

谢谢。

I have c/gtk+ application and GList which filled three elements, when i try to run following code with gdb:

if (g_list_length(mw->img_list) > 0)
   printf(">0");
else
   printf("<0");

i see:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb73c4700 (LWP 7936)]
IA__g_list_length (list=0x6e6920) at glist.c:767
767 glist.c: No such file or directory.
in glist.c

What is it?

Thank you.

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

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

发布评论

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

评论(3

枫林﹌晚霞¤ 2024-09-11 17:43:18

这是 glib 中的一个崩溃,可能是因为你向它传递了一个错误的列表指针。调试器尝试加载源代码以向您显示崩溃的位置,但找不到它(可能是因为您只是链接到库,甚至没有方便的源代码)。

使用 gdb up 命令在调用堆栈中向上执行,直到到达代码,并检查传递给 g_list_length() 函数的参数。

This is a crash in glib, probably because you're handing it a bad pointer to a list. The debugger tries to load the source code to show you where it crashed, but can't find it (probably because you just linked to the lib, without even having the source handy).

Use the gdb up command to step upwards in the call stack until you reach your code, and inspect the argument you passed to the g_list_length() function.

时光是把杀猪刀 2024-09-11 17:43:18

您的调试器正在尝试查找 GList 的源代码来帮助您调试问题。通常,您不会安装源代码。您需要安装调试包或某种源。

如果您使用的是 Fedora 系统,debuginfo-install glib2 即可完成此操作。在 Debian 或 Ubuntu 上,可能有一个用于此目的的软件包,可能以 -dbg 结尾?

Your debugger is trying to find the source code for GList to help you to debug the problem. Typically, you won't have the source installed. You'll need to install debugging packages or source of some kind.

If you are on a Fedora system, debuginfo-install glib2 will do it. On Debian or Ubuntu, there may be a package for this, possibly ending in -dbg?

缺⑴份安定 2024-09-11 17:43:18

看起来好像它试图找到(在您的硬盘上)不存在的东西。这就是全部代码吗?

It looks as though its trying to find something(on your hard disk)that doesn't exist. Is that all of the code?

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