如何让GDB打破glib断言失败? [英] how to get GDB to break on a glib assertion failure?
问题描述
在某些地方,我没有编写的代码(但我正在尝试调试),在glib库中断言失败: code>(process:31987):GLib-CRITICAL **:g_hash_table_lookup:assertion`hash_table!= NULL'failed
然而,GDB和代码一直在继续。我想GDB打破这个断言失败的原因,以便我能找出为什么它失败。我没有给出关于这个断言在哪里的更多信息。有没有办法让GDB打破这样的失败?
打破 g_log()
。这包括所有案例,如 g_warning()
, g_critical()
等。
Somewhere in a mass of code that I did not write (but I am trying to debug), an assertion fails in the glib library:
(process:31987): GLib-CRITICAL **: g_hash_table_lookup: assertion `hash_table != NULL' failed
However, GDB and the code keeps on going. I would like GDB to break where this assertion fails so that I can find out why it is failing. I am not given any more information about where this assertion is. Is there a way to get GDB to break on such a failure?
Break on g_log()
. This covers all cases like g_warning()
, g_critical()
, etc.
这篇关于如何让GDB打破glib断言失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!