blob: c90574c5e5b2342ce25608a811c04ffc38da3ef7 [file] [log] [blame]
njn3e884182003-04-15 13:03:23 +00001
2/*--------------------------------------------------------------------*/
3/*--- Replacements for strcpy(), memcpy() et al, which run on the ---*/
4/*--- simulated CPU. ---*/
njn1d0825f2006-03-27 11:37:07 +00005/*--- mc_replace_strmem.c ---*/
njn3e884182003-04-15 13:03:23 +00006/*--------------------------------------------------------------------*/
7
8/*
nethercote137bc552003-11-14 17:47:54 +00009 This file is part of MemCheck, a heavyweight Valgrind tool for
njn0e1b5142003-04-15 14:58:06 +000010 detecting memory errors.
njn3e884182003-04-15 13:03:23 +000011
Elliott Hughesed398002017-06-21 14:41:24 -070012 Copyright (C) 2000-2017 Julian Seward
njn3e884182003-04-15 13:03:23 +000013 jseward@acm.org
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
njnc7561b92005-06-19 01:24:32 +000033#include "pub_tool_basics.h"
philippe6643e962012-01-17 21:16:30 +000034#include "pub_tool_poolalloc.h"
njnc7561b92005-06-19 01:24:32 +000035#include "pub_tool_hashtable.h"
njnc7561b92005-06-19 01:24:32 +000036#include "pub_tool_redir.h"
37#include "pub_tool_tooliface.h"
florian1a046d52013-09-16 20:56:35 +000038#include "pub_tool_clreq.h"
njnc7561b92005-06-19 01:24:32 +000039
njn34419c12003-05-02 17:24:29 +000040#include "mc_include.h"
fitzhardinge98abfc72003-12-16 02:05:15 +000041#include "memcheck.h"
njn3e884182003-04-15 13:03:23 +000042
bart575ce8e2011-05-15 07:04:03 +000043#define RECORD_OVERLAP_ERROR(s, src, dst, len) \
sewardj4b3a7422011-10-24 13:21:57 +000044 VALGRIND_DO_CLIENT_REQUEST_STMT( \
bart575ce8e2011-05-15 07:04:03 +000045 _VG_USERREQ__MEMCHECK_RECORD_OVERLAP_ERROR, \
46 s, src, dst, len, 0)
njn3e884182003-04-15 13:03:23 +000047
bart9c7779b2013-11-24 17:48:13 +000048#include "../shared/vg_replace_strmem.c"