You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/debugger/cpp-dynamic-debugging.md
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ manager: coxford
18
18
ms.subservice: debug-diagnostics
19
19
---
20
20
# C++ Dynamic Debugging (Preview)
21
+
21
22
> [!IMPORTANT]
22
23
> C++ Dynamic Debugging is currently in PREVIEW.
23
24
> This information relates to a prerelease feature that might be substantially modified before release. Microsoft makes no warranties, expressed or implied, with respect to the information provided here.
@@ -199,7 +200,7 @@ int main()
199
200
You may need to debug optimized code without it being deoptimized, or put a breakpoint in optimized code and have the code stay optimized when the breakpoint hits. There are several ways to turn off Dynamic Debugging or keep it from deoptimizing code when you hit a breakpoint:
200
201
201
202
- From the Visual Studio main menu: **Tools** > **Options** > **Debugging** > **General**, uncheck **Automatically deoptimize debugged functions when possible (.NET 8+, C++ Dynamic Debugging)**. The next time the debugger starts, code remains optimized.
202
-
- Many dynamic debugging breakpoints are two breakpoints: one in the optimized binary and one in the unoptimized binary. In the **Breakpoints** window, choose **Show Columns** > **Function**, and deselect the breakpoint that belongs to the the `alt` binary. The other breakpoint in the pair breaks in the optimized code.
203
+
- Many dynamic debugging breakpoints are two breakpoints: one in the optimized binary and one in the unoptimized binary. In the **Breakpoints** window, choose **Show Columns** > **Function**, and deselect the breakpoint associated with the the `alt` binary. The other breakpoint in the pair breaks in the optimized code.
203
204
- While debugging, from the Visual Studio main menu choose **Debug** > **Windows** > **Dissassembly** and ensure it has focus. When you step-into a function via the disassembly window, the function won't be deoptimized.
204
205
- Disable dynamic debugging entirely by not passing `/dynamicdeopt` to `cl.exe`, `lib.exe`, and `link.exe`. If you're consuming third party libraries and can't rebuild them, don't pass `/dynamicdeopt` during the final `link.exe` to disable Dynamic Debugging for that binary.
205
206
- To quickly disable dynamic debugging for a single binary (for example, `test.dll`), rename or delete the `alt` binary (for example, `test.alt.dll`).
@@ -209,19 +210,20 @@ You may need to debug optimized code without it being deoptimized, or put a brea
209
210
210
211
Unreal Engine 5.6 supports C++ Dynamic Debugging for both Unreal Build Tool and Unreal Build Accelerator. There are two ways to enable it:
211
212
212
-
- Use the **Development Editor** configuration, and modify your `BuildConfiguration.xml` to include:
213
+
- Modify your project's `Target.cs` file to contain `WindowsPlatform.bDynamicDebugging = true`.
214
+
- Or use the **Development Editor** configuration, and modify your `BuildConfiguration.xml` to include:
213
215
```xml
214
216
<WindowsPlatform>
215
217
<bDynamicDebugging>true</bDynamicDebugging>
216
218
</WindowsPlatform>
217
219
```
218
-
- Or modify your project's `Target.cs` file to contain `WindowsPlatform.bDynamicDebugging = true`.
219
220
220
221
For more information, see Unreal Engine's article [Build Configuration](https://dev.epicgames.com/documentation/en-us/unreal-engine/build-configuration-for-unreal-engine).
221
222
222
223
## Troubleshooting
223
224
224
225
If breakpoints don't hit in deoptimized functions:
226
+
225
227
- Ensure that the `alt.exe` and `alt.pdb` files built. Given `test.exe` and `test.pdb`, `test.alt.exe` and `test.alt.pdb` must exist in the same directory. Ensure that the right build switches are set per this guide.
226
228
- A "debug directory" entry exists in `test.exe` that the debugger uses to find the `alt` binary to use for Deoptimized Debugging. Open a x64-native Visual Studio command prompt and run: `link /dump /headers <your executable.exe>` to see if a `deopt` entry exists. A `deopt` entry appears in the `Type` column as shown in the last line of this example:
227
229
@@ -236,13 +238,13 @@ If breakpoints don't hit in deoptimized functions:
If the `deopt` debug directory entry isn't there, confirm that you're passing `/dynamicdeopt` to `cl.exe`, `lib.exe`, and `link.exe`.
241
+
If the `deopt` debug directory entry isn't there, confirm that you're passing `/dynamicdeopt` to `cl.exe`, `lib.exe`, and `link.exe`.
240
242
241
243
- Dynamic Deoptimization won't work consistently if `/dynamicdeopt` isn't passed to `cl.exe`, `lib.exe`, and `link.exe` for all `.cpp`, `.lib`, and binary files. Confirm that the proper switches are set when building your project.
242
244
- See our list of known issues:
243
245
- JTW
244
246
245
-
If you don't see what you need, or things aren't working as expected, open a ticket at [Developer Community](https://developercommunity.visualstudio.com/cpp), containing as much information as possible about the issue.
247
+
If things aren't working as expected, open a ticket at [Developer Community](https://developercommunity.visualstudio.com/cpp), containing as much information as possible about the issue.
0 commit comments