在c中调试?

发布于 2024-11-04 13:33:44 字数 295 浏览 0 评论 0原文

我在我的应用程序上发现了一些错误并显示了一些相关信息:

(trunk:29564): Gtk-CRITICAL **: IA__gtk_tree_store_clear: assertion `GTK_IS_TREE_STORE (tree_store)' failed

我的问题是:

  • 29564 是什么?是应用程序代码段中堆栈的偏移量,还是内存堆栈中的堆栈偏移量?或者它到底在哪里?
  • 我该如何调试它?它(调试)将使用哪种语言(C 或 asm)?

i found some error on my app and show some regarded information :

(trunk:29564): Gtk-CRITICAL **: IA__gtk_tree_store_clear: assertion `GTK_IS_TREE_STORE (tree_store)' failed

my question is :

  • what is 29564 ?, is that offset of stack in code segment in the application, or in stack of memory ? or where is it exactly ?
  • how could i debug it ? on which language it(debugging) would be ( C or asm ) ?

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

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

发布评论

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

评论(2

恋你朝朝暮暮 2024-11-11 13:33:44

使用gdb。

在 gtk+ 应用程序中出现此错误。

您必须传递函数参数,而不是 foo(tree_store, ... ),而必须作为 foo(GTK_IS_TREE_STORE(tree_store), ...)

Use gdb.

This errors in gtk+ application.

You must pass function parameters not foo(tree_store, ... ) you must as foo(GTK_IS_TREE_STORE(tree_store), ...)

但可醉心 2024-11-11 13:33:44

正如安塞德所说,我们需要更多信息。完全盲目但有时有效的方法是在源代码树上尝试 grep -r 来查找错误消息中的各种字符串。也许您正在寻找一个名为 IA__gtk_tree_store_clear 的函数,但是您需要找出谁使用非树存储的东西调用它...

如果您确实想调试可执行文件,请弄清楚如何在构建中启用调试信息(例如,获取传递给 gcc 的 -g 标志),然后运行 ​​use gdb progname argument 来启动程序。当失败时,使用诸如反向跟踪命令(ct)之类的东西来查看调用堆栈并找出导致失败的事件链。

编辑:看起来您需要放置一个断点以防止程序实际中止,否则您将没有调用堆栈可供检查。因此,您需要找到检查断言的代码行。您可以在断点中使用条件表达式,使 gdb 仅在断言失败时停止程序。

As Ancide said we need more information. The completely blind, but sometimes effective, approach is to try grep -r on your source tree for various strings in the error message. Probably you are looking for a function called IA__gtk_tree_store_clear, but then you need to find out who is calling it with something that's not a tree store...

If you actually want to debug the exectuable, figure out how to enable debug info in the build (get a -g flag passed to gcc for example) and then run use gdb progname arguments to launch the program. When it fails, use things like the back trace command (ct) to look at the call stack and figure out the chain of events that lead up to the failure.

EDIT: looks like you'll need to put a breakpoint in to keep the program from actually aborting, otherwise you won't have a call stack to examine. So you'll need to find the line of code on which the assert is checked. You can use a conditional expression in the breakpoint to make gdb only stop the program when the assertion would fail.

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