-> 3.17.0 final.
[valgrind.git] / helgrind / hg_addrdescr.h
blob18d370d742e67ad45575e743326fff0ae627e25e
2 /*---------------------------------------------------------------------*/
3 /*--- Address Description, used e.g. to describe addresses involved ---*/
4 /*--- in race conditions, locks. ---*/
5 /*--- hg_addrdescr.h ---*/
6 /*---------------------------------------------------------------------*/
8 /*
9 This file is part of Helgrind, a Valgrind tool for detecting errors
10 in threaded programs.
12 Copyright (C) 2007-2017 OpenWorks Ltd
13 info@open-works.co.uk
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.
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.
25 You should have received a copy of the GNU General Public License
26 along with this program; if not, see <http://www.gnu.org/licenses/>.
28 The GNU General Public License is contained in the file COPYING.
31 #ifndef __HG_ADDRDESCR_H
32 #define __HG_ADDRDESCR_H
34 /* Describe an address as best you can, for error messages or
35 lock description, putting the result in ai.
36 This might allocate some memory in ai, to be cleared with
37 VG_(clear_addrinfo). */
38 extern void HG_(describe_addr) ( DiEpoch ep, Addr a, /*OUT*/AddrInfo* ai );
40 /* Get a readable description of addr, then print it using HG_(pp_addrdescr)
41 using xml False and VG_(printf) to emit the characters.
42 Returns True if a description was found/printed, False otherwise. */
43 extern Bool HG_(get_and_pp_addrdescr) (DiEpoch ep, Addr a);
45 /* For error creation/address description:
46 map 'data_addr' to a malloc'd chunk, if any.
47 Slow linear search accelerated in some special cases normal hash
48 search of the mallocmeta table. This is an abuse of the normal file
49 structure since this is exported by hg_main.c, not hg_addrdesc.c. Oh
50 Well. Returns True if found, False if not. Zero-sized blocks are
51 considered to contain the searched-for address if they equal that
52 address. */
53 Bool HG_(mm_find_containing_block)( /*OUT*/ExeContext** where,
54 /*OUT*/UInt* tnr,
55 /*OUT*/Addr* payload,
56 /*OUT*/SizeT* szB,
57 Addr data_addr );
60 #endif /* ! __HG_ADDRDESCR_H */
62 /*--------------------------------------------------------------------*/
63 /*--- end hg_addrdescr.h ---*/
64 /*--------------------------------------------------------------------*/