Skip to content

Commit 688fa5d

Browse files
authored
Merge pull request #4709 from MicrosoftDocs/main
12/06 AM Publish
2 parents 680c617 + 11352ec commit 688fa5d

File tree

3 files changed

+27
-26
lines changed

3 files changed

+27
-26
lines changed

docs/build/reference/debug-generate-debug-info.md

100755100644
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
11
---
2-
description: "Learn more about: /DEBUG (Generate Debug Info)"
2+
description: "Learn more about: /DEBUG (Generate debug info)"
33
title: "/DEBUG (Generate Debug Info)"
4-
ms.date: "05/16/2019"
4+
ms.date: 12/05/2022
55
f1_keywords: ["VC.Project.VCLinkerTool.GenerateDebugInformation", "/debug"]
66
helpviewer_keywords: ["DEBUG linker option", "/DEBUG linker option", "-DEBUG linker option", "PDB files", "debugging [C++], debug information files", "generate debug info linker option", "pdb files, generating debug info", ".pdb files, generating debug info", "debugging [C++], linker option", "program databases [C++]"]
77
ms.assetid: 1af389ae-3f8b-4d76-a087-1cdf861e9103
88
---
9-
# /DEBUG (Generate Debug Info)
9+
# `/DEBUG` (Generate debug info)
1010

11-
```
12-
/DEBUG[:{FASTLINK|FULL|NONE}]
13-
```
11+
The **`/DEBUG`** linker option creates a debugging information file for the executable.
12+
13+
## Syntax
14+
15+
> **`/DEBUG`**\[**`:`**{**`FASTLINK`**|**`FULL`**|**`NONE`**}]
1416
1517
## Remarks
1618

17-
The **/DEBUG** option creates debugging information for the executable.
19+
The **`/DEBUG`** option puts the debugging information from linked object and library files into a program database (PDB) file. It updates the PDB during subsequent builds of the program.
1820

19-
The linker puts the debugging information into a program database (PDB) file. It updates the PDB during subsequent builds of the program.
21+
An executable (an EXE or DLL file) created for debugging contains the name and path of the corresponding PDB. The debugger reads the embedded name and uses the PDB when you debug the program. The linker uses the base name of the program and the extension *`.pdb`* to name the program database, and embeds the path where it was created. To override this default, set the [`/PDB`](pdb-use-program-database.md) option and specify a different file name.
2022

21-
An executable (.exe file or DLL) created for debugging contains the name and path of the corresponding PDB. The debugger reads the embedded name and uses the PDB when you debug the program. The linker uses the base name of the program and the extension .pdb to name the program database, and embeds the path where it was created. To override this default, set [/PDB](pdb-use-program-database.md) and specify a different file name.
23+
The **`/DEBUG:FASTLINK`** option is available in Visual Studio 2017 and later. This option generates a limited PDB that indexes into the debug information in the object files and libraries used to build the executable instead of making a full copy. You can only use this limited PDB to debug from the computer where the binary and its libraries were built. If you deploy the binary elsewhere, you may debug it remotely from the build computer, but not directly on the test computer. In Visual Studio 2017, this option can sometimes greatly improve link times compared with **`/DEBUG:FULL`**. In Visual Studio 2019 and later, **`/DEBUG:FULL`** is faster than in earlier versions. Now, **`/DEBUG:FASTLINK`** isn't always faster than **`/DEBUG:FULL`**, and it's rarely more than twice as fast.
2224

23-
The **/DEBUG:FASTLINK** option is available in Visual Studio 2017 and later. This option leaves private symbol information in the individual compilation products used to build the executable. It generates a limited PDB that indexes into the debug information in the object files and libraries used to build the executable instead of making a full copy. This option can link from two to four times as fast as full PDB generation, and is recommended when you are debugging locally and have the build products available. This limited PDB can't be used for debugging when the required build products are not available, such as when the executable is deployed on another computer. In a developer command prompt, you can use the mspdbcmf.exe tool to generate a full PDB from this limited PDB. In Visual Studio, use the Project or Build menu items for generating a full PDB file to create a full PDB for the project or solution.
25+
A **`/DEBUG:FASTLINK`** PDB can be converted to a full PDB that you can deploy to a test machine for local debugging. In Visual Studio, use the **Property Pages** dialog as described below to create a full PDB for the project or solution. In a developer command prompt, you can use the `mspdbcmf.exe` tool to create a full PDB.
2426

25-
The **/DEBUG:FULL** option moves all private symbol information from individual compilation products (object files and libraries) into a single PDB, and can be the most time-consuming part of the link. However, the full PDB can be used to debug the executable when no other build products are available, such as when the executable is deployed.
27+
The **`/DEBUG:FULL`** option moves all private symbol information from individual compilation products (object files and libraries) into a single PDB, and can be the most time-consuming part of the link. However, the full PDB can be used to debug the executable when no other build products are available, such as when the executable is deployed.
2628

27-
The **/DEBUG:NONE** option does not generate a PDB.
29+
The **`/DEBUG:NONE`** option doesn't generate a PDB.
2830

29-
When you specify **/DEBUG** with no additional options, the linker defaults to **/DEBUG:FULL** for command line and makefile builds, for release builds in the Visual Studio IDE, and for both debug and release builds in Visual Studio 2015 and earlier versions. Beginning in Visual Studio 2017, the build system in the IDE defaults to **/DEBUG:FASTLINK** when you specify the **/DEBUG** option for debug builds. Other defaults are unchanged to maintain backward compatibility.
31+
In Visual Studio 2015 and earlier versions, when you specify **`/DEBUG`** with no extra arguments, the linker defaults to **`/DEBUG:FULL`** for command line and makefile builds, for release builds in the Visual Studio IDE, and for both debug and release builds. Beginning in Visual Studio 2017, the build system in the IDE defaults to **`/DEBUG:FASTLINK`** when you specify the **`/DEBUG`** option for debug builds. Other defaults are unchanged to maintain backward compatibility.
3032

