10

I'm trying to debug a C program using Visual Studio Code in Ubuntu.

I set

"program": "${workspaceRoot}/sample"

in the launch.json where "sample" is the name of my program. Then I simply put a breakpoint in code and click the debug arrow. However, the debugger does not hit the breakpoint, a terminal simply flashes and closes. When I hover over my breakpoint it says:

Module containing this breakpoint has not yet loaded or the breakpoint adress could not be obtained.

Is there an additional setting that I must configure ?

3
  • 1
    There was a similar issue posted here which contains a solution. Does that work for you? Commented Apr 3, 2017 at 16:03
  • Ah thank you. I was missing the -g tag when compiling. Commented Apr 3, 2017 at 16:09
  • 2
    @SpiderRico, If this issue has been resolved, you could add the solution as the answer and mark it. So it would help other community members who meet the same issue. Have a nice day:) Commented Apr 4, 2017 at 2:30

1 Answer 1

27

The problem had nothing to do with VS code. I was simply missing the -g tag when compiling the program.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! landed here after 1hr of searching everywhere!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.