|
From: Ayodele T. <em...@st...> - 2003-10-03 04:47:48
|
> > I am new to Valgrind and am trying to develop a new skin. In trying to > understand how information is managed in Valgrind, I have some confusion > as to how TempRegs are used and how arguments are passed to > instrumentation functions. > > > For example, look at the following code. > > op = newTemp(cb); > uInstr2(cb, MOV, 4, Literal, 0, TempReg, op); > uLiteral(cb, orig_addr); > uInstr1(cb, CCALL, 0, TempReg, op); > uCCall(cb, (Addr) & get_load_address, 1, 1, False); > > What I expect is happening in this code is: > > * uInstr2(...MOV ...) is copying the literal 0 into the TempReg pointed at by op. > > * uLiteral(...) is copying the value of the orig_addr into the TempReg > that is indicated by op > > * uInstr1(...CCALL...) is setting up the argument (register pointed to > by "op") to be sent with the CCALL > > * uCCall(...) is instrumenting the code > > What I expect to happen when the app is running is that the function > "get_load_address" will have as its argument the value that was in > the TempReg pointed at by op which would be the value of "orig_addr". But > that does not appear to be the case. > > I think I am missing something fundamental about how this should work. > If anyone can explain, it would be appreciated. > > Ayo |