|
From: pankaj p. <pan...@gm...> - 2011-07-07 15:35:48
|
Hi Josef, Thanks for your reply. I did run valgrind with guest_chase_thresh = 0 and was able to do capture the calls. But my doubt was that I can't see the jump statement(is it that unconditional jumps are not displayed in IR) Sorry I am new, but an unconditional branch we should just set the IP to the called location?Am I right? How it this being taken care of in the IR? I also had another question : Can we read the values written on stack. For example if I want to get the arguments being passed to a certain function? I have been able to intercept the calls to that particular function and get the Stack Pointer. How do I read the stack values? Regards, pankaj On Thu, Jul 7, 2011 at 5:07 PM, Josef Weidendorfer < Jos...@gm...> wrote: > On Thursday 07 July 2011, pankaj pawan wrote: > > Hi all, > > > > I had doubt regarding the flattened IR for a call instruction. When I try > > and print the IR statements for call instructions, i can see the return > > instruction being written on the stack but i am unable to see how the > > branching is being done. > > I can't capture it in Ist_Exit . > > A call is nothing more than an unconditional jump with putting a return > address > on the stack. As such, the call will disappear in the middle of a > superblock. > You could detect that there is a jump in the addresses of subsequent guest > instructions, but AFAIK, there is no way to detect whether > it just was a jump or a call (*). > > Instead, you can prohibit the building of superblocks by setting VEX > attributes > > VG_(clo_vex_control).iropt_unroll_thresh = 0; > VG_(clo_vex_control).guest_chase_thresh = 0; > > in your tool initialization (as callgrind does). > Then, a call should end a BB, and IRSB attribute jumpkind should be > Ijk_Call > if the BB ends in a guest call instruction. > > Josef > > (*) It can make sense to add a VEX noop IR hint about that there was a > given > call/jump in the middle of a superblock translation. But only if a tool > really > would need it... > > > > > > Can someone explain me what am I missing. > > > > Thanks, > > pankaj > > > > > |