VS Code Just My Code Debugging

本文介绍了VS Code对不同编程语言的Just My Code调试支持情况,包括C++、Java和Python。C++目前不支持,Java通过设置可以启用,Python则可以通过配置选项限制调试到用户代码。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

VS Code Just My Code Debugging

😭 VS Code for C++ doesn’t support Just My Code

Refer here:

Add support for “Just My Code” debugging · Issue #5763 · microsoft/vscode-cpptools · GitHub

VS Code for Java supports Just My Code

VS Code for Java supports Just My Code now, a feature automatically steps over calls to system, framework, and other non-user code. You can configure Just My Code through settings, “java.debug.settings.stepping.skipClasses” and “java.debug.settings.exceptionBreakpoint.skipClasses“. Predefined values are:

  • $JDK: Classes from the default system classpath such as rt.jar, jrt-fs.jar.
  • $Libraries: Classes from the build tool dependencies such as Maven, Gradle and user libraries.

VS Code for Python supports Just My Code

Set configuration options in launch.json .
justMyCode : When omitted or set to true (the default), restricts debugging to user-written code only. Set to false to also enable debugging of standard library functions.

References

Add support for “Just My Code” debugging · Issue #5763 · microsoft/vscode-cpptools · GitHub

Java on Visual Studio Code Update – July 2020 - Java at Microsoft

Debugging configurations for Python apps in Visual Studio Code

VS Code Python 停用 justMyCode 调试库代码_zywvvd的博客-CSDN博客

### 解决 Unity 中显示 External Code 的问题 在调试过程中,遇到外部代码(External Code)可能会使开发者难以追踪实际的逻辑流程。为了禁用 External Code 或者让调试器展示原始代码,在 Visual Studio 和 Unity 配合使用的场景下可以采取以下方法: #### 方法一:调整 Visual Studio 设置 可以通过修改 Visual Studio 的设置来隐藏 External Code 并仅显示项目中的代码。 1. **启用 Just My Code 功能** 打开 Visual Studio 后进入菜单 `Tools` -> `Options`,导航到 `Debugging` -> `General` 页面。勾选选项 “Enable Just My Code (Managed only)”[^1]。此功能会过滤掉不属于当前项目的代码,从而避免跳转至 External Code。 2. **配置 Step Over Properties** 如果仍然希望深入查看某些特定库的行为,则可以在同一页面取消勾选 “Step over properties and operators (Managed only)”。这允许更细致地控制哪些部分被忽略或保留。 3. **加载符号文件 (.pdb)** 确保正在开发环境下的所有必要的 PDB 文件已正确加载。如果没有加载这些符号表数据,即使启用了上述选项也可能无法看到源码级别的细节。右键单击调用堆栈窗口中的条目并选择 "Load Symbols" 来手动尝试获取它们。 #### 方法二:通过 Unity 自身优化构建过程 有时问题可能源于如何编译脚本以及是否包含了足够的调试信息。 - 当创建 Release 版本时,默认情况下会移除大部分调试支持以减少最终产品的大小和提高性能。因此建议切换回 Debug 构建模式以便更好地配合 VS 进行分析工作。 ```csharp // 修改 Player Settings 下 Scripting Define Symbols 添加 DEBUG 关键字 PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone, "DEBUG"); ``` 另外值得注意的是关于 Unity Remote 的应用说明提到当需要连接物理硬件测试而非单纯模拟器上运行时候需要用到它 。不过对于纯粹桌面端或者编辑器内部操作来说一般不需要额外安装该组件即可完成基本同步需求。 综上所述,按照以上指导应该能够有效改善因 External Code 导致不便的情况,并且提供更加流畅高效的调试体验给使用者们。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值