Author: sewardj
Date: 2010-07-26 12:07:41 +0100 (Mon, 26 Jul 2010)
New Revision: 11230
Log:
Initial support for ARM/Thumb interworking.
Modified:
branches/THUMB/Makefile.all.am
branches/THUMB/Makefile.am
branches/THUMB/coregrind/m_coredump/coredump-elf.c
branches/THUMB/coregrind/m_debugger.c
branches/THUMB/coregrind/m_debuginfo/debuginfo.c
branches/THUMB/coregrind/m_dispatch/dispatch-arm-linux.S
branches/THUMB/coregrind/m_execontext.c
branches/THUMB/coregrind/m_initimg/initimg-linux.c
branches/THUMB/coregrind/m_machine.c
branches/THUMB/coregrind/m_main.c
branches/THUMB/coregrind/m_scheduler/scheduler.c
branches/THUMB/coregrind/m_sigframe/sigframe-arm-linux.c
branches/THUMB/coregrind/m_signals.c
branches/THUMB/coregrind/m_syswrap/syswrap-main.c
branches/THUMB/coregrind/m_translate.c
branches/THUMB/coregrind/pub_core_machine.h
branches/THUMB/include/pub_tool_machine.h
branches/THUMB/memcheck/mc_machine.c
Modified: branches/THUMB/Makefile.all.am
===================================================================
--- branches/THUMB/Makefile.all.am 2010-07-26 10:46:03 UTC (rev 11229)
+++ branches/THUMB/Makefile.all.am 2010-07-26 11:07:41 UTC (rev 11230)
@@ -89,7 +89,9 @@
-Wstrict-prototypes \
-Wmissing-declarations \
@FLAG_W_NO_FORMAT_ZERO_LENGTH@ \
- -fno-strict-aliasing
+ -fno-strict-aliasing \
+ \
+ -O0
# These flags are used for building the preload shared objects.
# The aim is to give reasonable performance but also to have good
Modified: branches/THUMB/Makefile.am
===================================================================
--- branches/THUMB/Makefile.am 2010-07-26 10:46:03 UTC (rev 11229)
+++ branches/THUMB/Makefile.am 2010-07-26 11:07:41 UTC (rev 11230)
@@ -3,17 +3,20 @@
include $(top_srcdir)/Makefile.all.am
-TOOLS = memcheck \
- cachegrind \
- callgrind \
- massif \
- lackey \
- none \
- helgrind \
- drd
+#TOOLS = memcheck \
+# cachegrind \
+# callgrind \
+# massif \
+# lackey \
+# none \
+# helgrind \
+# drd
+#
+#EXP_TOOLS = exp-ptrcheck \
+# exp-bbv
+TOOLS = memcheck none
+EXP_TOOLS =
-EXP_TOOLS = exp-ptrcheck \
- exp-bbv
# DDD: once all tools work on Darwin, TEST_TOOLS and TEST_EXP_TOOLS can be
# replaced with TOOLS and EXP_TOOLS.
Modified: branches/THUMB/coregrind/m_coredump/coredump-elf.c
===================================================================
--- branches/THUMB/coregrind/m_coredump/coredump-elf.c 2010-07-26 10:46:03 UTC (rev 11229)
+++ branches/THUMB/coregrind/m_coredump/coredump-elf.c 2010-07-26 11:07:41 UTC (rev 11230)
@@ -340,7 +340,7 @@
regs->ARM_ip = arch->vex.guest_R12;
regs->ARM_sp = arch->vex.guest_R13;
regs->ARM_lr = arch->vex.guest_R14;
- regs->ARM_pc = arch->vex.guest_R15;
+ regs->ARM_pc = VG_ENCIN_TO_IP(arch->vex.guest_R15T);
regs->ARM_cpsr = LibVEX_GuestARM_get_cpsr( &((ThreadArchState*)arch)->vex );
#else
Modified: branches/THUMB/coregrind/m_debugger.c
===================================================================
--- branches/THUMB/coregrind/m_debugger.c 2010-07-26 10:46:03 UTC (rev 11229)
+++ branches/THUMB/coregrind/m_debugger.c 2010-07-26 11:07:41 UTC (rev 11230)
@@ -40,6 +40,7 @@
#include "pub_core_libcsignal.h"
#include "pub_core_libcassert.h"
#include "pub_core_options.h"
+#include "pub_core_machine.h" // VG_ENCIN_TO_IP
#define WIFSTOPPED(status) (((status) & 0xff) == 0x7f)
@@ -223,7 +224,7 @@
uregs.ARM_ip = vex->guest_R12;
uregs.ARM_sp = vex->guest_R13;
uregs.ARM_lr = vex->guest_R14;
- uregs.ARM_pc = vex->guest_R15;
+ uregs.ARM_pc = VG_ENCIN_TO_IP(vex->guest_R15T);
uregs.ARM_cpsr = LibVEX_GuestARM_get_cpsr(vex);
return VG_(ptrace)(VKI_PTRACE_SETREGS, pid, NULL, &uregs);
Modified: branches/THUMB/coregrind/m_debuginfo/debuginfo.c
===================================================================
--- branches/THUMB/coregrind/m_debuginfo/debuginfo.c 2010-07-26 10:46:03 UTC (rev 11229)
+++ branches/THUMB/coregrind/m_debuginfo/debuginfo.c 2010-07-26 11:07:41 UTC (rev 11230)
@@ -3057,7 +3057,7 @@
continue; /* ignore obviously stupid cases */
if (consider_vars_in_frame( dname1, dname2,
data_addr,
- VG_(get_IP)(tid),
+ VG_(get_ENCIP_IP)(tid),
VG_(get_SP)(tid),
VG_(get_FP)(tid), tid, 0 )) {
zterm_XA( dname1 );
Modified: branches/THUMB/coregrind/m_dispatch/dispatch-arm-linux.S
===================================================================
--- branches/THUMB/coregrind/m_dispatch/dispatch-arm-linux.S 2010-07-26 10:46:03 UTC (rev 11229)
+++ branches/THUMB/coregrind/m_dispatch/dispatch-arm-linux.S 2010-07-26 11:07:41 UTC (rev 11230)
@@ -63,7 +63,7 @@
/* r0 (hence also [sp,#0]) holds guest_state */
/* r1 holds do_profiling */
mov r8, r0
- ldr r0, [r8, #OFFSET_arm_R15]
+ ldr r0, [r8, #OFFSET_arm_R15T]
/* fall into main loop (the right one) */
cmp r1, #0 /* do_profiling */
@@ -87,7 +87,7 @@
bne gsp_changed
/* save the jump address in the guest state */
- str r0, [r8, #OFFSET_arm_R15]
+ str r0, [r8, #OFFSET_arm_R15T]
/* Are we out of timeslice? If yes, defer to scheduler. */
ldr r1, =VG_(dispatch_ctr)
@@ -132,7 +132,7 @@
bne gsp_changed
/* save the jump address in the guest state */
- str r0, [r8, #OFFSET_arm_R15]
+ str r0, [r8, #OFFSET_arm_R15T]
/* Are we out of timeslice? If yes, defer to scheduler. */
ldr r1, =VG_(dispatch_ctr)
@@ -172,22 +172,22 @@
/*----------------------------------------------------*/
gsp_changed:
- // r0 = next guest addr (R15), r8 = modified gsp
+ // r0 = next guest addr (R15T), r8 = modified gsp
/* Someone messed with the gsp. Have to
defer to scheduler to resolve this. dispatch ctr
is not yet decremented, so no need to increment. */
- /* R15 is NOT up to date here. First, need to write
- r0 back to R15, but without trashing r8 since
+ /* R15T is NOT up to date here. First, need to write
+ r0 back to R15T, but without trashing r8 since
that holds the value we want to return to the scheduler.
Hence use r1 transiently for the guest state pointer. */
ldr r1, [sp, #0]
- str r0, [r1, #OFFSET_arm_R15]
+ str r0, [r1, #OFFSET_arm_R15T]
mov r0, r8 // "return modified gsp"
b run_innerloop_exit
/*NOTREACHED*/
counter_is_zero:
- /* R15 is up to date here */
+ /* R15T is up to date here */
/* Back out increment of the dispatch ctr */
ldr r1, =VG_(dispatch_ctr)
ldr r2, [r1]
@@ -198,7 +198,7 @@
/*NOTREACHED*/
fast_lookup_failed:
- /* R15 is up to date here */
+ /* R15T is up to date here */
/* Back out increment of the dispatch ctr */
ldr r1, =VG_(dispatch_ctr)
ldr r2, [r1]
Modified: branches/THUMB/coregrind/m_execontext.c
===================================================================
--- branches/THUMB/coregrind/m_execontext.c 2010-07-26 10:46:03 UTC (rev 11229)
+++ branches/THUMB/coregrind/m_execontext.c 2010-07-26 11:07:41 UTC (rev 11230)
@@ -311,7 +311,7 @@
if (first_ip_only) {
n_ips = 1;
- ips[0] = VG_(get_IP)(tid);
+ ips[0] = VG_(get_ENCIP_IP)(tid);
} else {
n_ips = VG_(get_StackTrace)( tid, ips, VG_(clo_backtrace_size),
NULL/*array to dump SP values in*/,
Modified: branches/THUMB/coregrind/m_initimg/initimg-linux.c
===================================================================
--- branches/THUMB/coregrind/m_initimg/initimg-linux.c 2010-07-26 10:46:03 UTC (rev 11229)
+++ branches/THUMB/coregrind/m_initimg/initimg-linux.c 2010-07-26 11:07:41 UTC (rev 11230)
@@ -1026,7 +1026,9 @@
VG_(memset)(&arch->vex_shadow2, 0, sizeof(VexGuestARMState));
arch->vex.guest_R13 = iifii.initial_client_SP;
- arch->vex.guest_R15 = iifii.initial_client_IP;
+ // INTERWORKING FIXME: assumes starting in ARM mode
+ arch->vex.guest_R15T
+ = VG_IP_AUX_TO_ENCIN(iifii.initial_client_IP, 0);
/* This is just EABI stuff. */
// FIXME jrs: what's this for?
Modified: branches/THUMB/coregrind/m_machine.c
===================================================================
--- branches/THUMB/coregrind/m_machine.c 2010-07-26 10:46:03 UTC (rev 11229)
+++ branches/THUMB/coregrind/m_machine.c 2010-07-26 11:07:41 UTC (rev 11230)
@@ -39,49 +39,41 @@
#include "pub_core_debuglog.h"
-#define INSTR_PTR(regs) ((regs).vex.VG_INSTR_PTR)
+#define ENCIN_PTR(regs) ((regs).vex.VG_ENCIN_PTR)
#define STACK_PTR(regs) ((regs).vex.VG_STACK_PTR)
#define FRAME_PTR(regs) ((regs).vex.VG_FRAME_PTR)
-Addr VG_(get_SP) ( ThreadId tid )
-{
- return STACK_PTR( VG_(threads)[tid].arch );
+Addr VG_(get_ENCIP) ( ThreadId tid ) {
+ return ENCIN_PTR( VG_(threads)[tid].arch );
}
+Addr VG_(get_ENCIP_IP) ( ThreadId tid ) {
+ return VG_ENCIN_TO_IP(ENCIN_PTR( VG_(threads)[tid].arch ));
+}
+UWord VG_(get_ENCIP_AUX) ( ThreadId tid ) {
+ return VG_ENCIN_TO_AUX(ENCIN_PTR( VG_(threads)[tid].arch ));
+}
-Addr VG_(get_IP) ( ThreadId tid )
-{
- return INSTR_PTR( VG_(threads)[tid].arch );
+Addr VG_(get_SP) ( ThreadId tid ) {
+ return STACK_PTR( VG_(threads)[tid].arch );
}
-Addr VG_(get_FP) ( ThreadId tid )
-{
+Addr VG_(get_FP) ( ThreadId tid ) {
return FRAME_PTR( VG_(threads)[tid].arch );
}
-Addr VG_(get_LR) ( ThreadId tid )
-{
-# if defined(VGA_ppc32) || defined(VGA_ppc64)
- return VG_(threads)[tid].arch.vex.guest_LR;
-# elif defined(VGA_x86) || defined(VGA_amd64)
- return 0;
-# elif defined(VGA_arm)
- return VG_(threads)[tid].arch.vex.guest_R14;
-# else
-# error "Unknown arch"
-# endif
+
+void VG_(set_ENCIP) ( ThreadId tid, Addr encip ) {
+ ENCIN_PTR( VG_(threads)[tid].arch ) = encip;
}
+void VG_(set_ENCIP_2) ( ThreadId tid, Addr ip, UWord aux ) {
+ ENCIN_PTR( VG_(threads)[tid].arch ) = VG_IP_AUX_TO_ENCIN(ip, aux);
+}
-void VG_(set_SP) ( ThreadId tid, Addr sp )
-{
+void VG_(set_SP) ( ThreadId tid, Addr sp ) {
STACK_PTR( VG_(threads)[tid].arch ) = sp;
}
-void VG_(set_IP) ( ThreadId tid, Addr ip )
-{
- INSTR_PTR( VG_(threads)[tid].arch ) = ip;
-}
-
void VG_(get_UnwindStartRegs) ( /*OUT*/UnwindStartRegs* regs,
ThreadId tid )
{
@@ -106,7 +98,7 @@
regs->misc.PPC64.r_lr
= VG_(threads)[tid].arch.vex.guest_LR;
# elif defined(VGA_arm)
- regs->r_pc = (ULong)VG_(threads)[tid].arch.vex.guest_R15;
+ regs->r_pc = (ULong)VG_(threads)[tid].arch.vex.guest_R15T;
regs->r_sp = (ULong)VG_(threads)[tid].arch.vex.guest_R13;
regs->misc.ARM.r14
= VG_(threads)[tid].arch.vex.guest_R14;
@@ -117,6 +109,8 @@
# else
# error "Unknown arch"
# endif
+ /* Ensure the starting PC is properly decoded. */
+ regs->r_pc = VG_ENCIN_TO_IP(regs->r_pc);
}
Modified: branches/THUMB/coregrind/m_main.c
===================================================================
--- branches/THUMB/coregrind/m_main.c 2010-07-26 10:46:03 UTC (rev 11229)
+++ branches/THUMB/coregrind/m_main.c 2010-07-26 11:07:41 UTC (rev 11230)
@@ -2523,7 +2523,8 @@
function entry point, not a fn descriptor, so can use it
directly. However, we need to set R2 (the toc pointer)
appropriately. */
- VG_(set_IP)(tid, __libc_freeres_wrapper);
+ /* INTERWORKING FIXME: assumes wrapper runs in ARM mode */
+ VG_(set_ENCIP_2)(tid, __libc_freeres_wrapper, 0);
# if defined(VGP_ppc64_linux)
VG_(threads)[tid].arch.vex.guest_GPR2 = r2;
# endif
Modified: branches/THUMB/coregrind/m_scheduler/scheduler.c
===================================================================
--- branches/THUMB/coregrind/m_scheduler/scheduler.c 2010-07-26 10:46:03 UTC (rev 11229)
+++ branches/THUMB/coregrind/m_scheduler/scheduler.c 2010-07-26 11:07:41 UTC (rev 11230)
@@ -823,7 +823,7 @@
retval = VG_TRC_FAULT_SIGNAL;
} else {
/* store away the guest program counter */
- VG_(set_IP)( tid, argblock[2] );
+ VG_(set_ENCIP)( tid, argblock[2] );
if (argblock[3] == argblock[1])
/* the guest state pointer afterwards was unchanged */
retval = VG_TRC_BORING;
@@ -847,16 +847,16 @@
static void handle_tt_miss ( ThreadId tid )
{
Bool found;
- Addr ip = VG_(get_IP)(tid);
+ Addr encip = VG_(get_ENCIP)(tid);
/* Trivial event. Miss in the fast-cache. Do a full
lookup for it. */
- found = VG_(search_transtab)( NULL, ip, True/*upd_fast_cache*/ );
+ found = VG_(search_transtab)( NULL, encip, True/*upd_fast_cache*/ );
if (UNLIKELY(!found)) {
/* Not found; we need to request a translation. */
- if (VG_(translate)( tid, ip, /*debug*/False, 0/*not verbose*/,
+ if (VG_(translate)( tid, encip, /*debug*/False, 0/*not verbose*/,
bbs_done, True/*allow redirection*/ )) {
- found = VG_(search_transtab)( NULL, ip, True );
+ found = VG_(search_transtab)( NULL, encip, True );
vg_assert2(found, "VG_TRC_INNER_FASTMISS: missing tt_fast entry");
} else {
@@ -904,17 +904,15 @@
static UInt/*trc*/ handle_noredir_jump ( ThreadId tid )
{
AddrH hcode = 0;
- Addr ip = VG_(get_IP)(tid);
+ Addr encip = VG_(get_ENCIP)(tid);
- Bool found = VG_(search_unredir_transtab)( &hcode, ip );
+ Bool found = VG_(search_unredir_transtab)( &hcode, encip );
if (!found) {
/* Not found; we need to request a translation. */
- if (VG_(translate)( tid, ip, /*debug*/False, 0/*not verbose*/, bbs_done,
- False/*NO REDIRECTION*/ )) {
-
- found = VG_(search_unredir_transtab)( &hcode, ip );
+ if (VG_(translate)( tid, encip, /*debug*/False, 0/*not verbose*/,
+ bbs_done, False/*NO REDIRECTION*/ )) {
+ found = VG_(search_unredir_transtab)( &hcode, encip );
vg_assert2(found, "unredir translation missing after creation?!");
-
} else {
// If VG_(translate)() fails, it's because it had to throw a
// signal because the client jumped to a bad address. That
@@ -1173,7 +1171,7 @@
case VEX_TRC_JMP_NODECODE:
VG_(umsg)(
"valgrind: Unrecognised instruction at address %#lx.\n",
- VG_(get_IP)(tid));
+ VG_(get_ENCIP_IP)(tid));
#define M(a) VG_(umsg)(a "\n");
M("Your program just tried to execute an instruction that Valgrind" );
M("did not recognise. There are two possible reasons for this." );
@@ -1186,7 +1184,8 @@
M("Either way, Valgrind will now raise a SIGILL signal which will" );
M("probably kill your program." );
#undef M
- VG_(synth_sigill)(tid, VG_(get_IP)(tid));
+ // INTERWORKING FIXME is this correct (the use of get_ENCIP) ?
+ VG_(synth_sigill)(tid, VG_(get_ENCIP)(tid));
break;
case VEX_TRC_JMP_TINVAL:
Modified: branches/THUMB/coregrind/m_sigframe/sigframe-arm-linux.c
===================================================================
--- branches/THUMB/coregrind/m_sigframe/sigframe-arm-linux.c 2010-07-26 10:46:03 UTC (rev 11229)
+++ branches/THUMB/coregrind/m_sigframe/sigframe-arm-linux.c 2010-07-26 11:07:41 UTC (rev 11230)
@@ -139,7 +139,12 @@
SC2(ip,R12);
SC2(sp,R13);
SC2(lr,R14);
- SC2(pc,R15);
+ SC2(pc,R15T); // INTERWORKING FIXME
+ // afaics, this is used for two purposes:
+ // * so the guest can see the faulting address. Hence it needs
+ // to be unencoded (the real insn IP)
+ // * so we know where to resume afterwords. Hence it needs to
+ // be encoded. Bah.
# undef SC2
sc->trap_no = trapno;
@@ -249,7 +254,9 @@
if(flags & VKI_SA_RESTORER)
tst->arch.vex.guest_R14 = (Addr) restorer;
- tst->arch.vex.guest_R15 = (Addr) handler; /* R15 == PC */
+ // INTERWORKING FIXME this is almost certainly wrong. But how
+ // do we know which insn set is to be used for the signal handler?
+ tst->arch.vex.guest_R15T = (Addr) handler; /* R15 == PC */
}
@@ -312,7 +319,7 @@
REST(ip,R12);
REST(sp,R13);
REST(lr,R14);
- REST(pc,R15);
+ REST(pc,R15T); // INTERWORKING FIXME see comments above
# undef REST
tst->arch.vex_shadow1 = priv->vex_shadow1;
@@ -323,8 +330,9 @@
if (VG_(clo_trace_signals))
VG_(message)(Vg_DebugMsg,
- "vg_pop_signal_frame (thread %d): isRT=%d valid magic; PC=%#x",
- tid, has_siginfo, tst->arch.vex.guest_R15);
+ "vg_pop_signal_frame (thread %d): "
+ "isRT=%d valid magic; PC(encoded)=%#x",
+ tid, has_siginfo, tst->arch.vex.guest_R15T);
/* tell the tools */
VG_TRACK( post_deliver_signal, tid, sigNo );
Modified: branches/THUMB/coregrind/m_signals.c
===================================================================
--- branches/THUMB/coregrind/m_signals.c 2010-07-26 10:46:03 UTC (rev 11229)
+++ branches/THUMB/coregrind/m_signals.c 2010-07-26 11:07:41 UTC (rev 11230)
@@ -2362,7 +2362,7 @@
if (VG_(clo_trace_signals)) {
VG_(dmsg)("sync signal handler: "
"signal=%d, si_code=%d, EIP=%#lx, eip=%#lx, from %s\n",
- sigNo, info->si_code, VG_(get_IP)(tid),
+ sigNo, info->si_code, VG_(get_ENCIP_IP)(tid),
VG_UCONTEXT_INSTR_PTR(uc),
( from_user ? "user" : "kernel" ));
}
Modified: branches/THUMB/coregrind/m_syswrap/syswrap-main.c
===================================================================
--- branches/THUMB/coregrind/m_syswrap/syswrap-main.c 2010-07-26 10:46:03 UTC (rev 11229)
+++ branches/THUMB/coregrind/m_syswrap/syswrap-main.c 2010-07-26 11:07:41 UTC (rev 11230)
@@ -1864,14 +1864,16 @@
}
#elif defined(VGP_arm_linux)
- arch->vex.guest_R15 -= 4; // sizeof(arm instr)
+ // INTERWORKING FIXME. This is certainly wrong. Need to look at
+ // R15T to determine current mode, then back up accordingly.
+ arch->vex.guest_R15T -= 4; // sizeof(arm instr)
{
- UChar *p = (UChar*)arch->vex.guest_R15;
+ UChar *p = (UChar*)arch->vex.guest_R15T;
if ((p[3] & 0xF) != 0xF)
VG_(message)(Vg_DebugMsg,
"?! restarting over syscall that is not syscall at %#llx %02x %02x %02x %02x\n",
- arch->vex.guest_R15 + 0ULL, p[0], p[1], p[2], p[3]);
+ arch->vex.guest_R15T + 0ULL, p[0], p[1], p[2], p[3]);
vg_assert((p[3] & 0xF) == 0xF);
}
Modified: branches/THUMB/coregrind/m_translate.c
===================================================================
--- branches/THUMB/coregrind/m_translate.c 2010-07-26 10:46:03 UTC (rev 11229)
+++ branches/THUMB/coregrind/m_translate.c 2010-07-26 11:07:41 UTC (rev 11230)
@@ -1253,6 +1253,7 @@
TID is the identity of the thread requesting this translation.
*/
+// INTERWORKING FIXME this requires careful consideration
Bool VG_(translate) ( ThreadId tid,
Addr64 nraddr,
Bool debugging_translation,
Modified: branches/THUMB/coregrind/pub_core_machine.h
===================================================================
--- branches/THUMB/coregrind/pub_core_machine.h 2010-07-26 10:46:03 UTC (rev 11229)
+++ branches/THUMB/coregrind/pub_core_machine.h 2010-07-26 11:07:41 UTC (rev 11230)
@@ -96,9 +96,12 @@
# define VG_STACK_PTR guest_GPR1
# define VG_FRAME_PTR guest_GPR1 // No frame ptr for PPC
#elif defined(VGA_arm)
-# define VG_INSTR_PTR guest_R15
+# define VG_ENCIN_PTR guest_R15T
# define VG_STACK_PTR guest_R13
# define VG_FRAME_PTR guest_R11
+# define VG_ENCIN_TO_IP(_encin) ((_encin) & ~1UL)
+# define VG_ENCIN_TO_AUX(_encin) ((_encin) & 1UL)
+# define VG_IP_AUX_TO_ENCIN(_ip,_aux) ((_ip) & ~1UL) | ((_aux) & 1UL)
#else
# error Unknown arch
#endif
@@ -110,6 +113,22 @@
//-------------------------------------------------------------
+// Guest state accessors not visible to tools (although they
+// could be, I guess)
+Addr VG_(get_ENCIP) ( ThreadId tid );
+Addr VG_(get_ENCIP_IP) ( ThreadId tid );
+UWord VG_(get_ENCIP_AUX) ( ThreadId tid );
+
+Addr VG_(get_SP) ( ThreadId tid );
+Addr VG_(get_FP) ( ThreadId tid );
+
+void VG_(set_ENCIP) ( ThreadId tid, Addr encip );
+void VG_(set_ENCIP_2) ( ThreadId tid, Addr ip, UWord aux );
+
+void VG_(set_SP) ( ThreadId tid, Addr sp );
+
+
+//-------------------------------------------------------------
// Get hold of the values needed for a stack unwind, for the specified
// (client) thread.
void VG_(get_UnwindStartRegs) ( /*OUT*/UnwindStartRegs* regs,
Modified: branches/THUMB/include/pub_tool_machine.h
===================================================================
--- branches/THUMB/include/pub_tool_machine.h 2010-07-26 10:46:03 UTC (rev 11229)
+++ branches/THUMB/include/pub_tool_machine.h 2010-07-26 11:07:41 UTC (rev 11230)
@@ -99,13 +99,9 @@
#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 Addr VG_(get_LR) ( ThreadId tid );
+// Currently all in the core_ header, until we know
+// they are needed here
-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 guest state will be copied
// into/from. If shadowNo == 0, the real (non-shadow) guest state is
Modified: branches/THUMB/memcheck/mc_machine.c
===================================================================
--- branches/THUMB/memcheck/mc_machine.c 2010-07-26 10:46:03 UTC (rev 11229)
+++ branches/THUMB/memcheck/mc_machine.c 2010-07-26 11:07:41 UTC (rev 11230)
@@ -710,7 +710,7 @@
if (o == GOF(R14) && sz == 4) return o;
/* EAZG: These may be completely wrong. */
- if (o == GOF(R15) && sz == 4) return -1; /* slot unused */
+ if (o == GOF(R15T) && sz == 4) return -1; /* slot unused */
if (o == GOF(CC_OP) && sz == 4) return -1; /* slot unused */
if (o == GOF(CC_DEP1) && sz == 4) return o;
|