Debugging asserts in Qt Creator

后端 未结 3 1013
心在旅途
心在旅途 2021-01-03 21:17

When I hit a normal assert statement while debugging with Visual Studio I get the option to break into the debugger so I can see the entire stack trace and the local variabl

3条回答
  •  时光说笑
    2021-01-03 21:44

    You can install a handler for the messages/warnings that Qt emits, and do your own processing of them. See the documentation for qInstallMsgHandler and the example they give there. It should be easy to insert a break in a custom message handler (or indeed, just assert on your own at that point). The one small drawback is that you'll be a bit further on down the stack than where the error actually occurred, but it is a simple matter to just step up the stack until you are at the proper frame.

提交回复
热议问题