sewardj | 024598e | 2008-09-18 14:43:05 +0000 | [diff] [blame] | 1 | |
| 2 | /*--------------------------------------------------------------------*/ |
| 3 | /*--- Ptrcheck: a pointer-use checker. ---*/ |
| 4 | /*--- Exports for stack and global access checking. ---*/ |
| 5 | /*--- sg_main.h ---*/ |
| 6 | /*--------------------------------------------------------------------*/ |
| 7 | |
| 8 | /* |
| 9 | This file is part of Ptrcheck, a Valgrind tool for checking pointer |
| 10 | use in programs. |
| 11 | |
sewardj | b3a1e4b | 2015-08-21 11:32:26 +0000 | [diff] [blame] | 12 | Copyright (C) 2008-2015 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 __SG_MAIN_H |
| 34 | |
| 35 | #define __SG_MAIN_H |
| 36 | |
| 37 | void sg_pre_clo_init ( void ); |
| 38 | void sg_post_clo_init ( void ); |
| 39 | void sg_fini(Int exitcode); |
| 40 | |
| 41 | void sg_die_mem_stack ( Addr old_SP, SizeT len ); |
| 42 | void sg_pre_thread_ll_create ( ThreadId parent, ThreadId child ); |
| 43 | void sg_pre_thread_first_insn ( ThreadId tid ); |
| 44 | |
| 45 | void sg_new_mem_mmap( Addr a, SizeT len, |
| 46 | Bool rr, Bool ww, Bool xx, ULong di_handle ); |
| 47 | void sg_new_mem_startup( Addr a, SizeT len, |
| 48 | Bool rr, Bool ww, Bool xx, ULong di_handle ); |
| 49 | void sg_die_mem_munmap ( Addr a, SizeT len ); |
| 50 | |
| 51 | /* These really ought to be moved elsewhere, so that we don't have to |
| 52 | include this file in h_main.c. See comments in sg_main.c and |
| 53 | h_main.c for what this is about. */ |
| 54 | |
| 55 | struct _SGEnv; /* abstract export */ |
| 56 | |
sewardj | e645133 | 2009-07-09 10:45:11 +0000 | [diff] [blame] | 57 | struct _SGEnv* sg_instrument_init ( IRTemp (*newIRTemp_cb)(IRType,void*), |
| 58 | void* newIRTemp_opaque ); |
sewardj | 024598e | 2008-09-18 14:43:05 +0000 | [diff] [blame] | 59 | |
| 60 | void sg_instrument_fini ( struct _SGEnv * env ); |
| 61 | |
| 62 | void sg_instrument_IRStmt ( /*MOD*/struct _SGEnv * env, |
| 63 | /*MOD*/IRSB* sbOut, |
| 64 | IRStmt* st, |
florian | 3c0c947 | 2014-09-24 12:06:55 +0000 | [diff] [blame] | 65 | const VexGuestLayout* layout, |
sewardj | 024598e | 2008-09-18 14:43:05 +0000 | [diff] [blame] | 66 | IRType gWordTy, IRType hWordTy ); |
| 67 | |
| 68 | void sg_instrument_final_jump ( /*MOD*/struct _SGEnv * env, |
| 69 | /*MOD*/IRSB* sbOut, |
| 70 | IRExpr* next, |
| 71 | IRJumpKind jumpkind, |
florian | 3c0c947 | 2014-09-24 12:06:55 +0000 | [diff] [blame] | 72 | const VexGuestLayout* layout, |
sewardj | 024598e | 2008-09-18 14:43:05 +0000 | [diff] [blame] | 73 | IRType gWordTy, IRType hWordTy ); |
| 74 | #endif |
| 75 | |
| 76 | /*--------------------------------------------------------------------*/ |
| 77 | /*--- end sg_main.h ---*/ |
| 78 | /*--------------------------------------------------------------------*/ |