gdb 调试模式下,循环输出
(gdb) set $x=13
(gdb) while $x--
>p $x
>end
$6 = 12
$7 = 11
$8 = 10
$9 = 9
$10 = 8
$11 = 7
$12 = 6
$13 = 5
$14 = 4
$15 = 3
$16 = 2
$17 = 1
$18 = 0
实际用起来:
真是打击啊,,,
(gdb) set $x=13
(gdb) while $x--
>set $PCur=0x614c20
>set $data=$PCur->mData
>p $data
>set $PCur=PCur->mNext
>end
Attempt to extract a component of a value that is not a structure pointer.
(gdb) set $x=13
(gdb) while $x--
>if(PCur->mData)
>PCur=PCur->mNext
>p PCur->