Re: [mono-cecil] call instruction: get information about static, instance, etc...

2016-09-22 Thread Jb Evain
Hi Pietro,

The call instruction will have a MethodReference operand. The
MethodReference will have a .HasThis property, telling you if it's an
instance method (which has a this argument) or a static method.

Jb

On Thu, Sep 22, 2016 at 8:40 AM, Pietro Ferrara 
wrote:

> Hi all,
> I'm pretty sure I'm missing something easy here, but I have been
> struggling with this for a while and I didn't find a solution around.
>
> I have a (not a callvirt!) call instruction. This instruction has a
> metadata token (see III.3.19 of the 6th edition ECMA-335 standard) that
> determines is the call is to a static, instance, etc method. I can see all
> this information in ILSpy. But how do I retrieve this information with
> Cecil? I see there is a MetadataToken in the MethodReference associated to
> the instruction (Operand) but it seems it has nothing to do with what I'm
> looking to.
>
> Thanks!
> Pietro
>
> --
> --
> --
> mono-cecil
> ---
> You received this message because you are subscribed to the Google Groups
> "mono-cecil" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mono-cecil+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
--
mono-cecil
--- 
You received this message because you are subscribed to the Google Groups 
"mono-cecil" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mono-cecil+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mono-cecil] call instruction: get information about static, instance, etc...

2016-09-22 Thread Pietro Ferrara
Hi all,
I'm pretty sure I'm missing something easy here, but I have been struggling 
with this for a while and I didn't find a solution around.

I have a (not a callvirt!) call instruction. This instruction has a 
metadata token (see III.3.19 of the 6th edition ECMA-335 standard) that 
determines is the call is to a static, instance, etc method. I can see all 
this information in ILSpy. But how do I retrieve this information with 
Cecil? I see there is a MetadataToken in the MethodReference associated to 
the instruction (Operand) but it seems it has nothing to do with what I'm 
looking to.

Thanks!
Pietro

-- 
-- 
--
mono-cecil
--- 
You received this message because you are subscribed to the Google Groups 
"mono-cecil" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mono-cecil+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.