我在gdb
调试器中调试一个C++程序,并试图访问vector
中的第5个元素,它只包含4个元素.try 后,屏幕上出现了此错误:
(gdb) list main
1 #include <memory>
2 #include <vector>
3
4 int main(int argc, char *argv[]){
5
6
7 std::vector<int> v_num = {1, 3, 5, 67};
8 std::unique_ptr<std::vector<int>> p(&v_num);
9
10
(gdb) p v_num.at (5)
Python Exception <class 'IndexError'> Vector index "5" should not be >= 4.:
Error while executing Python code.
(gdb)
我只看到gdb
中出现了Python异常.有人能解释一下我为什么会遇到这样的错误吗?gdb
在内部使用python吗?