Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In mac, I can run the C code normally, but VSC shows program does not exist when debugging #2909

Closed
lbfatcat opened this issue Dec 10, 2018 · 4 comments
Labels
debugger more info needed The issue report is not actionable in its current state question

Comments

@lbfatcat
Copy link

Type: Debugger

Under my mac, I wrote a simple one-line printing C program.
`#include<stdio.h>

int main()
{
printf("hello.\n");
return 0;
}`

Describe the bug

  • OS and Version: macOS Mojave
  • VS Code Version:1.29.1
  • C/C++ Extension Version: 0.20.1

*I can run the program but when I do debug, it just shows the .out file does not exist!
Hope you guys can help me out, I am new to VSC, and find it really handy.
qq20181210-190615 2x

qq20181210-190213 2x

To Reproduce
Please include a code sample and launch.json configuration.

** the tasks.json **
tasks

** the launch.json **
launch

@bobbrow
Copy link
Member

bobbrow commented Dec 10, 2018

In launch.json you don't need those args, but you do need "MIMode": "lldb".

I wasn't able to reproduce your error on my MacBook. Can you verify that clang is actually creating hello.out at the location shown in the error message? You may also want to check the Terminal window to see if there were any errors during compilation.

@bobbrow bobbrow added question debugger more info needed The issue report is not actionable in its current state labels Dec 10, 2018
@lbfatcat
Copy link
Author

In launch.json you don't need those args, but you do need "MIMode": "lldb".

I wasn't able to reproduce your error on my MacBook. Can you verify that clang is actually creating hello.out at the location shown in the error message? You may also want to check the Terminal window to see if there were any errors during compilation.

Thanks for you reply @bobbrow . I tried as you suggested, but things don't work out.
first, I modify the launch.json as follows:
newlaunch

second, i can successfully compile with gcc and run the program:
gcc_and_run

BUT, WHEN DEBUG WITH GDB, THINGS WENT WRONG
Is it possible that some authentication thing keep me from using gdb on my MAC ?
gdb_problem

@WardenGnaw
Copy link
Member

The executable for GDB you want to run is hello.out not hello.

Can you also run ls && echo $PWD

@lbfatcat
Copy link
Author

thanks @WardenGnaw I tried hello.out to be told executable format unrecognized.....

but after I re-installed XCode, then gcc and gdb with homebrew. things get back on track!

perhaps the strange problem is caused by dependencies between xcode and the gnu tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debugger more info needed The issue report is not actionable in its current state question
Projects
None yet
Development

No branches or pull requests

3 participants