I'm trying to run my program with GDB debugger. When I run it, I get a warning:
GDB: Failed to set controlling terminal: Operation not permitted
That warning appears and disappears very fast in my terminal. I already check some stackoverflow questions, but since I'm running visual studio attached to my docker (remote-container), I'm unable to apply some recommendations.
When I try a brake-point in my code, GDB does not work, and the program executes ignoring GDB.
My lauch.json configuration:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/words",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
The dockerfile configuration where I'm running my program:
FROM ubuntu:18.04
SHELL ["/bin/bash", "-c"]
RUN apt-get -y update
RUN apt-get install -y Linux-headers-generic build-essential gdb
COPY . /ejercicio