|
From: <sv...@va...> - 2005-09-21 10:16:57
|
Author: sewardj Date: 2005-09-21 11:16:49 +0100 (Wed, 21 Sep 2005) New Revision: 4718 Log: Create a new module: m_clientstate. This holds various pieces of data to do with the state of the user-space simulation, that have never really had satisfactory homes before, and so had been sofa-surfing in various other modules. Start off by importing a bunch of stuff which had been hanging out in m_aspacemgr. Added: branches/ASPACEM/coregrind/m_clientstate.c branches/ASPACEM/coregrind/pub_core_clientstate.h Modified: branches/ASPACEM/coregrind/Makefile.am branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c branches/ASPACEM/coregrind/m_main.c branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c branches/ASPACEM/coregrind/pub_core_aspacemgr.h Modified: branches/ASPACEM/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 --- branches/ASPACEM/coregrind/Makefile.am 2005-09-21 09:44:22 UTC (rev 4= 717) +++ branches/ASPACEM/coregrind/Makefile.am 2005-09-21 10:16:49 UTC (rev 4= 718) @@ -35,6 +35,7 @@ coregrind.h \ pub_core_aspacemgr.h \ pub_core_basics.h \ + pub_core_clientstate.h \ pub_core_commandline.h \ pub_core_cpuid.h \ pub_core_debuginfo.h \ @@ -92,6 +93,7 @@ libcoregrind_singles_a_SOURCES =3D \ m_commandline.c \ m_cpuid.S \ + m_clientstate.c \ m_debugger.c \ m_debuglog.c \ m_errormgr.c \ Modified: branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.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 --- branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-21 09:44:2= 2 UTC (rev 4717) +++ branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-21 10:16:4= 9 UTC (rev 4718) @@ -55,28 +55,6 @@ =20 /*-----------------------------------------------------------------*/ /*--- ---*/ -/*--- Basic globals about the address space. ---*/ -/*--- ---*/ -/*-----------------------------------------------------------------*/ - -// FIXME: these are nothing to do with the address space manager -// and should be moved elsewhere. - -/* Client address space, lowest to highest (see top of ume.c) */ -Addr VG_(client_base); /* client address space limits */ -Addr VG_(client_end); - -Addr VG_(clstk_base); -Addr VG_(clstk_end); -UWord VG_(clstk_id); - -Addr VG_(brk_base) =3D 0; /* start of brk */ -Addr VG_(brk_limit) =3D 0; /* current brk */ - - - -/*-----------------------------------------------------------------*/ -/*--- ---*/ /*--- The Address Space Manager's state. ---*/ /*--- ---*/ /*-----------------------------------------------------------------*/ Added: branches/ASPACEM/coregrind/m_clientstate.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 --- branches/ASPACEM/coregrind/m_clientstate.c 2005-09-21 09:44:22 UTC (r= ev 4717) +++ branches/ASPACEM/coregrind/m_clientstate.c 2005-09-21 10:16:49 UTC (r= ev 4718) @@ -0,0 +1,58 @@ + +/*--------------------------------------------------------------------*/ +/*--- A home for miscellaneous bits of information which pertain ---*/ +/*--- to the client's state. ---*/ +/*--- m_clientstate.c ---*/ +/*--------------------------------------------------------------------*/ + +/* + This file is part of Valgrind, a dynamic binary instrumentation + framework. + + Copyright (C) 2000-2005 Julian Seward=20 + js...@ac... + + 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 "pub_core_basics.h" +#include "pub_core_clientstate.h" + +/*-----------------------------------------------------------------*/ +/*--- ---*/ +/*--- Basic globals about the address space. ---*/ +/*--- ---*/ +/*-----------------------------------------------------------------*/ + +// TODO: get rid of as many of these as possible. + +/* Client address space, lowest to highest (see top of ume.c) */ +Addr VG_(client_base); /* client address space limits */ +Addr VG_(client_end); + +Addr VG_(clstk_base); +Addr VG_(clstk_end); +UWord VG_(clstk_id); + +Addr VG_(brk_base) =3D 0; /* start of brk */ +Addr VG_(brk_limit) =3D 0; /* current brk */ + + +/*--------------------------------------------------------------------*/ +/*--- end ---*/ +/*--------------------------------------------------------------------*/ Modified: branches/ASPACEM/coregrind/m_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 --- branches/ASPACEM/coregrind/m_main.c 2005-09-21 09:44:22 UTC (rev 4717= ) +++ branches/ASPACEM/coregrind/m_main.c 2005-09-21 10:16:49 UTC (rev 4718= ) @@ -32,6 +32,7 @@ =20 #include "pub_core_basics.h" #include "pub_core_threadstate.h" +#include "pub_core_clientstate.h" #include "pub_core_aspacemgr.h" #include "pub_core_commandline.h" #include "pub_core_debuglog.h" Modified: branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.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 --- branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c 2005-09-21 09:= 44:22 UTC (rev 4717) +++ branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c 2005-09-21 10:= 16:49 UTC (rev 4718) @@ -32,6 +32,7 @@ #include "pub_core_threadstate.h" #include "pub_core_debuginfo.h" // VG_(di_notify_*) #include "pub_core_aspacemgr.h" +#include "pub_core_clientstate.h" // VG_(brk_base), VG_(brk_limit) #include "pub_core_debuglog.h" #include "pub_core_errormgr.h" #include "pub_core_libcbase.h" Modified: branches/ASPACEM/coregrind/pub_core_aspacemgr.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 --- branches/ASPACEM/coregrind/pub_core_aspacemgr.h 2005-09-21 09:44:22 U= TC (rev 4717) +++ branches/ASPACEM/coregrind/pub_core_aspacemgr.h 2005-09-21 10:16:49 U= TC (rev 4718) @@ -41,17 +41,6 @@ =20 #include "pub_tool_aspacemgr.h" =20 -// Address space globals -extern Addr VG_(client_base); // client address space limits -extern Addr VG_(client_end); - -extern Addr VG_(clstk_base); // client stack range -extern Addr VG_(clstk_end); -extern UWord VG_(clstk_id); // client stack id - -extern Addr VG_(brk_base); // start of brk -extern Addr VG_(brk_limit); // current brk - /* Parses /proc/self/maps, calling `record_mapping' for each entry. */ extern=20 void VG_(parse_procselfmaps) ( Added: branches/ASPACEM/coregrind/pub_core_clientstate.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 --- branches/ASPACEM/coregrind/pub_core_clientstate.h 2005-09-21 09:44:22= UTC (rev 4717) +++ branches/ASPACEM/coregrind/pub_core_clientstate.h 2005-09-21 10:16:49= UTC (rev 4718) @@ -0,0 +1,56 @@ + +/*--------------------------------------------------------------------*/ +/*--- Misc client state info pub_core_clientstate.h ---*/ +/*--------------------------------------------------------------------*/ + +/* + This file is part of Valgrind, a dynamic binary instrumentation + framework. + + Copyright (C) 2000-2005 Julian Seward + js...@ac... + + 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. +*/ + +#ifndef __PUB_CORE_CLIENTSTATE_H +#define __PUB_CORE_CLIENTSTATE_H + +//-------------------------------------------------------------------- +// PURPOSE: This module holds various bits of client state which don't +// live comfortably anywhere else. Note that the ThreadStates for the +// client don't live here; they instead live in m_threadstate.h. +//-------------------------------------------------------------------- + +// Address space globals +extern Addr VG_(client_base); // client address space limits +extern Addr VG_(client_end); + +extern Addr VG_(clstk_base); // client stack range +extern Addr VG_(clstk_end); +extern UWord VG_(clstk_id); // client stack id + +extern Addr VG_(brk_base); // start of brk +extern Addr VG_(brk_limit); // current brk + + +#endif // __PUB_CORE_CLIENTSTATE_H + +/*--------------------------------------------------------------------*/ +/*--- end ---*/ +/*--------------------------------------------------------------------*/ |