cgdb 调试_为什么使用 cgdb 打开的调试文件不显示源代码

使用 cgdb 调试一个编译好的文件,结果发现打开看到的并不是源代码,而是 LLVM 的编译输出:

1│ // -*- C++ -*-

2│ //===------------------------------ vector --------------------------------===//

3│ //

4│ // The LLVM Compiler Infrastructure

5│ //

6│ // This file is dual licensed under the MIT and the University of Illinois Open

7│ // Source Licenses. See LICENSE.TXT for details.

8│ //

9│ //===----------------------------------------------------------------------===//

10│

11│ #ifndef _LIBCPP_VECTOR

12│ #define _LIBCPP_VECTOR

13│

14│ /*

15│ vector synopsis

16│

17│ namespace std

18│ {

19│

20│ template >

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector

For bug reporting instructions, please see:

.

Find the GDB manual and other documentation resources online at:

.

For help, type "help".

Type "apropos word" to search for commands related to "word"...

Reading symbols from PartialOrdering...done.

(gdb) l

849 data() + size(), data() + capacity());

850 }

851 void __annotate_increase(size_type __n) const

852 {

853 __annotate_contiguous_container(data(), data() + capacity(),

854 data() + size(), data() + size() + __n);

855 }

856 void __annotate_shrink(size_type __old_size) const

857 {

858 __annotate_contiguous_container(data(), data() + capacity(),

(gdb) help

吓得我赶紧又写了一个 helloworld 试了一下:

_| _|

_|_|_| _|_|_| _|_|_| _|_|_|

_| _| _| _| _| _| _|

_| _| _| _| _| _| _|

_|_|_| _|_|_| _|_|_| _|_|_|

_|

_|_|

a curses debugger

version 0.6.8

type q to exit

type help for GDB help

type :help for CGDB help

.

Find the GDB manual and other documentation resources online at:

.

For help, type "help".

Type "apropos word" to search for commands related to "word"...

Reading symbols from hello...Reading symbols from /Users/Shiratsuyu/Documents/Codes/PartialOrdering/hello.dSYM/Contents/

Resources/DWARF/hello...done.

done.

(gdb) list

Line number 8 out of range; h.cpp has 7 lines.

(gdb) list 1

1 #include

2 using namespace std;

3

4 int main(){

5 cout<

6 return 0;

7 }

(gdb)

这都是什么鬼……

…真的是没脾气了,怎么样才能让它老老实实的显示和 main.cpp 里一样的代码啊

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值