English 中文(简体)
如果在VSCode与CMake进行分解,Calstack的原始途径就是无效的。
原标题:Source path of CallStack is invalid when debugging with CMake in VSCode

I m building a debugging environment with CMake in VSCode. Debugging with breakpoints works fine in Visual Studio using the same CMake. However, in VSCode, the target source file of CallStack is not normal.

来源档案的位置如下所示。

<代码>C:/Workspace/CPU_Raytracing/main.cpp

Debug console的产出如下。

Thread 1 "Renderer_Tester" hit Breakpoint 2, main () at C:/Workspace/CPU_Raytracing/main.cpp:7
7 in C:/Workspace/CPU_Raytracing/main.cpp

然而,从CallixStack通过制版获得的道路如下所示。

main(c):WorkspaceCPU_RaytracinguildCWorkspaceCPU_Raytracingmain.cpp:7)

是否有办法解决这种情况?

提前感谢。


清除CMake的海滩,或拆除建筑材料并重新启用。

视力演播室用一个CMake项目进行脱色工作。

The desired result is that when debugging via CMake from VSCode, it stops at the BreakPoint and points to the corresponding SourceCode.

问题回答

决定。

问题在于,我试图通过修改任务中的备选办法,改变情况。 json 与其他脱胎方法一样,不算碎。

在环境中设置“cmake.debugConfig”,json解决问题。

这里是我使用的备选办法。

"cmake.debugConfig": {
    "type": "cppdbg",
    "request": "launch",
    "name": "CMake Debug",
    "program": "${command:cmake.launchTargetPath}",
    "args": [],
    "stopAtEntry": false,
    "cwd": "${workspaceFolder}",
    "environment": [],
    "externalConsole": false,
    "MIMode": "gdb",
    "miDebuggerPath": "C:/cygwin64/bin/gdb.exe",
}




相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签