Skip to content

Commit b36642e

Browse files
committed
Move extension code to github.
* Update LICENSE file and license headers U
1 parent 0fac6a3 commit b36642e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+11875
-21
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
main.exe
2+
main.exe.dSYM
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "(lldb) Launch",
6+
"type": "cppdbg",
7+
"request": "launch",
8+
"program": "${workspaceRoot}/main.exe", // this is executable to launch the debugger with
9+
"args": ["YourNameHere"],
10+
"stopAtEntry": true, // if true then stop at the main entry (function)
11+
"cwd": "${workspaceRoot}",
12+
"environment": [],
13+
"externalConsole": true,
14+
"MIMode": "lldb"
15+
}
16+
]
17+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"taskName": "clang++",
8+
"command": "clang++ --debug -o main.exe main.cpp",
9+
// "--debug" enables debugging symbols
10+
// "-o main.exe" specifies the output executable
11+
// "main.cpp" is the source file to compile
12+
"type": "shell",
13+
"group": {
14+
"kind": "build",
15+
"isDefault": true
16+
}
17+
}
18+
]
19+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# README
2+
This is a sample debuggable C++ project. It uses the vendor provided version of clang installed. `tasks.json` and `launch.json` have been edited to demonstrate how to create a configuration for a C++ project that builds with clang.
3+
4+
There's a sample build task in `.vscode/tasks.json`; you can also see the build configurations by using the menu option `Configure` -> `Configure Tasks` or by clicking the gear icon in the Debug Panel.
5+
6+
To run a build, use the menu option `Tasks` -> `Run Build Task...`.
7+
8+
There's a sample debug configuration in `.vscode/launch.json`; you can also see the configuration by using the menu option `Debug` -> `Open Configurations`.
9+
10+
To debug the build, use the menu option `Debug` -> `Start Debugging`. The executable will launch and stop in the main function.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <iostream>
2+
#include <string>
3+
4+
using namespace std;
5+
6+
void greet(const string& person) {
7+
cout << "Hello, " << person << "!" << endl;
8+
}
9+
10+
int main(int argc, char** argv) {
11+
if(argc >= 2) {
12+
greet(argv[1]);
13+
} else {
14+
cerr << "insufficient args, usage: " << argv[0] << " personNameHere" << endl;
15+
}
16+
return 0;
17+
}

