pub_core_syscalls.h \
pub_core_tooliface.h \
pub_core_translate.h \
+ pub_core_transtab.h \
ume.h \
vg_symtab2.h \
vg_symtypes.h
m_stacktrace.c \
m_tooliface.c \
m_translate.c \
+ m_transtab.c \
ume.c \
\
vg_scheduler.c \
vg_redir.c \
vg_dwarf.c \
vg_stabs.c \
- vg_symtypes.c \
- vg_transtab.c
+ vg_symtypes.c
## libplatform.a must be before libarch.a and libos.a, it seems.
stage2_extra= \
extern ULong VG_(bbs_done);
-/* ---------------------------------------------------------------------
- Exports of vg_transtab.c
- ------------------------------------------------------------------ */
-
-/* The fast-cache for tt-lookup, and for finding counters. */
-extern ULong* VG_(tt_fast) [VG_TT_FAST_SIZE];
-extern UInt* VG_(tt_fastN)[VG_TT_FAST_SIZE];
-
-
-extern void VG_(init_tt_tc) ( void );
-
-extern
-void VG_(add_to_trans_tab)( VexGuestExtents* vge,
- Addr64 entry,
- AddrH code,
- UInt code_len );
-
-extern Bool VG_(search_transtab) ( /*OUT*/AddrH* result,
- Addr64 guest_addr,
- Bool upd_cache );
-
-extern void VG_(discard_translations) ( Addr64 start, UInt range );
-
-extern void VG_(sanity_check_tt_tc) ( Char* caller );
-
-extern void VG_(print_tt_tc_stats) ( void );
-
-extern UInt VG_(get_bbs_translated) ( void );
-
-extern void VG_(show_BB_profile) ( void );
-
-
/* ---------------------------------------------------------------------
Exports of vg_syscall.S
------------------------------------------------------------------ */
#include "pub_core_aspacemgr.h"
#include "pub_core_syscalls.h"
#include "pub_core_tooliface.h"
+#include "pub_core_transtab.h"
#include "vki_unistd.h"
#include "core.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_tooliface.h"
+#include "pub_core_translate.h"
+#include "pub_core_transtab.h"
/*------------------------------------------------------------*/
if (!debugging_translation) {
// Note that we use orig_addr0, not orig_addr, which might have been
// changed by the redirection
- VG_(add_to_trans_tab)( &vge,
- orig_addr0,
- (Addr)(&tmpbuf[0]),
- tmpbuf_used );
+ VG_(add_to_transtab)( &vge,
+ orig_addr0,
+ (Addr)(&tmpbuf[0]),
+ tmpbuf_used );
}
VGP_POPCC(VgpTranslate);
/*--------------------------------------------------------------------*/
/*--- Management of the translation table and cache. ---*/
-/*--- vg_transtab.c ---*/
+/*--- m_transtab.c ---*/
/*--------------------------------------------------------------------*/
/*
#include "core.h"
#include "pub_core_tooliface.h"
+// XXX: this module should not depend on m_translate!
#include "pub_core_translate.h"
+#include "pub_core_transtab.h"
/* #define DEBUG_TRANSTAB */
pre: youngest_sector points to a valid (although possibly full)
sector.
*/
-void VG_(add_to_trans_tab)( VexGuestExtents* vge,
- Addr64 entry,
- AddrH code,
- UInt code_len )
+void VG_(add_to_transtab)( VexGuestExtents* vge,
+ Addr64 entry,
+ AddrH code,
+ UInt code_len )
{
Int tcAvailQ, reqdQ, y, i;
ULong *tce, *tce2;
vg_assert(code_len > 0 && code_len < 20000);
if (0)
- VG_(printf)("add_to_trans_tab(entry = 0x%llx, len = %d)\n",
+ VG_(printf)("add_to_transtab(entry = 0x%llx, len = %d)\n",
entry, code_len);
n_in_count++;
/*--------------------------------------------------------------------*/
-/*--- end vg_transtab.c ---*/
+/*--- end ---*/
/*--------------------------------------------------------------------*/
--- /dev/null
+
+/*--------------------------------------------------------------------*/
+/*--- The translation table and cache. ---*/
+/*--- pub_core_transtab.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward
+ jseward@acm.org
+
+ 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_TRANSTAB_H
+#define __PUB_CORE_TRANSTAB_H
+
+//--------------------------------------------------------------------
+// PURPOSE: This module is responsible for caching translations, and
+// enabling fast look-ups of them.
+//--------------------------------------------------------------------
+
+/* The fast-cache for tt-lookup, and for finding counters. */
+extern ULong* VG_(tt_fast) [VG_TT_FAST_SIZE];
+extern UInt* VG_(tt_fastN)[VG_TT_FAST_SIZE];
+
+extern void VG_(init_tt_tc) ( void );
+
+extern
+void VG_(add_to_transtab)( VexGuestExtents* vge,
+ Addr64 entry,
+ AddrH code,
+ UInt code_len );
+
+extern Bool VG_(search_transtab) ( /*OUT*/AddrH* result,
+ Addr64 guest_addr,
+ Bool upd_cache );
+
+extern void VG_(discard_translations) ( Addr64 start, UInt range );
+
+extern void VG_(sanity_check_tt_tc) ( Char* caller );
+
+extern void VG_(print_tt_tc_stats) ( void );
+
+extern UInt VG_(get_bbs_translated) ( void );
+
+extern void VG_(show_BB_profile) ( void );
+
+
+#endif // __PUB_CORE_TRANSTAB_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
#include "pub_core_execontext.h"
#include "pub_core_syscalls.h"
#include "pub_core_tooliface.h"
+#include "pub_core_transtab.h"
#include <dirent.h>
#include <dlfcn.h>
#include "pub_core_aspacemgr.h"
#include "pub_core_skiplist.h"
+#include "pub_core_transtab.h"
/*------------------------------------------------------------*/
/*--- General purpose redirection. ---*/
#include "pub_core_syscalls.h"
#include "pub_core_tooliface.h"
#include "pub_core_translate.h"
+#include "pub_core_transtab.h"
#include "vki_unistd.h"
/* ---------------------------------------------------------------------