1

I connected to my server via ssh on vs code. When I debug gem5, I use gdb to debug, but I have to display variables through commands like p var every time. Can I debug in vs code? Or is there any other way that I can display the value of the variable just by pointing at the variable with the mouse, just like debugging in visual studio?

I realize that gem5 is just a c++ executable program.
So I run it like a normal c++ program, but it doesn't stop at the breakpoint, it executes all. This problem arises:

&"warning: gdb: failed to set controlling terminal: operation not permitted\n"

I tried the solutions in this video, but none of them worked. https://www.youtube.com/watch?v=w_fpGfjAdXg&ab_channel=RoelVandePaar

I use the Code runner plugin to debug other C++ programs normally. What should I do please?

Gerrie
  • 736
  • 3
  • 18
  • It should be analogous as for Eclipse: https://stackoverflow.com/questions/61656709/how-to-setup-eclipse-ide-for-gem5-development/61656710#61656710 – Ciro Santilli Oct 06 '20 at 11:34
  • 1
    probably you can check [this](https://gist.github.com/FSXAC/1d5e4af35811994aa1c860035bf63b8b) to see how to configure your `launch.json` to be able to debug with vscode. – Shashank Hegde Oct 27 '21 at 18:25
  • Thank you very much for your answer, but now a new problem has arisen and it used to work. – Gerrie May 12 '22 at 03:26

1 Answers1

0

Adding the following changes to launch.json should help you set up gdb in vscode with Gem5. I found using GDB to be very useful to determine the call-chain and find errors.

"program": "${workspaceFolder}/build/X86/gem5.debug",
"args": ["--debug-break=<timestamp>", "${workspaceFolder}/<path to config file>"],
gPats
  • 315
  • 2
  • 17