Author: njn
Date: 2005-06-13 05:21:38 +0100 (Mon, 13 Jun 2005)
New Revision: 3903
Log:
Created m_machine, for various machine-related things.
Added:
trunk/coregrind/m_machine.c
trunk/coregrind/pub_core_machine.h
trunk/include/pub_tool_machine.h
Modified:
trunk/cachegrind/cg_main.c
trunk/coregrind/Makefile.am
trunk/coregrind/core.h
trunk/coregrind/m_debuginfo/symtab.c
trunk/coregrind/m_debuginfo/symtypes.c
trunk/coregrind/m_main.c
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/m_sigframe/sigframe-amd64-linux.c
trunk/coregrind/m_sigframe/sigframe-x86-linux.c
trunk/coregrind/m_signals.c
trunk/coregrind/m_stacktrace.c
trunk/coregrind/ume.c
trunk/helgrind/hg_main.c
trunk/include/Makefile.am
trunk/include/basic_types.h
trunk/include/tool.h
trunk/memcheck/mac_shared.c
trunk/memcheck/mc_main.c
trunk/memcheck/tests/Makefile.am
Modified: trunk/cachegrind/cg_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/cachegrind/cg_main.c 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/cachegrind/cg_main.c 2005-06-13 04:21:38 UTC (rev 3903)
@@ -37,6 +37,7 @@
#include "pub_tool_libcfile.h"
#include "pub_tool_libcprint.h"
#include "pub_tool_libcproc.h"
+#include "pub_tool_machine.h"
#include "pub_tool_mallocfree.h"
#include "pub_tool_options.h"
#include "pub_tool_profile.h"
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-06-12 20:51:09 UTC (rev 3902)
+++ trunk/coregrind/Makefile.am 2005-06-13 04:21:38 UTC (rev 3903)
@@ -53,6 +53,7 @@
pub_core_libcprint.h \
pub_core_libcproc.h \
pub_core_libcsignal.h \
+ pub_core_machine.h \
pub_core_main.h \
pub_core_mallocfree.h \
pub_core_options.h \
@@ -103,6 +104,7 @@
m_libcprint.c \
m_libcproc.c \
m_libcsignal.c \
+ m_machine.c \
m_main.c \
m_mallocfree.c \
m_options.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-06-12 20:51:09 UTC (rev 3902)
+++ trunk/coregrind/core.h 2005-06-13 04:21:38 UTC (rev 3903)
@@ -35,48 +35,16 @@
#include "tool.h" // tool stuff
=20
#include "libvex.h"
+
+// XXX: this is needed because pub_core_scheduler needs VexGuestXXXState=
...
#if defined(VGA_x86)
# include "libvex_guest_x86.h"
-# define VGA_ELF_ENDIANNESS ELFDATA2LSB
-# define VGA_ELF_MACHINE EM_386
-# define VGA_ELF_CLASS ELFCLASS32
-# define VGA_INSTR_PTR guest_EIP
-# define VGA_STACK_PTR guest_ESP
-# define VGA_FRAME_PTR guest_EBP
-# define VGA_CLREQ_ARGS guest_EAX
-# define VGA_CLREQ_RET guest_EDX
#elif defined(VGA_amd64)
# include "libvex_guest_amd64.h"
-# define VGA_ELF_ENDIANNESS ELFDATA2LSB
-# define VGA_ELF_MACHINE EM_X86_64
-# define VGA_ELF_CLASS ELFCLASS64
-# define VGA_INSTR_PTR guest_RIP
-# define VGA_STACK_PTR guest_RSP
-# define VGA_FRAME_PTR guest_RBP
-# define VGA_CLREQ_ARGS guest_RAX
-# define VGA_CLREQ_RET guest_RDX
-#elif defined(VGA_arm)
-#define VGA_ELF_ENDIANNESS ELFDATA2LSB
-#define VGA_ELF_MACHINE EM_ARM
-#define VGA_ELF_CLASS ELFCLASS32
- // XXX: Not sure, but I think:
- // r11 =3D frame pointer
- // r12 =3D "implicit parameter" (neither caller-save, nor callee-sa=
ve)
- // r13 =3D stack pointer
- // r14 =3D link register
- // r15 =3D program counter
-# define VGA_INSTR_PTR guest_R15
-# define VGA_STACK_PTR guest_R13
-# define VGA_FRAME_PTR guest_R11
-# define VGA_CLREQ_ARGS guest_R0
-# define VGA_CLREQ_RET guest_R0
#else
# error Unknown arch
#endif
=20
-
-
-
#include <setjmp.h> // for jmp_buf
=20
#include "pub_core_scheduler.h" // for types 'ThreadArchState'
@@ -140,17 +108,6 @@
extern Bool VGA_(getArchAndSubArch)( /*OUT*/VexArch*,=20
/*OUT*/VexSubArch* );
=20
-// Accessors for the ThreadArchState
-#define INSTR_PTR(regs) ((regs).vex.VGA_INSTR_PTR)
-#define STACK_PTR(regs) ((regs).vex.VGA_STACK_PTR)
-#define FRAME_PTR(regs) ((regs).vex.VGA_FRAME_PTR)
-#define CLREQ_ARGS(regs) ((regs).vex.VGA_CLREQ_ARGS)
-#define CLREQ_RET(regs) ((regs).vex.VGA_CLREQ_RET)
-// Offsets for the Vex state
-#define O_STACK_PTR (offsetof(VexGuestArchState, VGA_STACK_PTR))
-#define O_CLREQ_RET (offsetof(VexGuestArchState, VGA_CLREQ_RET))
-
-
// Setting up the initial thread (1) state
extern void=20
VGA_(init_thread1state) ( Addr client_eip,=20
Modified: trunk/coregrind/m_debuginfo/symtab.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/m_debuginfo/symtab.c 2005-06-12 20:51:09 UTC (rev 390=
2)
+++ trunk/coregrind/m_debuginfo/symtab.c 2005-06-13 04:21:38 UTC (rev 390=
3)
@@ -37,6 +37,7 @@
#include "pub_core_libcfile.h"
#include "pub_core_libcmman.h"
#include "pub_core_libcprint.h"
+#include "pub_core_machine.h"
#include "pub_core_mallocfree.h"
#include "pub_core_options.h"
#include "pub_core_profile.h"
Modified: trunk/coregrind/m_debuginfo/symtypes.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/m_debuginfo/symtypes.c 2005-06-12 20:51:09 UTC (rev 3=
902)
+++ trunk/coregrind/m_debuginfo/symtypes.c 2005-06-13 04:21:38 UTC (rev 3=
903)
@@ -36,6 +36,7 @@
#include "pub_core_libcmman.h"
#include "pub_core_libcprint.h"
#include "pub_core_libcsignal.h"
+#include "pub_core_machine.h"
#include "pub_core_mallocfree.h"
#include "pub_core_tooliface.h"
#include "priv_symtypes.h"
Added: trunk/coregrind/m_machine.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/m_machine.c 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/coregrind/m_machine.c 2005-06-13 04:21:38 UTC (rev 3903)
@@ -0,0 +1,99 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Machine-related stuff. m_machine.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 "core.h"
+#include "pub_core_libcassert.h"
+#include "pub_core_libcbase.h"
+#include "pub_core_machine.h"
+
+#define INSTR_PTR(regs) ((regs).vex.VGA_INSTR_PTR)
+#define STACK_PTR(regs) ((regs).vex.VGA_STACK_PTR)
+#define FRAME_PTR(regs) ((regs).vex.VGA_FRAME_PTR)
+
+Addr VG_(get_SP) ( ThreadId tid )
+{
+ return STACK_PTR( VG_(threads)[tid].arch );
+}
+
+Addr VG_(get_IP) ( ThreadId tid )
+{
+ return INSTR_PTR( VG_(threads)[tid].arch );
+}
+
+Addr VG_(get_FP) ( ThreadId tid )
+{
+ return FRAME_PTR( VG_(threads)[tid].arch );
+}
+
+void VG_(set_SP) ( ThreadId tid, Addr sp )
+{
+ STACK_PTR( VG_(threads)[tid].arch ) =3D sp;
+}
+
+void VG_(set_IP) ( ThreadId tid, Addr ip )
+{
+ INSTR_PTR( VG_(threads)[tid].arch ) =3D ip;
+}
+
+
+void VG_(get_shadow_regs_area) ( ThreadId tid, OffT offset, SizeT size,
+ UChar* area )
+{
+ ThreadState* tst;
+
+ vg_assert(VG_(is_valid_tid)(tid));
+ tst =3D & VG_(threads)[tid];
+
+ // Bounds check
+ vg_assert(0 <=3D offset && offset < sizeof(VexGuestArchState));
+ vg_assert(offset + size <=3D sizeof(VexGuestArchState));
+
+ VG_(memcpy)( area, (void*)(((Addr)&(tst->arch.vex_shadow)) + offset),=
size);
+}
+
+void VG_(set_shadow_regs_area) ( ThreadId tid, OffT offset, SizeT size,
+ const UChar* area )
+{
+ ThreadState* tst;
+
+ vg_assert(VG_(is_valid_tid)(tid));
+ tst =3D & VG_(threads)[tid];
+
+ // Bounds check
+ vg_assert(0 <=3D offset && offset < sizeof(VexGuestArchState));
+ vg_assert(offset + size <=3D sizeof(VexGuestArchState));
+
+ VG_(memcpy)( (void*)(((Addr)(&tst->arch.vex_shadow)) + offset), area,=
size);
+}
+
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: trunk/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
--- trunk/coregrind/m_main.c 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/coregrind/m_main.c 2005-06-13 04:21:38 UTC (rev 3903)
@@ -43,6 +43,7 @@
#include "pub_core_libcprint.h"
#include "pub_core_libcproc.h"
#include "pub_core_libcsignal.h"
+#include "pub_core_machine.h"
#include "pub_core_main.h"
#include "pub_core_mallocfree.h"
#include "pub_core_options.h"
@@ -256,18 +257,6 @@
}
=20
=20
-/* Get the simulated stack pointer */
-Addr VG_(get_SP) ( ThreadId tid )
-{
- return STACK_PTR( VG_(threads)[tid].arch );
-}
-
-Addr VG_(get_IP) ( ThreadId tid )
-{
- return INSTR_PTR( VG_(threads)[tid].arch );
-}
-
-
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
/*=3D=3D=3D Check we were launched by stage 1 =
=3D=3D=3D*/
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
@@ -2828,7 +2817,7 @@
"Caught __NR_exit; running __libc_freeres()");
=20
/* point thread context to point to libc_freeres_wrapper */
- INSTR_PTR(VG_(threads)[tid].arch) =3D __libc_freeres_wrapper;
+ VG_(set_IP)(tid, __libc_freeres_wrapper);
// XXX should we use a special stack?
=20
/* Block all blockable signals by copying the real block state into
Modified: trunk/coregrind/m_scheduler/scheduler.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/m_scheduler/scheduler.c 2005-06-12 20:51:09 UTC (rev =
3902)
+++ trunk/coregrind/m_scheduler/scheduler.c 2005-06-13 04:21:38 UTC (rev =
3903)
@@ -68,6 +68,7 @@
#include "pub_core_libcprint.h"
#include "pub_core_libcproc.h"
#include "pub_core_libcsignal.h"
+#include "pub_core_machine.h"
#include "pub_core_main.h"
#include "pub_core_mallocfree.h"
#include "pub_core_options.h"
@@ -156,7 +157,7 @@
for (tid =3D 1; tid < VG_N_THREADS; tid++) {
if (VG_(threads)[tid].status =3D=3D VgTs_Empty) continue;
=20
- if ( p ( STACK_PTR(VG_(threads)[tid].arch),
+ if ( p ( VG_(get_SP)(tid),
VG_(threads)[tid].client_stack_highest_word, d ) )
return tid;
}
@@ -683,12 +684,11 @@
static void handle_tt_miss ( ThreadId tid )
{
Bool found;
- Addr ip =3D INSTR_PTR(VG_(threads)[tid].arch);
+ Addr ip =3D VG_(get_IP)(tid);
=20
/* Trivial event. Miss in the fast-cache. Do a full
lookup for it. */
- found =3D VG_(search_transtab)( NULL,
- ip, True/*upd_fast_cache*/ );
+ found =3D VG_(search_transtab)( NULL, ip, True/*upd_fast_cache*/ );
if (!found) {
/* Not found; we need to request a translation. */
if (VG_(translate)( tid, ip, /*debug*/False, 0/*not verbose*/ )) {
@@ -877,7 +877,7 @@
}
=20
case VEX_TRC_JMP_NODECODE:
- VG_(synth_sigill)(tid, INSTR_PTR(VG_(threads)[tid].arch));
+ VG_(synth_sigill)(tid, VG_(get_IP)(tid));
break;
=20
default:=20
@@ -934,6 +934,23 @@
Specifying shadow register values
------------------------------------------------------------------ */
=20
+#if defined(VGA_x86)
+# define VGA_CLREQ_ARGS guest_EAX
+# define VGA_CLREQ_RET guest_EDX
+#elif defined(VGA_amd64)
+# define VGA_CLREQ_ARGS guest_RAX
+# define VGA_CLREQ_RET guest_RDX
+#elif defined(VGA_arm)
+# define VGA_CLREQ_ARGS guest_R0
+# define VGA_CLREQ_RET guest_R0
+#else
+# error Unknown arch
+#endif
+
+#define CLREQ_ARGS(regs) ((regs).vex.VGA_CLREQ_ARGS)
+#define CLREQ_RET(regs) ((regs).vex.VGA_CLREQ_RET)
+#define O_CLREQ_RET (offsetof(VexGuestArchState, VGA_CLREQ_RET))
+
// These macros write a value to a client's thread register, and tell th=
e
// tool that it's happened (if necessary).
=20
@@ -949,36 +966,6 @@
zztid, O_CLREQ_RET, sizeof(UWord), f); \
} while (0)
=20
-void VG_(set_shadow_regs_area) ( ThreadId tid, OffT offset, SizeT size,
- const UChar* area )
-{
- ThreadState* tst;
-
- vg_assert(VG_(is_valid_tid)(tid));
- tst =3D & VG_(threads)[tid];
-
- // Bounds check
- vg_assert(0 <=3D offset && offset < sizeof(VexGuestArchState));
- vg_assert(offset + size <=3D sizeof(VexGuestArchState));
-
- VG_(memcpy)( (void*)(((Addr)(&tst->arch.vex_shadow)) + offset), area,=
size);
-}
-
-void VG_(get_shadow_regs_area) ( ThreadId tid, OffT offset, SizeT size,
- UChar* area )
-{
- ThreadState* tst;
-
- vg_assert(VG_(is_valid_tid)(tid));
- tst =3D & VG_(threads)[tid];
-
- // Bounds check
- vg_assert(0 <=3D offset && offset < sizeof(VexGuestArchState));
- vg_assert(offset + size <=3D sizeof(VexGuestArchState));
-
- VG_(memcpy)( area, (void*)(((Addr)&(tst->arch.vex_shadow)) + offset),=
size);
-}
-
/* ---------------------------------------------------------------------
Handle client requests.
------------------------------------------------------------------ */
Modified: trunk/coregrind/m_sigframe/sigframe-amd64-linux.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/m_sigframe/sigframe-amd64-linux.c 2005-06-12 20:51:09=
UTC (rev 3902)
+++ trunk/coregrind/m_sigframe/sigframe-amd64-linux.c 2005-06-13 04:21:38=
UTC (rev 3903)
@@ -34,6 +34,7 @@
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
+#include "pub_core_machine.h"
#include "pub_core_options.h"
#include "pub_core_sigframe.h"
#include "pub_core_signals.h"
@@ -496,7 +497,7 @@
=20
/* Set the thread so it will next run the handler. */
/* tst->m_rsp =3D rsp; also notify the tool we've updated RSP */
- STACK_PTR(VG_(threads)[tid].arch) =3D rsp;
+ VG_(set_SP)(tid, rsp);
VG_TRACK( post_reg_write, Vg_CoreSignal, tid, O_STACK_PTR, sizeof(Add=
r));
=20
//VG_(printf)("handler =3D %p\n", handler);
Modified: trunk/coregrind/m_sigframe/sigframe-x86-linux.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/m_sigframe/sigframe-x86-linux.c 2005-06-12 20:51:09 U=
TC (rev 3902)
+++ trunk/coregrind/m_sigframe/sigframe-x86-linux.c 2005-06-13 04:21:38 U=
TC (rev 3903)
@@ -34,6 +34,7 @@
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
+#include "pub_core_machine.h"
#include "pub_core_options.h"
#include "pub_core_sigframe.h"
#include "pub_core_signals.h"
@@ -573,7 +574,7 @@
=20
/* Set the thread so it will next run the handler. */
/* tst->m_esp =3D esp; also notify the tool we've updated ESP */
- STACK_PTR(VG_(threads)[tid].arch) =3D esp;
+ VG_(set_SP)(tid, esp);
VG_TRACK( post_reg_write, Vg_CoreSignal, tid, O_STACK_PTR, sizeof(Add=
r));
=20
//VG_(printf)("handler =3D %p\n", handler);
Modified: trunk/coregrind/m_signals.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/m_signals.c 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/coregrind/m_signals.c 2005-06-13 04:21:38 UTC (rev 3903)
@@ -89,6 +89,7 @@
#include "pub_core_libcprint.h"
#include "pub_core_libcproc.h"
#include "pub_core_libcsignal.h"
+#include "pub_core_machine.h"
#include "pub_core_main.h"
#include "pub_core_mallocfree.h"
#include "pub_core_options.h"
@@ -475,7 +476,7 @@
Addr m_SP;
=20
vg_assert(VG_(is_valid_tid)(tid));
- m_SP =3D STACK_PTR(VG_(threads)[tid].arch);
+ m_SP =3D VG_(get_SP)(tid);
=20
if (VG_(clo_trace_signals))
VG_(message)(Vg_DebugExtraMsg,=20
@@ -490,7 +491,7 @@
}
=20
if (ss !=3D NULL) {
- if (on_sig_stack(tid, STACK_PTR(VG_(threads)[tid].arch))) {
+ if (on_sig_stack(tid, VG_(get_SP)(tid))) {
return VG_(mk_SysRes_Error)( VKI_EPERM );
}
if (ss->ss_flags !=3D VKI_SS_DISABLE=20
@@ -763,7 +764,7 @@
&& /* there is a defined and enabled alt stack, which we're not
already using. Logic from get_sigframe in
arch/i386/kernel/signal.c. */
- sas_ss_flags(tid, STACK_PTR(tst->arch)) =3D=3D 0
+ sas_ss_flags(tid, VG_(get_SP)(tid)) =3D=3D 0
) {
esp_top_of_frame=20
=3D (Addr)(tst->altstack.ss_sp) + tst->altstack.ss_size;
@@ -779,7 +780,7 @@
VG_TRACK( pre_deliver_signal, tid, sigNo, /*alt_stack*/True );
=20
} else {
- esp_top_of_frame =3D STACK_PTR(tst->arch) - VGA_STACK_REDZONE_SZB;
+ esp_top_of_frame =3D VG_(get_SP)(tid) - VGA_STACK_REDZONE_SZB;
=20
/* Signal delivery to tools */
VG_TRACK( pre_deliver_signal, tid, sigNo, /*alt_stack*/False );
@@ -1792,8 +1793,7 @@
=20
if (VG_(clo_trace_signals)) {
VG_(message)(Vg_DebugMsg, "signal %d arrived ... si_code=3D%d, EIP=
=3D%p, eip=3D%p",
- sigNo, info->si_code,=20
- INSTR_PTR(VG_(threads)[tid].arch),=20
+ sigNo, info->si_code, VG_(get_IP)(tid),=20
VGP_UCONTEXT_INSTR_PTR(uc) );
}
vg_assert(sigNo >=3D 1 && sigNo <=3D VG_(max_signal));
@@ -1803,7 +1803,7 @@
*/
if (info->si_signo =3D=3D VKI_SIGSEGV) {
Addr fault =3D (Addr)info->_sifields._sigfault._addr;
- Addr esp =3D STACK_PTR(VG_(threads)[tid].arch);
+ Addr esp =3D VG_(get_SP)(tid);
Segment* seg;
=20
seg =3D VG_(find_segment)(fault);
Modified: trunk/coregrind/m_stacktrace.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/m_stacktrace.c 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/coregrind/m_stacktrace.c 2005-06-13 04:21:38 UTC (rev 3903)
@@ -33,6 +33,7 @@
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
+#include "pub_core_machine.h"
#include "pub_core_options.h"
#include "pub_core_profile.h"
#include "pub_core_stacktrace.h"
@@ -162,11 +163,10 @@
UInt VG_(get_StackTrace) ( ThreadId tid, StackTrace ips, UInt n_ips )
{
/* thread in thread table */
- ThreadState* tst =3D & VG_(threads)[ tid ];
- Addr ip =3D INSTR_PTR(tst->arch);
- Addr fp =3D FRAME_PTR(tst->arch);
- Addr sp =3D STACK_PTR(tst->arch);
- Addr stack_highest_word =3D tst->client_stack_highest_word;
+ Addr ip =3D VG_(get_IP)(tid);
+ Addr fp =3D VG_(get_FP)(tid);
+ Addr sp =3D VG_(get_SP)(tid);
+ Addr stack_highest_word =3D VG_(threads)[tid].client_stack_highest_wo=
rd;
=20
#if defined(VGP_x86_linux)
/* Nasty little hack to deal with sysinfo syscalls - if libc is
Added: trunk/coregrind/pub_core_machine.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/pub_core_machine.h 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/coregrind/pub_core_machine.h 2005-06-13 04:21:38 UTC (rev 3903)
@@ -0,0 +1,87 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Machine-related things. pub_core_machine.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_MACHINE_H
+#define __PUB_CORE_MACHINE_H
+
+//--------------------------------------------------------------------
+// PURPOSE: This module contains code related to the particular
+// architecture, things like accessing guest state, endianness, word siz=
e,
+// etc.
+//--------------------------------------------------------------------
+
+#include "pub_tool_machine.h"
+
+#if defined(VGA_x86)
+# define VGA_ELF_ENDIANNESS ELFDATA2LSB
+# define VGA_ELF_MACHINE EM_386
+# define VGA_ELF_CLASS ELFCLASS32
+#elif defined(VGA_amd64)
+# define VGA_ELF_ENDIANNESS ELFDATA2LSB
+# define VGA_ELF_MACHINE EM_X86_64
+# define VGA_ELF_CLASS ELFCLASS64
+#elif defined(VGA_arm)
+# define VGA_ELF_ENDIANNESS ELFDATA2LSB
+# define VGA_ELF_MACHINE EM_ARM
+# define VGA_ELF_CLASS ELFCLASS32
+#else
+# error Unknown arch
+#endif
+
+#if defined(VGA_x86)
+# define VGA_INSTR_PTR guest_EIP
+# define VGA_STACK_PTR guest_ESP
+# define VGA_FRAME_PTR guest_EBP
+#elif defined(VGA_amd64)
+# define VGA_INSTR_PTR guest_RIP
+# define VGA_STACK_PTR guest_RSP
+# define VGA_FRAME_PTR guest_RBP
+#elif defined(VGA_arm)
+ // XXX: Not sure, but I think:
+ // r11 =3D frame pointer
+ // r12 =3D "implicit parameter" (neither caller-save, nor callee-sa=
ve)
+ // r13 =3D stack pointer
+ // r14 =3D link register
+ // r15 =3D program counter
+# define VGA_INSTR_PTR guest_R15
+# define VGA_STACK_PTR guest_R13
+# define VGA_FRAME_PTR guest_R11
+#else
+# error Unknown arch
+#endif
+
+// Offsets for the Vex state
+#define O_STACK_PTR (offsetof(VexGuestArchState, VGA_STACK_PTR))
+
+#endif // __PUB_CORE_MACHINE_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/ume.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/ume.c 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/coregrind/ume.c 2005-06-13 04:21:38 UTC (rev 3903)
@@ -46,6 +46,7 @@
=20
#include "ume.h"
#include "pub_core_libcbase.h"
+#include "pub_core_machine.h"
=20
#if ELFSZ =3D=3D 64
#define ESZ(x) Elf64_##x
Modified: trunk/helgrind/hg_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/helgrind/hg_main.c 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/helgrind/hg_main.c 2005-06-13 04:21:38 UTC (rev 3903)
@@ -37,6 +37,7 @@
#include "pub_tool_libcassert.h"
#include "pub_tool_libcprint.h"
#include "pub_tool_libcproc.h"
+#include "pub_tool_machine.h"
#include "pub_tool_mallocfree.h"
#include "pub_tool_options.h"
#include "pub_tool_profile.h"
Modified: trunk/include/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/include/Makefile.am 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/include/Makefile.am 2005-06-13 04:21:38 UTC (rev 3903)
@@ -16,6 +16,7 @@
pub_tool_libcprint.h \
pub_tool_libcproc.h \
pub_tool_libcsignal.h \
+ pub_tool_machine.h \
pub_tool_mallocfree.h \
pub_tool_options.h \
pub_tool_profile.h \
Modified: trunk/include/basic_types.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/include/basic_types.h 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/include/basic_types.h 2005-06-13 04:21:38 UTC (rev 3903)
@@ -65,6 +65,14 @@
# define NULL ((void*)0)
#endif
=20
+#if defined(VGA_x86)
+# define VGA_REGPARM(n) __attribute__((regparm(n)))
+#elif defined(VGA_amd64) || defined(VGA_arm)
+# define VGA_REGPARM(n) /* */
+#else
+# error Unknown arch
+#endif
+
/* ---------------------------------------------------------------------
non-builtin types
------------------------------------------------------------------ */
Added: trunk/include/pub_tool_machine.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/include/pub_tool_machine.h 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/include/pub_tool_machine.h 2005-06-13 04:21:38 UTC (rev 3903)
@@ -0,0 +1,71 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Machine-related stuff. pub_tool_machine.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_TOOL_MACHINE
+#define __PUB_TOOL_MACHINE
+
+/* VGA_STACK_REDZONE_SZB: how many bytes below the stack pointer are val=
idly
+ * addressible? */
+#if defined(VGA_x86)
+# define VGA_MIN_INSTR_SZB 1
+# define VGA_MAX_INSTR_SZB 16
+# define VGA_STACK_REDZONE_SZB 0
+#elif defined(VGA_amd64)
+# define VGA_MIN_INSTR_SZB 1
+# define VGA_MAX_INSTR_SZB 16
+# define VGA_STACK_REDZONE_SZB 128
+#elif defined(VGA_arm)
+# define VGA_MIN_INSTR_SZB 4
+# define VGA_MAX_INSTR_SZB 4=20
+# define VGA_STACK_REDZONE_SZB 0
+#else
+# error Unknown arch
+#endif
+
+// Guest state accessors
+extern Addr VG_(get_SP) ( ThreadId tid );
+extern Addr VG_(get_IP) ( ThreadId tid );
+extern Addr VG_(get_FP) ( ThreadId tid );
+
+extern void VG_(set_SP) ( ThreadId tid, Addr sp );
+extern void VG_(set_IP) ( ThreadId tid, Addr ip );
+
+// For get/set, 'area' is where the asked-for shadow state will be copie=
d
+// into/from.
+extern void VG_(get_shadow_regs_area) ( ThreadId tid, OffT guest_state_o=
ffset,
+ SizeT size, UChar* area );
+extern void VG_(set_shadow_regs_area) ( ThreadId tid, OffT guest_state_o=
ffset,
+ SizeT size, const UChar* area );
+
+#endif // __PUB_TOOL_MACHINE
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: trunk/include/tool.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/include/tool.h 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/include/tool.h 2005-06-13 04:21:38 UTC (rev 3903)
@@ -68,11 +68,6 @@
( Bool (*p) ( Addr stack_min, Addr stack_max, vo=
id* d ),
void* d );
=20
-/* Get parts of the client's state. */
-extern Addr VG_(get_SP) ( ThreadId tid );
-extern Addr VG_(get_IP) ( ThreadId tid );
-
-
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
/*=3D=3D=3D Valgrind's version of libc =
=3D=3D=3D*/
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
@@ -94,42 +89,6 @@
UInt *eax_ret, UInt *ebx_ret,
UInt *ecx_ret, UInt *edx_ret );
=20
-/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
-/*=3D=3D=3D Functions for shadow registers =
=3D=3D=3D*/
-/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
-
-// For get/set, 'area' is where the asked-for shadow state will be copie=
d
-// into/from.
-extern void VG_(get_shadow_regs_area) ( ThreadId tid, OffT guest_state_o=
ffset,
- SizeT size, UChar* area );
-extern void VG_(set_shadow_regs_area) ( ThreadId tid, OffT guest_state_o=
ffset,
- SizeT size, const UChar* area );
-
-/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
-/*=3D=3D=3D Arch-specific stuff =
=3D=3D=3D*/
-/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
-
-/* VGA_STACK_REDZONE_SZB: how many bytes below the stack pointer are val=
idly
- * addressible? */
-#if defined(VGA_x86)
-# define VGA_REGPARM(n) __attribute__((regparm(n)))
-# define VGA_MIN_INSTR_SZB 1
-# define VGA_MAX_INSTR_SZB 16
-# define VGA_STACK_REDZONE_SZB 0
-#elif defined(VGA_amd64)
-# define VGA_REGPARM(n) /* */
-# define VGA_MIN_INSTR_SZB 1
-# define VGA_MAX_INSTR_SZB 16
-# define VGA_STACK_REDZONE_SZB 128
-#elif defined(VGA_arm)
-# define VGA_REGPARM(n) /* */
-# define VGA_MIN_INSTR_SZB 4
-# define VGA_MAX_INSTR_SZB 4=20
-# define VGA_STACK_REDZONE_SZB 0
-#else
-# error Unknown platform
-#endif
-
#endif /* __TOOL_H */
=20
=20
Modified: trunk/memcheck/mac_shared.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/memcheck/mac_shared.c 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/memcheck/mac_shared.c 2005-06-13 04:21:38 UTC (rev 3903)
@@ -34,6 +34,7 @@
#include "pub_tool_libcassert.h"
#include "pub_tool_libcbase.h"
#include "pub_tool_libcprint.h"
+#include "pub_tool_machine.h"
#include "memcheck.h" /* for VG_USERREQ__* */
=20
/*------------------------------------------------------------*/
Modified: trunk/memcheck/mc_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/memcheck/mc_main.c 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/memcheck/mc_main.c 2005-06-13 04:21:38 UTC (rev 3903)
@@ -42,6 +42,7 @@
#include "pub_tool_libcbase.h"
#include "pub_tool_libcassert.h"
#include "pub_tool_libcprint.h"
+#include "pub_tool_machine.h"
=20
=20
#define EXPECTED_TAKEN(cond) __builtin_expect((cond),1)
Modified: trunk/memcheck/tests/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/memcheck/tests/Makefile.am 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/memcheck/tests/Makefile.am 2005-06-13 04:21:38 UTC (rev 3903)
@@ -197,6 +197,7 @@
hello_DEPENDENCIES =3D ../../coregrind/${VG_ARCH}/stage2.lds
endif
=20
+vgtest_ume_CFLAGS =3D -DVGA_$(VG_ARCH)
vgtest_ume_SOURCES =3D vgtest_ume.c
vgtest_ume_LDADD =3D ../../coregrind/ume.o \
../../coregrind/jmp_with_stack.o
|