1
我想知道字符串是如何工作的,所以我在basic_string.h中添加了断点。 但是当我调试时它并没有进入这些断点。Clion debug:如何进入STL
当我在调试时添加断点时,GDB控制台显示: 文件“C:/Users/manch/Downloads/MinGW/lib/gcc/mingw32/4.8.1/include/C++/bits”中没有行1008 /basic_string.h”。
这是我的测试代码
#include <iostream>
#include <string>
int main() {
std::string *ps = new std::string("hello");
ps->append(" world");
return 0;
}
和的CMakeLists.txt
cmake_minimum_required(VERSION 3.6)
project(Stl)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp test.cpp C:/Users/manch/Downloads/MinGW/lib/gcc/mingw32/4.8.1/include/c++/bits/stl_construct_copy.h)
add_executable(Stl ${SOURCE_FILES})