forked from Echelon9/valgrind
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathh_main.h
80 lines (63 loc) · 3.06 KB
/
h_main.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*--------------------------------------------------------------------*/
/*--- Ptrcheck: a pointer-use checker. ---*/
/*--- Exports for heap access checking. ---*/
/*--- h_main.h ---*/
/*--------------------------------------------------------------------*/
/*
This file is part of Ptrcheck, a Valgrind tool for checking pointer
use in programs.
Copyright (C) 2003-2017 Nicholas Nethercote
Copyright (C) 2008-2017 OpenWorks Ltd
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>.
The GNU General Public License is contained in the file COPYING.
*/
#ifndef __H_MAIN_H
#define __H_MAIN_H
// Choose values that couldn't possibly be pointers
#define NONPTR ((Seg*)0xA1)
#define UNKNOWN ((Seg*)0xB2)
#define BOTTOM ((Seg*)0xC3)
static inline Bool is_known_segment(Seg* teg) {
return (UNKNOWN != teg && BOTTOM != teg && NONPTR != teg);
// better? teg <= BOTTOM
}
void Seg__cmp(Seg* seg, Addr a, Int* cmp, UWord* n);
Bool Seg__is_freed(Seg* seg);
ExeContext* Seg__where(Seg* seg);
SizeT Seg__size(Seg* seg);
Addr Seg__addr(Seg* seg);
void h_pre_clo_init ( void );
void h_post_clo_init ( void );
void h_fini ( Int exitcode );
void* h_replace_malloc ( ThreadId tid, SizeT n );
void* h_replace___builtin_new ( ThreadId tid, SizeT n );
void* h_replace___builtin_vec_new ( ThreadId tid, SizeT n );
void* h_replace_memalign ( ThreadId tid, SizeT align, SizeT n );
void* h_replace_calloc ( ThreadId tid, SizeT nmemb, SizeT size1 );
void h_replace_free ( ThreadId tid, void* p );
void h_replace___builtin_delete ( ThreadId tid, void* p );
void h_replace___builtin_vec_delete ( ThreadId tid, void* p );
void* h_replace_realloc ( ThreadId tid, void* p_old, SizeT new_size );
SizeT h_replace_malloc_usable_size ( ThreadId tid, void* p );
/* Note that this also does the sg_ instrumentation. */
IRSB* h_instrument ( VgCallbackClosure* closure,
IRSB* sbIn,
const VexGuestLayout* layout,
const VexGuestExtents* vge,
const VexArchInfo* archinfo_host,
IRType gWordTy, IRType hWordTy );
#endif
/*--------------------------------------------------------------------*/
/*--- end h_main.h ---*/
/*--------------------------------------------------------------------*/