Skip to content

Commit 774d620

Browse files
authored
add debugging commands (#2)
1 parent e9434ec commit 774d620

File tree

5 files changed

+39
-3
lines changed

5 files changed

+39
-3
lines changed

.stignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
.git
22
.github
3-
.vscode
4-
hello-world
3+
.vscode

.vscode/launch.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "C++ Attach",
9+
"type": "cppdbg",
10+
"request": "attach",
11+
"program": "${workspaceRoot}/hello-world",
12+
"useExtendedRemote": true,
13+
"miDebuggerServerAddress": "localhost:2345",
14+
"miDebuggerPath": "/usr/bin/gdb",
15+
"targetArchitecture": "x86_64",
16+
"linux": {
17+
"MIMode": "gdb"
18+
},
19+
"osx": {
20+
"MIMode": "gdb"
21+
},
22+
"windows": {
23+
"MIMode": "gdb"
24+
},
25+
26+
}
27+
]
28+
}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM gcc:13.2
2-
RUN apt-get update && apt-get install -y gdb
2+
RUN apt-get update && apt-get install -y gdb gdbserver
33

44
WORKDIR /app
55
COPY Makefile /app

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
build:
22
g++ -g -o hello-world -Iheaders hello-world.cpp
33

4+
debug:
5+
gdbserver :2345 ./hello-world
6+
47
start:
58
./hello-world

okteto.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,9 @@ dev:
66
command: bash
77
sync:
88
- .:/app
9+
forward:
10+
- 2345:2345
11+
securityContext:
12+
capabilities:
13+
add:
14+
- SYS_PTRACE

0 commit comments

Comments
 (0)