GDB使用

编译: gcc -o pwm_with_gdb pwm1.c -g

 

gdb

GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04

Copyright (C) 2012 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law. Type "show copying"

and "show warranty" for details.

This GDB was configured as "i686-linux-gnu".

For bug reporting instructions, please see:

<http://bugs.launchpad.net/gdb-linaro/>.

(gdb)

 

file pwm_with_gdb

(gdb) file pwm_with_gdb

Reading symbols from /work/projects/335x/kernel_3.14.43/test/pwm/pwm_with_gdb...done.

 

r (run)

Starting program: /work/projects/335x/kernel_3.14.43/test/pwm/pwm_with_gdb

Usage: ./pwm_test (0 ~ 100)

Program received signal SIGSEGV, Segmentation fault.

0xb7e84d2e in rewind () from /lib/i386-linux-gnu/libc.so.6

 

bt (backtrace)

#0 0xb7e84d2e in rewind () from /lib/i386-linux-gnu/libc.so.6

#1 0x0804850e in pwm_request () at pwm1.c:28

#2 0x080486d0 in main (argc=1, argv=0xbffff634) at pwm1.c:108

 

frame 1

(gdb) frame 1

#1 0x0804850e in pwm_request () at pwm1.c:28

28 rewind(fp);

 

print fp

(gdb) print fp

$1 = (FILE *) 0x0

 

quit

(gdb) quit

A debugging session is active.

Inferior 1 [process 22610] will be killed.

Quit anyway? (y or n) y

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值