clion设置HTML扩展,如何在clion下的调试中捕获控制台输出?

GDB操纵运行程序的过程。

GDB会话的一个例子:也许对你有所帮助

% cat hello.c

#include

main() {

int count;

for (count=0;count<10;count++)

printf("Hello from CETS!\n");

}

% gcc -g hello.c

% gdb ./a.out

GDB is free software and you are welcome to distribute copies of it

under certain conditions; type "show copying" to see the conditions.

There is absolutely no warranty for GDB; type "show warranty" for details.

GDB 4.13 (sparc-sun-solaris2.3),

Copyright 1994 Free Software Foundation, Inc...

(gdb) b main

Breakpoint 1 at 0x10784: file hello.c, line 6.

(gdb) r

Starting program: /home1/b/bozo/./a.out

Breakpoint 1, main() at hello.c:6

6 for (count=0;count<10;count++)

(gdb) s

7 printf("Hello from CETS!\n");

(gdb) p count

$1 = 0

(gdb) disp count

1: count = 0

(gdb) set count=8

(gdb) s

Hello from CETS!

6 for (count=0;count<10;count++)

1: count = 8

(gdb)

7 printf("Hello from CETS!\n");

1: count = 9

(gdb) c

Continuing.

Hello from CETS!

Program exited with code 01.

(gdb) q

%

内容:

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值