Documentation/FAQs.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# FAQs
2+
3+
## Table of Contents
4+
* Setup
5+
* [Debugging Setup](#debugging-setup)
6+
7+
* Debugger
8+
* [Why is debugging not working](#why-is-debugging-not-working)?
9+
* Build
10+
* [How to enable debug symbols](#how-to-enable-debug-symbols)
11+
12+
## Debugging Setup
13+
The debugger needs to be configured to know which executable and debugger to use:
14+
15+
Click menu item: `Debug` -> `Add Configuration...`
16+
17+
The `launch.json` will now be open for editing with a new configuration. The default settings will *probably* work except that you need to specify the **program** setting.
18+
19+
See the [`Documentation/Debugger`](https://github.com/Microsoft/vscode-cpptools/tree/master/Documentation/Debugger) folder in this repository for more in-depth documentation on how to configure the debugger.
20+
21+
## Why is debugging not working?
22+
23+
### My breakpoints aren't being hit
24+
25+
When you start debugging, if it is showing that your breakpoints aren't bound (solid red circle) or they are not being hit, you may need to enable [debug symbols](#how-to-enable-debug-symbols) during compilation.
26+
27+
### Debugging starts but all the lines in my stack trace are grey
28+
29+
If your debugger is showing a grey stacktrace or won't stop at a breakpoint,or the symbols in the call stack are grey then your executable was compiled without [debug symbols](#how-to-enable-debug-symbols).
30+
31+
## How to enable debug symbols
32+
33+
Enabling debug symbols are dependent on the type of compiler you are using. Below are some of the compilers and the compiler options necessary to enable debug symbols.
34+
35+
When in doubt, please check your compiler's documentation for the options necessary to include debug symbols in the output. This may be some variant of `-g` or `--debug`.
36+
37+
#### Clang (C++)
38+
If you invoke the compiler manually then add the `--debug` option.
39+
40+
If you're using a script then make sure the `CXXFLAGS` environment variable is set; e.g. `export CXXFLAGS="${CXXFLAGS} --debug"`
41+
42+
If you're using cmake then set make sure the `CMAKE_CXX_FLAGS` is set; e.g. `export CMAKE_CXX_FLAGS=${CXXFLAGS}`
43+
44+
#### Clang (C)
45+
See Clang C++ but use `CFLAGS` instead of `CXXFLAGS`.
46+
47+
#### gcc or g++
48+
If you invoke the compiler manually, add the `-g` option.
49+
50+
#### cl.exe
51+
Symbols are located in the `*.pdb` file.

Documentation/Getting started.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## How to build and debug the Microsoft CppTools Extension
2+
3+
These steps will allow you to debug the typescript code that is part of the Microsoft CppTools extension for Visual Studio Code.
4+
5+
Prerequisite steps:
6+
* Clone [this](https://github.com/Microsoft/msvscode-cpptools) repository.
7+
* Install [npm](https://nodejs.org).
8+
* From a command line, run the following commands from the Extension folder in the root of the repository:
9+
* `npm install -g vsce`
10+
* This will install `vsce` globally to create the vsix package.
11+
* `npm install` will install the dependencies needed to build the extension.
12+
* Set an environment variable `CPPTOOLS_DEV=1`.
13+
* This enables the local developer workflow, copying dependencies from the `node_modules` folder.
14+
* Open the Extension folder in Visual Studio Code and F5.
15+
* [How to contribute changes](LanguageServer/How%20to%20Contribute%20Changes.md).
16+
117
# Configuring includePath for better IntelliSense results
218

319
This page describes how to configure include paths for folders containing C or C++ files to get the full IntelliSense experience. If you're seeing the following message when opening a folder in VS Code, it means the C++ IntelliSense engine needs additional information about the paths in which your include files are located.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# How to Contribute Changes
2+
3+
## Contribution Steps:
4+
* [Build and debug the extension](../Getting%20started.md#build-and-debug-the-cpptools-extension).
5+
* File an [issue](https://github.com/Microsoft/vscode-cpptools/issues) and a [pull request](https://github.com/Microsoft/vscode-cpptools/pulls) with the change and we will review it.
6+
* If the change affects functionality, add a line describing the change to [CHANGELOG.md](../../Extension/CHANGELOG.md).
7+
* Try and add a test in [test/extension.test.ts](../../Extension/test/extension.test.ts).
8+
* Run tests via opening the [Extension](https://github.com/Microsoft/vscode-cpptools/Extension) folder in Visual Studio Code, selecting the `Launch Tests` configuration in the Debug pane, and choosing `Start Debugging`.
9+
10+
## About the Code
11+
* Execution starts in the `activate` method in [main.ts](../../Extension/src/main.ts).
12+
* `processRuntimeDependencies` handles the downloading and installation of the OS-dependent files. Downloading code exists in [packageManager.ts](../../Extension/src/packageManager.ts).
13+
* `downloadCpptoolsJsonPkg` handles the `cpptools.json`, which can be used to enable changes to occur mid-update, such as turning the `intelliSenseEngine` to `"Default"` for a certain percentage of users.
14+
* The debugger code is in the [Debugger](https://github.com/Microsoft/vscode-cpptools/Extension/src/Debugger) folder.
15+
* [LanguageServer/C_Cpp.ts](../../Extension/src/LanguageServer/C_Cpp.ts) handles various language server functionality.
16+
* [LanguageServer/C_Cpp_ConfigurationProperties.ts](../../Extension/src/LanguageServer/C_Cpp_ConfigurationProperties.ts) handles functionality related to `c_cpp_properties.json`.
17+
* [telemetry.ts](../../Extension/src/telemetry.ts): Telemetry data gets sent to either `logLanguageServerEvent` or `logDebuggerEvent`.
18+
* The Tag Parser (symbol database) doesn't automatically expand macros, so the [cpp.hint](../../Extension/cpp.hint) file contains definitions of macros that should be expanded in order for symbols to be parsed correctly.

Extension/.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.sh text eol=lf
2+
OpenDebugAD7 text eol=lf
3+
link-binaries text eol=lf

Extension/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
out
2+
server
3+
node_modules
4+
debugAdapters
5+
*.vsix

0 commit comments

Comments
 (0)