|
From: Scott P. <pa...@la...> - 2011-06-21 02:44:55
|
This is sort of a follow-up to a question I asked last year (Subject: Execution-time functions needing complete IRStmt contents). I've once again hit a case in which I'd like my instrumenter to pass a large number of arguments to an execution-time function. I was thinking that I can allocate an array, store all of my arguments (probably all IRAtoms) in that array, pass the array address as a single argument to a dirty function, and let the dirty function extract and process all of the array values. The catch, of course, is that the dirty function needs the actual values, so if the IR contains "t56 = Sub64(t54,0x8:I64)" and I stuff an IRTemp corresponding to t56 into my array, then I want the dirty function to see the (integer) result of the subtraction. Is there a way to do that? I'm probably way off track here, but the following is what's been running through my mind. I see where iselStmt() uses doHelperCall() to package up a list of arguments and invoke a dirty function on them. It seems that if the dirty function had access to the ISelEnv passed to iselStmt() then it could use lookupIRTemp() to get the register corresponding to each array element and then...that's where I got stuck. I can't tell if there's anything I can do with that register other than spit out guest machine code. (Like I said, I'm probably way off track to begin with.) Thanks, -- Scott |