Yes, they give the identical result (assuming instr_get_next(inst) is not null).
Yes, they give the identical result (assuming instr_get_next(inst) is not null).What if it is null? instrlist_meta_preinsert() would just append the metainstruction to the end of the instruction list, wouldn't it? If so, it's still identical to instrlist_meta_postinsert, right?
But what I'm trying to understand is whether postinserted metainstructions are associated with the previous app instruction or with the next one. Consider the following:xor %rax, %rax(meta1)l1:mov %rax, %rbx(meta2)jmp l1
But what I'm trying to understand is whether postinserted metainstructions are associated with the previous app instruction or with the next one. Consider the following:xor %rax, %rax(meta1)l1:mov %rax, %rbx(meta2)jmp l1What's l1, a label? If so, the jmp target will be the instruction after l1. But keep in mind that the label is a "first class" member of the list just like the executable instructions, so insertion will not accidentally go on the wrong side of the label. To be especially safe in this regard, you can always insert relative to the label explicitly.
xor %rax, %rax(meta1)l1:mov %rax, %rbx(meta2)jmp l1What's l1, a label? If so, the jmp target will be the instruction after l1. But keep in mind that the label is a "first class" member of the list just like the executable instructions, so insertion will not accidentally go on the wrong side of the label. To be especially safe in this regard, you can always insert relative to the label explicitly.It's not a "meta" label, I meant an application "label", i.e. just an immediate address.So, when CTI occurs in the application code, what meta-instructions are considered to be associated with the target instruction? Preinserted for that instruction *and* postinserted for the pervious one (i.e.for the statically preceeding one)? Or the former only?Actually neither. If you want meta instructions to execute at the jmp target, you'll have to retarget to the first meta instruction. The "meta" qualifier is only kept by DR for making decisions about instances of instr_t. Once an instruction goes into the code cache, it's an x86 instruction like any other--meta or otherwise. So when your jmp executes, the next instruction will be the physical target of the jmp, and from there execution goes in sequence until the next cti.
Ths is a bit old thread, but I'd like to try and discuss it again, as the conclusions here might be somewhat misleading...Consider the following instruction sequence:jmp label1
xchg %rax, %rax
label1: mov $123, %rbx
--
You received this message because you are subscribed to the Google Groups "DynamoRIO Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dynamorio-use...@googlegroups.com.
To post to this group, send email to dynamor...@googlegroups.com.
Visit this group at http://groups.google.com/group/dynamorio-users.
For more options, visit https://groups.google.com/d/optout.
On Fri, Sep 26, 2014 at 12:20 PM, Igor R <boost...@gmail.com> wrote:On Fri, Sep 26, 2014 at 11:24 AM, Igor R <boost...@gmail.com> wrote:Ths is a bit old thread, but I'd like to try and discuss it again, as the conclusions here might be somewhat misleading...Consider the following instruction sequence:jmp label1
xchg %rax, %rax
label1: mov $123, %rbxThis is not an application instruction sequence a client will ever see. I have to assume you're talking about an already-instrumented sequence, in which case the jmp is probably meta and the label is a separate label instruction. It's probably best to use DR's output which clearly labels meta vs app instructions and shows label instructions as first-class.It's the application sequence I wrote by my own hands in assembly...