我用gdb和gdbserver调试程序:
pc 终端:
(gdb) b 101
Note: breakpoint 1 also set at pc 0xc2a4.
Breakpoint 2 at 0xc2a4: file sdl_mpeg4.c, line 101.
(gdb) c
Continuing.
Program received signal SIGSEGV, Segmentation fault.
0x400107a4 in ?? ()
(gdb)
(gdb) continue
Continuing.
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb)
minicom :
# ./gdbserver :2345 sdl_mpeg4
Process sdl_mpeg4 created; pid = 85
Listening on port 2345
Remote debugging from host 192.168.0.100
pc : [<400107a4>] lr : [<bffff778>] Not tainted
sp : bffff7f4 ip : 40015ab0 fp : 4001f384
r10: 0000b048 r9 : 40018000 r8 : 00009cef
r7 : 4001fee8 r6 : 40018c78 r5 : 00000000 r4 : 80031ad8
r3 : 00004001 r2 : 40018e60 r1 : 4001ffe8 r0 : 6d62692e
Flags: nzCv IRQs on FIQs on Mode USER_32 Segment user
Control: C000317F Table: 335AC000 DAC: 00000015
then:
Child terminated with signal = b
Child terminated with signal = 0xb
GDBserver exiting
#