【发布时间】:2022-01-23 11:12:41
【问题描述】:
当我想通过调整向量的大小来改变我正在调试的程序的执行时,我得到了一个错误:
(lldb) expression std_vector_foo.resize(1)
error: Couldn't lookup symbols:
std::vector<string_id<mtype>, std::allocator<string_id<mtype> > >::resize(unsigned long)
奇怪的是,以下运行良好:
expression std_vector_foo.reserve(1)
【问题讨论】:
-
我假设
std::vector<string_id<mtype>, std::allocator<string_id<mtype> > >::resize(unsigned long)没有内线,并且没有这种方法的异常副本。您可以查看源代码并尝试调用此方法调用的函数。 -
如果您没有在代码中使用
std_vector_foo.resize,那么编译器将不会为其生成代码,因此调试器将无法运行该代码