FlKo
FlKo

Reputation: 845

Qt Creator and MSVC - Ignoring specific exception types on debugging?

I'm currently using Qt Creator 4.4.1 with Qt 5.9.2 and the MSVC 2015 32/64 Bit compilers to create a DLL on Windows 7.

In Qt Creator under

Projects -> Build & Run -> Desktop Qt 5.9.2 MSVC2015 xxbit -> Run -> Executable

I've specified the host application, that loads my DLL, so when I hit F5 this app gets executed and loads my DLL without a flaw.

However, on loading, the main app raises an exception which I have no hands-on, making Qt Creator showing up a message box with the following content:

The inferior stopped because it triggered an exception. Stopped in thread 0 by: Exception at 0x60251637, code 0xc0000005: write access violation at: 0x1, flags=0x0 (first chance).

I now have to close the message box and hit F5 again to proceed.

Because I have to do this for every test run, again and again, it becomes really annoying. So, is there a simplest way to tell CDB from Qt Creator to ignore only that specific type of exception?

Upvotes: 0

Views: 1730

Answers (2)

Thomas Weller
Thomas Weller

Reputation: 59303

Look at the call stack, find the relevant code and see what it does. You should find a try ... catch ... around that line. See whether you can avoid the exception in some way, typically by introducing an if ... else ....

If you cannot avoid it, and you made sure it's really safe to ignore it, start CDB with command line argument -c "sxn c0000005" or the equivalent -c "sxn av", where AV is short for "access violation". You can use sx to see all exception settings.

Upvotes: 1

邵兴臣
邵兴臣

Reputation: 1

I encountered the same problem, the problem may be caused by the variable is not initialized, for example:

QLable *lable;

If you forget to allocate memory for this variable, it will cause this error.

lable = new QLable(this);

I think you should check your variables.

Upvotes: 0

Related Questions