本文介绍了我如何让GDB在GLib断言失败时中断?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
code>(process:31987):GLib-CRITICAL **:g_hash_table_lookup:assertion`hash_table!= NULL'失败
但是,GDB和代码一直在继续。我希望GDB打破这个断言失败的地方,以便我可以找出它失败的原因。我没有得到更多关于这个断言在哪里的信息。有没有办法让GDB打破这种失败?
。这涵盖了所有的情况,如 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断言失败时中断?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!