blob: 929dba410e9bb7ac58b7b036a4620b3b061ab1e7 [file] [log] [blame]
sewardj024598e2008-09-18 14:43:05 +00001
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
Elliott Hughesed398002017-06-21 14:41:24 -070012 Copyright (C) 2008-2017 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 __SG_MAIN_H
34
35#define __SG_MAIN_H
36
37void sg_pre_clo_init ( void );
38void sg_post_clo_init ( void );
39void sg_fini(Int exitcode);
40
41void sg_die_mem_stack ( Addr old_SP, SizeT len );
42void sg_pre_thread_ll_create ( ThreadId parent, ThreadId child );
43void sg_pre_thread_first_insn ( ThreadId tid );
44
45void sg_new_mem_mmap( Addr a, SizeT len,
46 Bool rr, Bool ww, Bool xx, ULong di_handle );
47void sg_new_mem_startup( Addr a, SizeT len,
48 Bool rr, Bool ww, Bool xx, ULong di_handle );
49void 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
55struct _SGEnv; /* abstract export */
56
sewardje6451332009-07-09 10:45:11 +000057struct _SGEnv* sg_instrument_init ( IRTemp (*newIRTemp_cb)(IRType,void*),
58 void* newIRTemp_opaque );
sewardj024598e2008-09-18 14:43:05 +000059
60void sg_instrument_fini ( struct _SGEnv * env );
61
62void sg_instrument_IRStmt ( /*MOD*/struct _SGEnv * env,
63 /*MOD*/IRSB* sbOut,
64 IRStmt* st,
florian3c0c9472014-09-24 12:06:55 +000065 const VexGuestLayout* layout,
sewardj024598e2008-09-18 14:43:05 +000066 IRType gWordTy, IRType hWordTy );
67
68void sg_instrument_final_jump ( /*MOD*/struct _SGEnv * env,
69 /*MOD*/IRSB* sbOut,
70 IRExpr* next,
71 IRJumpKind jumpkind,
florian3c0c9472014-09-24 12:06:55 +000072 const VexGuestLayout* layout,
sewardj024598e2008-09-18 14:43:05 +000073 IRType gWordTy, IRType hWordTy );
74#endif
75
76/*--------------------------------------------------------------------*/
77/*--- end sg_main.h ---*/
78/*--------------------------------------------------------------------*/