tom@ubuntu:~/dvp$ cat -n main.c
1 const char* acWordsList[] = {"hello", "world", "good", "BeiJing"};
2
3 static int s = 0;
4
5 typedef struct
6 {
7 int iW;
8 int iH;
9 int iX;
10 int iY;
11 }BOX_ST;
12
13 BOX_ST stBox;
14
15 int sum(const int a, const int b)
16 {
17 int c = a + b;
18
19 return c;
20 }
21
22 int main()
23 {
24 for (int i = 0; i < 18; ++i)
25 {
26 stBox.iW = i;
27 stBox.iH = i;
28 stBox.iX = i;
29 stBox.iY = i;
30
31 s = sum(i,i+2);
32 }
33
34 return 0;
35 }
tom@ubuntu:~/dvp$
list命令的使用
(gdb) help list
List specified function or line.
With no argument, lists ten more lines after or around previous listing.
"list -" lists the ten lines before a previous ten-line listing.
One argument specifies a line, and ten lines are listed around that line.
Two arguments with comma between specify starting and ending lines to list.
Lines can be specified in these ways:
LINENUM, to list around that line in current file,
FILE