Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SIGSTOP when trying to debug application in QTCreator running on an Ubuntu 18.04 virtual machine through VirtualBox on Windows10

I am trying to debug my C++ code in QtCreator (version 4.13.1 based on Qt 5.15.1) which is running on an Ubuntu 18.04 virtual machine hosted on my Windows 10 using VirtualBox. As soon as I start the application in debug mode, I get the error:

The inferior stopped because it received a signal from the operating system.
Signal name: SIGSTOP

I've tried changing the version of QtCreator, version of gdb I'm using to debug and tried with a few different versions of my code. The error only happens when debugging with the "Run in Terminal" option selected in the Project settings. The program runs normally if executed standalone in the gnome-terminal. Any idea for what might be causing this?

enter image description here

like image 329
UbuntuUser Avatar asked Jan 11 '21 23:01

UbuntuUser


People also ask

How to start a Qt application in debugging mode?

To start an application in the debugging mode, after opening a Qt project, you can use one of the following methods: Pressing the F5 button Using the Start Debugging button, right below the usual Run button with a. similar icon, but with a small bug on it Using the main menu entries in the following order: Debug/Start. Debugging/Start Debugging.

How to debug Qt Creator on remote host?

Now, when you start debugging, Qt Creator should automatically connect over ssh to localhost as root, start gdbserver and perform debugging. It works for running without debugging too. Perhaps you should set up installation of your program on remote host, but that's a different story and it's done differently for Qmake and QBS.

Does qtcreator work with Ubuntu 18 LTS?

I recently installed Ubuntu 18.04 LTS, for the Windows Subsystem For Linux (WSL). I installed a large number of packages, including ubuntu-desktop, build-essential, qtcreator and a number of others. QTCreator itself seems to work fine for the most part.

How to connect to GDB server from Qt Creator?

Now, in Qt Creator, go Debug -> Start Debugging -> Attach to Running Debug Server. Fill in the form... the most important is the port and server address. I chose 127.0.0.1 and 2345. You can select break at main to break at the beginning of the program. GDB server doesn't start the program until you connect. Show activity on this post.


1 Answers

You should add the following 2 lines to Debugging Helper Customization:

  • handle SIGSTOP nopass
  • handle SIGSTOP nostop

Tools->Options->Debugger->Locals & Expressions

enter image description here

like image 82
Vladislav Kor Avatar answered Sep 27 '22 22:09

Vladislav Kor