C/C++Eclipse GDB没有显示断点
C/C++ Eclipse GDB not showing break points
当我试图在Eclipse中调试代码时,它似乎运行调试器并停止,但Eclipse无法找到源代码?打开一个选项卡,上面写着"main()at 0x100000f64",按钮上写着"查看反汇编"
我可以很好地查看反汇编,但如果我能让断点工作,那就太好了。谢谢
我的代码:
#include <iostream>
using namespace std;
int main() {
int n = 10;
int factorial = 1;
// n! = 1*2*3...*n
for (int i = 1; i <= n; i++) {
cout << "i is " << i << endl;
factorial *= i;
}
cout << "The Factorial of " << n << " is " << factorial << endl;
return 0;
}
GDB警告输出:
warning: `/var/folders/s1/dxx9glzn45j6x2ypzk9xkjnc0000gp/T/Test-203d73.o': can't open to read symbols: No such file or directory.
$1 = 0xff
The target endianness is set automatically (currently little endian)
No symbol table is loaded. Use the "file" command.
warning: Could not open OSO archive file "/BinaryCache/Libsyscall/Libsyscall-2422.110.17~1/Symbols/BuiltProducts/libsystem_kernel.a"
warning: `/private/var/tmp/Libsyscall/Libsyscall-2422.110.17~1/Libsyscall.build/Libsyscall_dynamic.build/Objects-normal/x86_64/_libc_funcptr.o': can't open to read symbols: No such file or directory.
warning: `/private/var/tmp/Libsyscall/Libsyscall-2422.110.17~1/Libsyscall.build/Libsyscall_dynamic.build/Objects-normal/x86_64/kernel_vers.o': can't open to read symbols: No such file or directory.
warning: `/private/var/tmp/Libsyscall/Libsyscall-2422.110.17~1/Libsyscall.build/Libsyscall_dynamic.build/Objects-normal/x86_64/memcpy.o': can't open to read symbols: No such file or directory.
warning: `/private/var/tmp/Libsyscall/Libsyscall-2422.110.17~1/Libsyscall.build/Libsyscall_dynamic.build/Objects-normal/x86_64/strcmp.o': can't open to read symbols: No such file or directory.
warning: `/private/var/tmp/Libsyscall/Libsyscall-2422.110.17~1/Libsyscall.build/Libsyscall_dynamic.build/Objects-normal/x86_64/strlcpy.o': can't open to read symbols: No such file or directory.
warning: `/private/var/tmp/Libsyscall/Libsyscall-2422.110.17~1/Libsyscall.build/Libsyscall_dynamic.build/Objects-normal/x86_64/strlen.o': can't open to read symbols: No such file or directory.
warning: Could not open OSO archive file "/BinaryCache/libplatform/libplatform-24.90.1~2/Symbols/libatomics_normal.a"
warning: Could not open OSO archive file "/BinaryCache/libplatform/libplatform-24.90.1~2/Symbols/libcachecontrol_normal.a"
warning: Could not open OSO archive file "/BinaryCache/libplatform/libplatform-4.90.1~2/Symbols/libos_normal.a"
warning: Could not open OSO archive file "/BinaryCache/libplatform/libplatform-24.90.1~2/Symbols/libsetjmp_normal.a"
warning: Could not open OSO archive file "/BinaryCache/libplatform/libplatform-24.90.1~2/Symbols/libsimple_normal.a"
warning: Could not open OSO archive file "/BinaryCache/libplatform/libplatform-24.90.1~2/Symbols/libstring_normal.a"
warning: Could not open OSO archive file "/BinaryCache/libplatform/libplatform-24.90.1~2/Symbols/libucontext_normal.a"
warning: `/private/var/tmp/libplatform/libplatform-24.90.1~2/libplatform.build/libsystem_platform.build/Objects-normal/x86_64/init.o': can't open to read symbols: No such file or directory.
Temporary breakpoint 2, 0x0000000100000f64 in main ()
Single stepping until exit from function main,
which has no line number information.
Single stepping until exit from function start,
which has no line number information.
[Inferior 1 (process 84739) exited normally]
Quit
`
我也想出了这个。。问题是,当你创建项目时,你需要确保它使用的是Mac GCC而不是llvm来编译。目前,如果使用llvm编译,似乎无法使用gdb进行调试:)
相关文章:
- 比较并显示使用最小值(a,b)和最大值(a、b)升序排列的4个数字
- C++,OpenCV,尝试显示图像时"OpenCV(4.3.0) Error: Assertion failed (size.width>0 && size.height>0)"此错误
- 字符串-C++后显示的随机字符
- 继承期间显示未知行为的子类
- 仅使用绝对值对数组进行排序,并在C++中显示实际值
- 程序崩溃并显示"std::out_of_range"错误
- 如何在C++中用std::cout正确显示带十六进制的字符串文本
- 为什么在C的循环中使用printf的Rust代码不显示输出,而在C++的循环中显示std::cout
- 无法删除指针,已触发断点
- 从数据库实时显示QT c++中的数据
- 条件断点在不应该触发时触发
- 当使用比格式支持的精度更高的精度来显示数字时,会写出什么数据
- 显示错误输出的简单数组排序程序
- Qt自定义QPush按钮未显示在布局上
- C++射线示踪剂ppm表示没有足够的数据来显示图像
- 显示基于用户输入的整数的字符
- 使用QTreeView,如何通过调用函数只突出显示特定的行/列
- 为什么断点显示数组的第二个值是一个大数字?额外学分工作
- Delete[] 运算符使 *.exe 触发断点和 wntdll.pdb未加载以显示
- C/C++Eclipse GDB没有显示断点