blob: ddf92c3c1b7c658514a63a69ef53209c303505ab [file] [log] [blame]
sewardjf98e1c02008-10-25 16:22:41 +00001
2/*--------------------------------------------------------------------*/
3/*--- Error management for Helgrind. ---*/
4/*--- hg_errors.h ---*/
5/*--------------------------------------------------------------------*/
6
7/*
8 This file is part of Helgrind, a Valgrind tool for detecting errors
9 in threaded programs.
10
11 Copyright (C) 2007-2008 OpenWorks Ltd
12 info@open-works.co.uk
13
14 This program is free software; you can redistribute it and/or
15 modify it under the terms of the GNU General Public License as
16 published by the Free Software Foundation; either version 2 of the
17 License, or (at your option) any later version.
18
19 This program is distributed in the hope that it will be useful, but
20 WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 General Public License for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software
26 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
27 02111-1307, USA.
28
29 The GNU General Public License is contained in the file COPYING.
30*/
31
32#ifndef __HG_ERRORS_H
33#define __HG_ERRORS_H
34
35
36/* The standard bundle of error management functions that we are
37required to present to the core/tool interface at startup. */
38Bool HG_(eq_Error) ( VgRes not_used, Error* e1, Error* e2 );
39void HG_(pp_Error) ( Error* err );
40UInt HG_(update_extra) ( Error* err );
41Bool HG_(recognised_suppression) ( Char* name, Supp *su );
42Bool HG_(read_extra_suppression_info) ( Int fd, Char* buf, Int nBuf,
43 Supp* su );
44Bool HG_(error_matches_suppression) ( Error* err, Supp* su );
45Char* HG_(get_error_name) ( Error* err );
46void HG_(print_extra_suppression_info) ( Error* err );
47
48/* Functions for recording various kinds of errors. */
49void HG_(record_error_Race) ( Thread* thr,
50 Addr data_addr, Bool isWrite, Int szB,
51 ExeContext* mb_lastlock,
52 ExeContext* mb_confacc,
53 Thread* mb_confaccthr );
54void HG_(record_error_FreeMemLock) ( Thread* thr, Lock* lk );
55void HG_(record_error_UnlockUnlocked) ( Thread*, Lock* );
56void HG_(record_error_UnlockForeign) ( Thread*, Thread*, Lock* );
57void HG_(record_error_UnlockBogus) ( Thread*, Addr );
58void HG_(record_error_PthAPIerror) ( Thread*, HChar*, Word, HChar* );
59void HG_(record_error_LockOrder) ( Thread*, Addr, Addr,
60 ExeContext*, ExeContext* );
61void HG_(record_error_Misc) ( Thread*, HChar* );
62
63/* Statistics pertaining to error management. */
64extern ULong HG_(stats__LockN_to_P_queries);
65extern ULong HG_(stats__LockN_to_P_get_map_size) ( void );
66extern ULong HG_(stats__string_table_queries);
67extern ULong HG_(stats__string_table_get_map_size) ( void );
68
69#endif /* ! __HG_ERRORS_H */
70
71/*--------------------------------------------------------------------*/
72/*--- end hg_errors.h ---*/
73/*--------------------------------------------------------------------*/