GDB-UI试用

1 源码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
typedef struct {
float a;
float b;
} substruct;

struct {
int i;
substruct r;
} c;

void main() {
int n = 4;
int m[10] = {0,1,4,9,16,25,36,49,64,81};
n = 5;
myproc(n);
c.i = 1;
c.r.a = 0.5;
c.r.b = 0.25;
}
1
2
3
4
5
6
void myproc(n)
{

int p;
p = 2*n;
printf("Two times %d is %d\n", n, p);
}

用 -g 选项编译程序:

1
2
cc -g -c myproc.c
cc -g -o myprog myprog.c myproc.o
Last Updated 2017-12-11 Mon 13:54.
Render by hexo-renderer-org with Emacs 25.3.2 (Org mode 8.2.10)