Hi Jason, On Tue, Aug 16, 2011 at 8:45 PM, JasonBock <[email protected]> wrote: > Let's say I have the following expression: > > var x = SomeMethod(); > > That line consists of at least two instructions: a call and a stloc > (more or less). The point is, a user can put a breakpoint on the whole > line and that works. > > I have a similar case where I'm creating a number of instructions that > all relate to the same section in code. Do I just create one > SequencePoint object and assign that to each Instruction I create? Or > is there a different way? I couldn't figure out it via the groups or > docs and I'd rather know upfront before I dive too far into it :).
let say you have: line 1: var x = this.SomeMethod(); line 2: var y = this.SomeOtherMethod(); This gets compiled as: ldarg 0 callvirt SomeMethod() stloc x ldarg 0 callvirt SomeOtherMethod stloc y You only need to add a sequence point to the first instruction for which you have source for. In that case, you need to have a sequence point on each ldarg 0 with the appropriate line. When asking the debugger to move to the next statement, it will go to the next sequence point. Most of the time, the easier is to write what you want in C# with csc, see what Cecil reads, and mimic that. Jb -- -- mono-cecil
