Git init
[framework/system/sys-assert.git] / sys-assert / src / sys-assert.h
1
2 /*
3  * SYS-ASSERT
4  *
5  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6  *
7  * Contact: Jeesun Kim <iamjs.kim@samsung.com> Youngkyeong Yun <yk.yun@samsung.com>
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  */
22
23
24 #ifndef _DEBUG_ASSERT_H_
25 #define _DEBUG_ASSERT_H_
26
27 #include <time.h>
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33         struct addr_node {
34                 long *startaddr;
35                 long *endaddr;
36                 char perm[5];
37                 char *fpath;
38                 struct addr_node *next;
39         };
40
41 #ifdef __arm__
42         typedef struct layout {
43                 struct layout *fp;
44                 void *ret;
45         } layout;
46
47 #else
48         typedef struct layout {
49                 struct layout *ebp;
50                 void *ret;
51         } layout;
52 #endif
53
54         extern void *__libc_stack_end;
55
56         static int trace_symbols(void *const *array, int size,
57                                  struct addr_node *start, int csfd);
58
59         static struct addr_node *get_addr_list_from_maps(int fd);
60
61         static void print_node_to_file(struct addr_node *start, int fd);
62
63 #ifdef BTDEBUG
64         static void print_node(struct addr_node *start);
65 #endif
66         static void free_all_nodes(struct addr_node *start);
67
68         static long *get_start_addr(long *value, struct addr_node *start);
69
70         static char *get_fpath(long *value, struct addr_node *start);
71
72         static void print_signal_info(const siginfo_t *info, int fd);
73
74         char *fgets_fd(char *s, int n, int fd);
75
76         int fprintf_fd(int fd, const char *fmt, ...);
77
78         static char *remove_path(const char *cmd);
79
80         static int check_redscreen(int pid);
81
82         inline static void get_localtime(time_t cur_time, struct tm *ctime);
83
84 #ifdef __cplusplus
85 }
86 #endif
87 #endif                          /* _DEBUG_ASSERT_H_ */