|
From: <sv...@va...> - 2005-05-08 19:09:00
|
Author: njn
Date: 2005-05-08 20:08:54 +0100 (Sun, 08 May 2005)
New Revision: 3643
Removed:
trunk/coregrind/vg_default.c
Modified:
trunk/coregrind/Makefile.am
trunk/coregrind/core.h
trunk/coregrind/vg_main.c
trunk/coregrind/vg_pthreadmodel.c
Log:
Removed vg_default.c, hooray.
Modified: trunk/coregrind/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/Makefile.am 2005-05-08 19:04:53 UTC (rev 3642)
+++ trunk/coregrind/Makefile.am 2005-05-08 19:08:54 UTC (rev 3643)
@@ -75,7 +75,6 @@
ume.c \
\
vg_scheduler.c \
- vg_default.c \
vg_demangle.c \
vg_hashtable.c \
vg_replace_malloc.c \
Modified: trunk/coregrind/core.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/core.h 2005-05-08 19:04:53 UTC (rev 3642)
+++ trunk/coregrind/core.h 2005-05-08 19:08:54 UTC (rev 3643)
@@ -508,14 +508,6 @@
=20
=20
/* ---------------------------------------------------------------------
- Exports of vg_defaults.c
- ------------------------------------------------------------------ */
-
-extern Bool VG_(tl_malloc_called_deliberately);
-
-
-
-/* ---------------------------------------------------------------------
Exports of vg_scheduler.c
------------------------------------------------------------------ */
=20
Deleted: trunk/coregrind/vg_default.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_default.c 2005-05-08 19:04:53 UTC (rev 3642)
+++ trunk/coregrind/vg_default.c 2005-05-08 19:08:54 UTC (rev 3643)
@@ -1,96 +0,0 @@
-
-/*--------------------------------------------------------------------*/
-/*--- Default panicky definitions of template functions that tools ---*/
-/*--- should override. ---*/
-/*--- vg_defaults.c ---*/
-/*--------------------------------------------------------------------*/
-
-/*
- This file is part of Valgrind, a dynamic binary instrumentation
- framework.
-
- Copyright (C) 2000-2005 Nicholas Nethercote
- nj...@va...
-
- 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, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307, USA.
-
- The GNU General Public License is contained in the file COPYING.
-*/
-
-
-#include "core.h"
-
-/* ---------------------------------------------------------------------
- Error messages (for malformed tools)
- ------------------------------------------------------------------ */
-
-/* If the tool fails to define one or more of the required functions,
- * make it very clear what went wrong! */
-
-__attribute__ ((noreturn))
-void VG_(missing_tool_func) ( const Char* fn )
-{
- VG_(printf)(
- "\nTool error:\n"
- " The tool you have selected is missing the function `%s',\n"
- " which is required.\n\n",
- fn);
- VG_(tool_panic)("Missing tool function");
-}
-
-static __attribute__ ((noreturn))
-void malloc_panic ( const Char* fn )
-{
- VG_(printf)(
- "\nTool error:\n"
- " The tool you have selected is missing the function `%s'\n"
- " required because it is replacing malloc() et al.\n\n",
- fn);
- VG_(tool_panic)("Missing tool function");
-}
-
-/*------------------------------------------------------------*/
-/*--- Replacing malloc et al ---*/
-/*------------------------------------------------------------*/
-
-Bool VG_(tl_malloc_called_deliberately) =3D False;
-
-/* If the tool hasn't replaced malloc(), this one can be called
- deliberately. The lock variable ensures that this isn't called by
- accident, which could happen if a malloc()-replacing tool forgot to
- implement TL_(malloc)() or TL_(free)(). */
-__attribute__ ((weak))
-void* TL_(malloc)( ThreadId tid, SizeT size )
-{
- if (VG_(tl_malloc_called_deliberately))
- return VG_(cli_malloc)(VG_MIN_MALLOC_SZB, size);
- else=20
- malloc_panic(__PRETTY_FUNCTION__);
-}
-
-__attribute__ ((weak))
-void TL_(free)( ThreadId tid, void* p )
-{
- /* see comment for TL_(malloc)() above */
- if (VG_(tl_malloc_called_deliberately))
- VG_(cli_free)(p);
- else=20
- malloc_panic(__PRETTY_FUNCTION__);
-}
-
-/*--------------------------------------------------------------------*/
-/*--- end vg_defaults.c ---*/
-/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/vg_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_main.c 2005-05-08 19:04:53 UTC (rev 3642)
+++ trunk/coregrind/vg_main.c 2005-05-08 19:08:54 UTC (rev 3643)
@@ -2872,7 +2872,21 @@
/* Print Vex storage stats */
if (0)
LibVEX_ShowAllocStats();
+}
=20
+/* If the tool fails to define one or more of the required functions,
+ * make it very clear what went wrong! */
+// XXX: this is not a very good place for this function. Hopefully we'l=
l be
+// able to remove it in the future.
+__attribute__ ((noreturn))
+void VG_(missing_tool_func) ( const Char* fn )
+{
+ VG_(printf)(
+ "\nTool error:\n"
+ " The tool you have selected is missing the function `%s',\n"
+ " which is required.\n\n",
+ fn);
+ VG_(tool_panic)("Missing tool function");
}
=20
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/vg_pthreadmodel.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_pthreadmodel.c 2005-05-08 19:04:53 UTC (rev 3642)
+++ trunk/coregrind/vg_pthreadmodel.c 2005-05-08 19:08:54 UTC (rev 3643)
@@ -201,10 +201,20 @@
// [Possible: When using a tool that replaces malloc(), we want to ca=
ll
// the replacement version. Otherwise, we want to use VG_(cli_mallo=
c)().
// So we go via the default version of TL_(malloc)() in vg_default?]
- VG_(tl_malloc_called_deliberately) =3D True;
- data =3D TL_(malloc)(sizeof(*data));
- VG_(tl_malloc_called_deliberately) =3D False;
+ tl_assert2(0, "read the comment in the code about this...");
=20
+ // XXX: These three lines are going to have to change. They relied o=
n
+ // TL_(malloc) being a weak symbol, and it just doesn't fit with the
+ // VG_(tdict) approach that we've switched to. The right way to do t=
his
+ // will be to provide a function in the core that checks if
+ // VG_(tdict).malloc_malloc has been set (or perhaps it would be bett=
er
+ // to check whether VG_USERREQ__GET_MALLOCFUNCS has been called, ie.
+ // whether replace_malloc.c:init() has been called); if so, it shoul=
d
+ // call it, if not, it should call VG_(cli_malloc)().
+// VG_(tl_malloc_called_deliberately) =3D True;
+// data =3D TL_(malloc)(sizeof(*data));
+// VG_(tl_malloc_called_deliberately) =3D False;
+
VG_TRACK(pre_mem_write, Vg_CorePThread, tst->tid, "new thread data",
(Addr)data, sizeof(*data));
data->startfunc =3D start;
|