blob: b8cfb25f20ec038619f7f06452bc9b0bde473c7b [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
12 Copyright (C) 2008-2008 OpenWorks Ltd
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
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
57struct _SGEnv * sg_instrument_init ( void );
58
59void sg_instrument_fini ( struct _SGEnv * env );
60
61void sg_instrument_IRStmt ( /*MOD*/struct _SGEnv * env,
62 /*MOD*/IRSB* sbOut,
63 IRStmt* st,
64 VexGuestLayout* layout,
65 IRType gWordTy, IRType hWordTy );
66
67void sg_instrument_final_jump ( /*MOD*/struct _SGEnv * env,
68 /*MOD*/IRSB* sbOut,
69 IRExpr* next,
70 IRJumpKind jumpkind,
71 VexGuestLayout* layout,
72 IRType gWordTy, IRType hWordTy );
73#endif
74
75/*--------------------------------------------------------------------*/
76/*--- end sg_main.h ---*/
77/*--------------------------------------------------------------------*/