forked from 54shady/linuxc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
51 lines (42 loc) · 699 Bytes
/
main.c
File metadata and controls
51 lines (42 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <stdio.h>
#include <stdlib.h>
#include "foo.h"
#include "bar.h"
void stub_func(void)
{
printf("%s, %d\n", __FUNCTION__, __LINE__);
}
void args_func(int argc, char *argv[])
{
int i;
for (i = 0; i < argc; i++)
printf("argv[%d] = %s\n", i, argv[i]);
}
int main(int argc, char *argv[])
{
int a;
int b;
args_func(argc, argv);
if (argc >= 3)
{
/* init value a and b */
a = atoi(argv[1]);
b = atoi(argv[2]);
}
stub_func();
foo_func();
/* take a break here if a > b */
/*
* (gdb) b N if a > b
* N is the line number of current file(main.c)
*
* (gdb) b 49
* (gdb) set args 1 2
* (gdb) r
*
* (gdb) set args 2 3
* (gdb) r
*/
bar_func();
return 0;
}