|
From: Bin X. <xi...@pu...> - 2008-03-04 22:57:04
|
Hi, Can Valgrind jump to the middle of a previously translated super-BB (i.e., the IRBB returned from the tool "instrument" function)? My understanding is it cannot, since the scope of the IR tmps used. More importantly, I want to ensure that if a tool wants to perform some function on entry to a IRBB, it's not skipped. Thanks for any clarification on this matter. My apology if this has been asked on the list before. -Bin |
|
From: Julian S. <js...@ac...> - 2008-03-04 23:12:23
|
On Tuesday 04 March 2008 23:57, Bin Xin wrote: > Hi, > > Can Valgrind jump to the middle of a previously translated super-BB > (i.e., the IRBB returned from the tool "instrument" function)? My > understanding is it cannot, since the scope of the IR tmps used. That's right, it can't. Superblocks are only ever run from the start - no side entries. It's not just the scope of the temps. Optimisations done on the IR cover the entire superblock and so it would be very difficult to optimise the block well and still maintain correct behaviour in the case of arbitrary side entries. If the guest jumps to an instruction which happens to be in the middle of a previously translation, a new, completely independent, translation is made from that point. This does mean that multiple translations of the same instruction may exist, by way of it being incorporated in more than one superblock. J |
|
From: Nicholas N. <nj...@cs...> - 2008-03-05 00:00:27
|
On Wed, 5 Mar 2008, Julian Seward wrote: >> Can Valgrind jump to the middle of a previously translated super-BB >> (i.e., the IRBB returned from the tool "instrument" function)? My >> understanding is it cannot, since the scope of the IR tmps used. > > That's right, it can't. Superblocks are only ever run from the > start - no side entries. It's not just the scope of the temps. > Optimisations done on the IR cover the entire superblock and so it > would be very difficult to optimise the block well and still > maintain correct behaviour in the case of arbitrary side entries. > > If the guest jumps to an instruction which happens to be in the > middle of a previously translation, a new, completely independent, > translation is made from that point. This does mean that multiple > translations of the same instruction may exist, by way of it being > incorporated in more than one superblock. And so any code you add at the start of a superblock will always be run. Nick |
|
From: Bin X. <xi...@pu...> - 2008-03-05 01:12:50
|
Nicholas Nethercote wrote: > On Wed, 5 Mar 2008, Julian Seward wrote: > >>> Can Valgrind jump to the middle of a previously translated super-BB >>> (i.e., the IRBB returned from the tool "instrument" function)? My >>> understanding is it cannot, since the scope of the IR tmps used. >> >> That's right, it can't. Superblocks are only ever run from the >> start - no side entries. It's not just the scope of the temps. >> Optimisations done on the IR cover the entire superblock and so it >> would be very difficult to optimise the block well and still >> maintain correct behaviour in the case of arbitrary side entries. >> >> If the guest jumps to an instruction which happens to be in the >> middle of a previously translation, a new, completely independent, >> translation is made from that point. This does mean that multiple >> translations of the same instruction may exist, by way of it being >> incorporated in more than one superblock. > > And so any code you add at the start of a superblock will always be run. > Thanks. -Bin |