-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathedbt_main.c
74 lines (62 loc) · 1.61 KB
/
edbt_main.c
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include <edidentifier.h>
__CIDENT_RCSID(gr_edbt_main_c,"$Id: edbt_main.c,v 1.8 2024/04/17 15:57:13 cvsuser Exp $")
/* -*- mode: c; indent-width: 4; -*- */
/* $Id: edbt_main.c,v 1.8 2024/04/17 15:57:13 cvsuser Exp $
* backtrace test application
*
*
* Copyright (c) 1998 - 2024, Adam Young.
* All rights reserved.
*
* This file is part of the GRIEF Editor.
*
* The GRIEF Editor is free software: you can redistribute it
* and/or modify it under the terms of the GRIEF Editor License.
*
* Redistributions of source code must retain the above copyright
* notice, and must be distributed with the license document above.
*
* Redistributions in binary form must reproduce the above copyright
* notice, and must include the license document above in
* the documentation and/or other materials provided with the
* distribution.
*
* The GRIEF Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* License for more details.
* ==end==
*/
#include <edstacktrace.h>
static int
function4(int a, int b, char *c)
{
FILE *out = fopen("stackdump.out", "w");
edbt_stackdump(out, 1);
fclose(out);
return 0;
}
static int
function3(int a, int b, char *c)
{
char x[100];
return function4(a, b, x);
}
static int
function2(int a, int b, char *c)
{
char y[100];
return function3(a, b, y);
}
static int
function1(int a, int b, char *c)
{
char z[100];
return function2(a, b, z);
}
int
main(int argc, const char *argv[])
{
return function1(1, 2, NULL);
}
/*end*/