Questions tagged [imetadataimport]
10 questions
5
votes
2 answers
Problems with IMetaDataImport::ResolveTypeRef Method
I have my own debugger for .NET apps that uses IMetaDataImport interface
When I call ResolveTypeRef method, I always get NotImplementedException.
The definition of ResolveTypeRef is like this:
[ComImport]
[Guid("....")] //a valid…

Paulie
- 81
- 7
4
votes
1 answer
Generic type func-eval using ICorDebugEval
I'm making a managed .NET debugger using MDBG sample.
MDBG has no support for property getters evaluation, which I'm trying to add. Please, consider following class structure:
public abstract class Base{
public string SomeProp…

3615
- 3,787
- 3
- 20
- 35
3
votes
1 answer
Debugger StepInto auto-generated code and JMC issue
I'm making a managed .NET debugger using MDBG sample.
Currently I'm struggling with StepInto behavior, while StepOut and StepOver seems to work.
To achieve Just-My-Code stepping I'm calling SetJMCStatus on modules load. That works fine and allow me…

3615
- 3,787
- 3
- 20
- 35
3
votes
1 answer
Func-eval on polymorphic classes
I'm making a managed .NET debugger using MDBG sample.
MDBG sample operates only on top level class of given instance, not searching deep inside class hierarchy. I was able to go through hierarchy and get all available methods. But a problem occurs…

3615
- 3,787
- 3
- 20
- 35
3
votes
1 answer
Get base class hierarchy methods with IMetaDataImport EnumMethods
I'm trying to implement managed debugger looking at MDBG sample.
MDBG is capable of resolving function names within given scope, but it's not taking in consideration base classes.
MDBG is doing this:
///
/// Resolves a Function…

3615
- 3,787
- 3
- 20
- 35
2
votes
1 answer
How to read System.Threading.Thread.ThreadState by Profiling API (ICofProfilerInfo or any IMetadataImport or any otherway)
Is there a way how to read the System.Thread.ThreadState property of a managed thread by Profiling API ICofProfilerInfo or IMetadataImport interface or any other way from unmanaged code?
For example something like this:
ICorProfilerInfo3…

honzajscz
- 2,850
- 1
- 27
- 29
2
votes
2 answers
In IMetadataImport or MonoCecil, how can I find out out if a method in an internal class is accessible from other assembiles?
One of the cases where a public method of an internal class might be accessible from outside the assembly is if the method implements interface methods or overrides virtual methods that are defined in a public base class.
Using IMetadataImport, how…

Omer Raviv
- 11,409
- 5
- 43
- 82
1
vote
1 answer
Obtaining property values of a class using GetFieldProps
I am trying to obtain the values of the fields in a class using GetFieldProps
Initially I use GetClassLayout to get an array of FieldDef tokens, then enumerate them using GetFieldProps.
The result of each GetFieldProps call returns S_OK and does…

Dave S
- 1,403
- 1
- 15
- 23
1
vote
1 answer
Using GetFunctionInfo to get the name of a function from a FunctionID
I am writing a CLR profiler using the ICorProfilerInfo interface.
When using SetEnterLeaveFunctionHooks, the callback methods are passed a FunctionID.
How do I get the metadata (I am after the name in particular), of a function given this…

Dave S
- 1,403
- 1
- 15
- 23
0
votes
1 answer
IMetaDataImport2::EnumGenericParams Method doesn't work
After resolving one issue with IMetaDataImport, I'm dealing with another for quite a long time. It's with EnumGenericParams method.
The method throws AccessViolationExpcetion, but this happens only sometimes. In the other cases the method returns…

Paulie
- 81
- 7