blob: 7fb98f8ce36e357044429e248a0b9b26b93a4dae [file] [log] [blame]
sewardj024598e2008-09-18 14:43:05 +00001
2/*--------------------------------------------------------------------*/
3/*--- Ptrcheck: a pointer-use checker. ---*/
4/*--- Exports for stuff shared between sg_ and h_ subtools. ---*/
5/*--- pc_common.h ---*/
6/*--------------------------------------------------------------------*/
7
8/*
9 This file is part of Ptrcheck, a Valgrind tool for checking pointer
10 use in programs.
11
sewardj9eecbbb2010-05-03 21:37:12 +000012 Copyright (C) 2008-2010 OpenWorks Ltd
sewardj024598e2008-09-18 14:43:05 +000013 info@open-works.co.uk
14
15 This program is free software; you can redistribute it and/or
16 modify it under the terms of the GNU General Public License as
17 published by the Free Software Foundation; either version 2 of the
18 License, or (at your option) any later version.
19
20 This program is distributed in the hope that it will be useful, but
21 WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 General Public License for more details.
24
25 You should have received a copy of the GNU General Public License
26 along with this program; if not, write to the Free Software
27 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
28 02111-1307, USA.
29
30 The GNU General Public License is contained in the file COPYING.
31*/
32
33#ifndef __PC_COMMON_H
34
35#define __PC_COMMON_H
36
37typedef struct _Seg Seg; /* abstract every except in h_main.c */
38
39void sg_record_error_SorG ( ThreadId tid,
40 Addr addr, SSizeT sszB,
41 HChar* expect, HChar* actual );
42
43void h_record_heap_error( Addr a, SizeT size, Seg* vseg, Bool is_write );
44
45void h_record_arith_error( Seg* seg1, Seg* seg2, HChar* opname );
46
47void h_record_sysparam_error( ThreadId tid, CorePart part, Char* s,
48 Addr lo, Addr hi, Seg* seglo, Seg* seghi );
49
sewardjc1bc9d12009-07-15 14:50:22 +000050Bool pc_eq_Error ( VgRes res, Error* e1, Error* e2 );
51void pc_before_pp_Error ( Error* err );
52void pc_pp_Error ( Error* err );
sewardj024598e2008-09-18 14:43:05 +000053UInt pc_update_Error_extra ( Error* err );
54Bool pc_is_recognised_suppression ( Char* name, Supp *su );
njn35db56c2009-07-24 07:38:29 +000055Bool pc_read_extra_suppression_info ( Int fd, Char** bufpp,
56 SizeT* nBufp, Supp* su );
sewardj024598e2008-09-18 14:43:05 +000057Bool pc_error_matches_suppression (Error* err, Supp* su);
58Char* pc_get_error_name ( Error* err );
sewardj588adef2009-08-15 22:41:51 +000059Bool pc_get_extra_suppression_info ( Error* err,
60 /*OUT*/Char* buf, Int nBuf );
sewardj024598e2008-09-18 14:43:05 +000061
62extern Bool h_clo_partial_loads_ok;
sewardj4815eb52008-10-20 23:33:49 +000063/* extern Bool h_clo_lossage_check; */
64extern Bool sg_clo_enable_sg_checks;
sewardj024598e2008-09-18 14:43:05 +000065
66Bool pc_process_cmd_line_options(Char* arg);
67void pc_print_usage(void);
68void pc_print_debug_usage(void);
69
70
71#endif
72
73/*--------------------------------------------------------------------*/
74/*--- end pc_common.h ---*/
75/*--------------------------------------------------------------------*/