1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Authors: Jeffrey Stedfast <fejj@ximian.com>
5 * Copyright 2003 Ximian, Inc. (www.ximian.com)
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #ifndef __VG_ERROR_H__
25 #define __VG_ERROR_H__
37 #endif /* __cplusplus */
49 #define VG_STACK_ADDR_UNKNOWN ((unsigned int) -1)
51 typedef struct _VgError VgError
;
52 typedef struct _VgErrorStack VgErrorStack
;
53 typedef struct _VgErrorSummary VgErrorSummary
;
54 typedef struct _VgErrorParser VgErrorParser
;
56 struct _VgErrorStack
{
57 struct _VgErrorStack
*next
; /* next stack frame */
58 struct _VgErrorSummary
*summary
; /* parent summary */
59 vgwhere_t where
; /* "at", "by" */
60 unsigned int addr
; /* symbol address */
61 vgstack_t type
; /* func/obj */
62 char *symbol
; /* symbol name */
72 struct _VgErrorSummary
{
73 struct _VgErrorSummary
*next
;
74 struct _VgErrorStack
*frames
;
75 struct _VgError
*parent
;
79 typedef unsigned long vgthread_t
;
81 typedef struct _time_stamp
{
92 VgErrorSummary
*summary
; /* first summary is the error, additional summary nodes are just more specifics */
98 typedef void (*VgErrorCallback
) (VgErrorParser
*parser
, VgError
*err
, void *user_data
);
100 struct _VgErrorParser
{
103 GHashTable
*pid_hash
;
106 VgErrorCallback error_cb
;
110 VgErrorParser
*vg_error_parser_new (int fd
, VgErrorCallback error_cb
, void *user_data
);
111 void vg_error_parser_free (VgErrorParser
*parser
);
113 int vg_error_parser_step (VgErrorParser
*parser
);
114 void vg_error_parser_flush (VgErrorParser
*parser
);
116 void vg_error_free (VgError
*err
);
118 void vg_error_to_string (VgError
*err
, GString
*str
);
122 #endif /* __cplusplus */
124 #endif /* __VG_ERROR_H__ */