sewardj | 024598e | 2008-09-18 14:43:05 +0000 | [diff] [blame] | 1 | |
| 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 | |
Elliott Hughes | ed39800 | 2017-06-21 14:41:24 -0700 | [diff] [blame] | 12 | Copyright (C) 2008-2017 OpenWorks Ltd |
sewardj | 024598e | 2008-09-18 14:43:05 +0000 | [diff] [blame] | 13 | 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 | |
| 37 | typedef struct _Seg Seg; /* abstract every except in h_main.c */ |
| 38 | |
| 39 | void sg_record_error_SorG ( ThreadId tid, |
| 40 | Addr addr, SSizeT sszB, |
sewardj | f5b019f | 2011-05-11 12:01:37 +0000 | [diff] [blame] | 41 | HChar* expect, HChar* actual, HChar* delta ); |
sewardj | 024598e | 2008-09-18 14:43:05 +0000 | [diff] [blame] | 42 | |
| 43 | void h_record_heap_error( Addr a, SizeT size, Seg* vseg, Bool is_write ); |
| 44 | |
| 45 | void h_record_arith_error( Seg* seg1, Seg* seg2, HChar* opname ); |
| 46 | |
florian | 19f91bb | 2012-11-10 22:29:54 +0000 | [diff] [blame] | 47 | void h_record_sysparam_error( ThreadId tid, CorePart part, const HChar* s, |
sewardj | 024598e | 2008-09-18 14:43:05 +0000 | [diff] [blame] | 48 | Addr lo, Addr hi, Seg* seglo, Seg* seghi ); |
| 49 | |
florian | 8e3fbb5 | 2014-10-20 19:02:38 +0000 | [diff] [blame] | 50 | Bool pc_eq_Error ( VgRes res, const Error* e1, const Error* e2 ); |
| 51 | void pc_before_pp_Error ( const Error* err ); |
| 52 | void pc_pp_Error ( const Error* err ); |
| 53 | UInt pc_update_Error_extra ( const Error* err ); |
florian | 19f91bb | 2012-11-10 22:29:54 +0000 | [diff] [blame] | 54 | Bool pc_is_recognised_suppression ( const HChar* name, Supp *su ); |
| 55 | Bool pc_read_extra_suppression_info ( Int fd, HChar** bufpp, |
philippe | 362441d | 2013-07-22 22:00:13 +0000 | [diff] [blame] | 56 | SizeT* nBufp, Int* lineno, Supp* su ); |
florian | 8e3fbb5 | 2014-10-20 19:02:38 +0000 | [diff] [blame] | 57 | Bool pc_error_matches_suppression (const Error* err, const Supp* su); |
| 58 | const HChar* pc_get_error_name ( const Error* err ); |
| 59 | SizeT pc_get_extra_suppression_info ( const Error* err, |
florian | dbb3584 | 2012-10-27 18:39:11 +0000 | [diff] [blame] | 60 | /*OUT*/HChar* buf, Int nBuf ); |
florian | 8e3fbb5 | 2014-10-20 19:02:38 +0000 | [diff] [blame] | 61 | SizeT pc_print_extra_suppression_use ( const Supp* su, |
philippe | 4e32d67 | 2013-10-17 22:10:41 +0000 | [diff] [blame] | 62 | /*OUT*/HChar* buf, Int nBuf ); |
florian | 8e3fbb5 | 2014-10-20 19:02:38 +0000 | [diff] [blame] | 63 | void pc_update_extra_suppression_use (const Error* err, const Supp* su); |
sewardj | 024598e | 2008-09-18 14:43:05 +0000 | [diff] [blame] | 64 | |
| 65 | extern Bool h_clo_partial_loads_ok; |
sewardj | 4815eb5 | 2008-10-20 23:33:49 +0000 | [diff] [blame] | 66 | /* extern Bool h_clo_lossage_check; */ |
| 67 | extern Bool sg_clo_enable_sg_checks; |
sewardj | 024598e | 2008-09-18 14:43:05 +0000 | [diff] [blame] | 68 | |
florian | 19f91bb | 2012-11-10 22:29:54 +0000 | [diff] [blame] | 69 | Bool pc_process_cmd_line_options(const HChar* arg); |
sewardj | 024598e | 2008-09-18 14:43:05 +0000 | [diff] [blame] | 70 | void pc_print_usage(void); |
| 71 | void pc_print_debug_usage(void); |
| 72 | |
| 73 | |
| 74 | #endif |
| 75 | |
| 76 | /*--------------------------------------------------------------------*/ |
| 77 | /*--- end pc_common.h ---*/ |
| 78 | /*--------------------------------------------------------------------*/ |