31-
The compiler's [C7 Compatible](z7-zi-zi-debug-information-format.md) (/Z7) option causes the compiler to leave the debugging information in the .obj files. You can also use the [Program Database](z7-zi-zi-debug-information-format.md) (/Zi) compiler option to store the debugging information in a PDB for the .obj file. The linker looks for the object's PDB first in the absolute path written in the .obj file, and then in the directory that contains the .obj file. You cannot specify an object's PDB file name or location to the linker.
33+
The compiler's [`/Z7`](z7-zi-zi-debug-information-format.md) (C7 Compatible) option causes the compiler to leave the debugging information in the object (OBJ) files. You can also use the [`/Zi`](z7-zi-zi-debug-information-format.md) (Program Database) compiler option to store the debugging information in a PDB for the OBJ file. The linker looks for the object's PDB first in the absolute path written in the OBJ file, and then in the directory that contains the OBJ file. You can't specify an object's PDB file name or location to the linker.
3234

33-
[/INCREMENTAL](incremental-link-incrementally.md) is implied when /DEBUG is specified.
35+
[`/INCREMENTAL`](incremental-link-incrementally.md) is implied when **`/DEBUG`** is specified.
3436

35-
/DEBUG changes the defaults for the [/OPT](opt-optimizations.md) option from REF to NOREF and from ICF to NOICF, so if you want the original defaults, you must explicitly specify /OPT:REF or /OPT:ICF.
37+
**`/DEBUG`** changes the defaults for the [`/OPT`](opt-optimizations.md) option from **`REF`** to **`NOREF`** and from **`ICF`** to **`NOICF`**, so if you want the original defaults, you must explicitly specify **`/OPT:REF`** or **`/OPT:ICF`** after the **`/DEBUG`** option.
3638

37-
It is not possible to create an .exe or .dll that contains debug information. Debug information is always placed in a .obj or .pdb file.
39+
It isn't possible to create an EXE or DLL that contains debug information. Debug information is always placed in an OBJ or PDB file.
3840

3941
### To set this linker option in the Visual Studio development environment
4042

4143
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
4244

43-
1. Click the **Linker** folder.
44-
45-
1. Click the **Debugging** property page.
45+
1. Select the **Linker** > **Debugging** property page.
4646

47-
1. Modify the **Generate Debug Info** property to enable PDB generation. This enables /DEBUG:FASTLINK by default in Visual Studio 2017 and later.
47+
1. Modify the **Generate Debug Info** property to enable or disable PDB generation. This property enables **`/DEBUG:FASTLINK`** by default in Visual Studio 2017 and later.
4848

49-
1. Modify the **Generate Full Program Database File** property to enable /DEBUG:FULL for full PDB generation for every incremental build.
49+
1. Modify the **Generate Full Program Database File** property to enable **`/DEBUG:FULL`** for full PDB generation for every incremental build.
5050

5151
### To set this linker option programmatically
5252

5353
1. See <xref:Microsoft.VisualStudio.VCProjectEngine.VCLinkerTool.GenerateDebugInformation%2A>.
5454

5555
## See also
5656

57-
[MSVC linker reference](linking.md)<br/>
58-
[MSVC Linker Options](linker-options.md)
57+
[MSVC linker reference](linking.md)\
58+
[MSVC linker options](linker-options.md)

docs/dotnet/how-to-create-clr-console-applications-cpp-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ You can use the **CLR Console Application** template in the **New Project** dia
1515

1616
You can use the **CLR Console App** template in the **New Project** dialog to create a console app project that already has essential project references and files.
1717

18-
C++/CLI support isn't installed by default when you install a Visual Studio C++ workload. If you don't see a CLR heading under Visual C++ in the **New Project** dialog, you may need to install C++/CLI support. For more information, see [.NET programming with C++/CLI](../dotnet/dotnet-programming-with-cpp-cli-visual-cpp.md).
18+
C++/CLI support isn't installed by default when you install a Visual Studio C++ workload. If you don't see a CLR heading under Visual C++ in the **New Project** dialog, you may need to install C++/CLI support. For more information, see [Install C++/CLI support in Visual Studio 2022](../dotnet/dotnet-programming-with-cpp-cli-visual-cpp.md#install-ccli-support-in-visual-studio-2022).
1919

2020
::: moniker-end
2121
::: moniker range=">=msvc-160"

docs/dotnet/how-to-create-clr-empty-projects.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ To create a CLR empty project, use the **CLR Empty Project** template, which is
1818

1919
The **New Project** dialog box appears.
2020

21-
1. Under **Installed Templates**, click the **Visual C++** node; then click the **CLR** node. Choose the **CLR Empty Project** icon.
21+
1. Under **Installed Templates**, click the **Visual C++** node; then click the **CLR** node. Choose the **CLR Empty Project** icon. If you don't see the CLR empty project templates in the Create a new project dialog, you may need to install C++/CLI support. For more information, see [Install C++/CLI support in Visual Studio 2022](../dotnet/dotnet-programming-with-cpp-cli-visual-cpp.md#install-ccli-support-in-visual-studio-2022).
22+
2223

2324
1. In the **Name** box, enter a unique name for your application.
2425

0 commit comments

Comments
 (0)