Debugger in C/C++

Describe your feature request
Previously, the debugger existed in C/C++. Shown in this documentation:

Currently, I am not seeing this debug feature with the updated interface.

What problem(s) would this feature solve?
Old documention needs to be updated or a debug feature needs to be added to match the documentation.

Explain what you were trying to do when you came across the problem leading to this feature request
I was trying to debug C++ code like I did last summer before the new interface.

1 Like
  1. press the + on the window panel
    – this opens a new tab
  2. enter debugger
  3. press the first entry
2 Likes

It doesn’t work. This is what I am trying

Hmm it looks like if you have a repl that’s older than like 1 year, IIRC, this doesn’t work, perhaps try making a new repl or:

  1. press the three dots and the show hidden files
  2. go to .replit and enter:
compile = "make -s"
run = "./main"
entrypoint = "main.cpp"
hidden = ["main", "**/*.o", "**/*.d", ".ccls-cache", "Makefile"]

[nix]
channel = "stable-22_11"

[gitHubImport]
requiredFiles = [".replit", "replit.nix", ".ccls-cache"]

[debugger]
support = true

[debugger.compile]
command = ["make", "main-debug"]
noFileArgs = true

[debugger.interactive]
transport = "stdio"
startCommand = ["dap-cpp"]

[debugger.interactive.initializeMessage]
command = "initialize"
type = "request"

[debugger.interactive.initializeMessage.arguments]
adapterID = "cppdbg"
clientID = "replit"
clientName = "replit.com"
columnsStartAt1 = true
linesStartAt1 = true
pathFormat = "path"
supportsInvalidatedEvent = true
supportsProgressReporting = true
supportsRunInTerminalRequest = true
supportsVariablePaging = true
supportsVariableType = true

[debugger.interactive.launchMessage]
command = "launch"
type = "request"

[debugger.interactive.launchMessage.arguments]
MIMode = "gdb"
arg = []
cwd = "."
environment = []
externalConsole = false
logging = {}
miDebuggerPath = "gdb"
name = "g++ - Build and debug active file"
program = "./main-debug"
request = "launch"
setupCommands = [
	{ description = "Enable pretty-printing for gdb", ignoreFailures = true, text = "-enable-pretty-printing" }
]
stopAtEntry = false
type = "cppdbg"

[languages]

[languages.cpp]
pattern = "**/*.{cpp,h}"

[languages.cpp.languageServer]
start = "ccls"

3 Likes

Hey there! Welcome to the community! I suggest looking at bigminiboss’s example.

Thank you, I see the debugger button now.

2 Likes