Fatal Error while instrumenting a function call using ProcTrace

Hi,

I was trying to run ProcTrace from the phoenix documentation with a sample managed C++ console application:

Code Snippet

//test.cpp

#using<mscorlib.dll>

#using<System.dll>

usingnamespace System;

int main(void)

{

Console::WriteLine("Hello");

return 0;

}

I compliled the file with the following command:

cl -clrSurpriseldSyntax -Zi test.cpp -link -profile

Thereafter when I try to instrument ProcTraceRuntime.dll to this by:

ProcTraceInstr /out test-procTrace.exe /pdbout test-procTrace.pdb /in test.exe

This should have resulted in the instrumented code. However it shows me an unhandled exception with the following error message and stack trace:

C:\Program Files\Phoenix RDK March 2007\src\samples\ProcTraceInstr\cpp\Debug>Pro
cTraceInstr /out test-procTrace.exe /pdbout test-procTrace.pdb /in test.exe
Phoenix Assertion Failure: d:\phoenixrdkmarch2007\src\phx\pe\pe-image-layout.cpp
, Line 229
primarySymbol->OriginalRva + primarySymbol->AsFunctionSymbol->ByteSize <= rvaL
imit
in (PEModule) test.exe
in (Program) <unnamed unit>
Total Global Symbols Count - 1085

Unhandled Exception: Phx.FatalError: Exception of type 'Phx.FatalError' was thro
wn.
at Phx.FatalError.Dispatch()
at Phx.PE.Utilities.UserError(String infoString)
at Phx.PEModuleUnit.MakeEmptyFunctionUnitForEncodedIR(FunctionSymbol function
Symbol)
at Phx.PEModuleUnit.LoadEncodedIRUnitList()
at Phx.PEModuleUnit.GetEnumerableContributionUnit(ContributionUnitEnumeration
Kind contributionUnitEnumerationKind)
at Phx.PEModuleUnit.GetEnumerableContributionUnit()
at DoAddInstrumentation(PEModuleUnit module, Boolean doPassFuncName) in c:\pr
ogram files\phoenix rdk march 2007\src\samples\proctraceinstr\cpp\proctraceinstr
.cpp:line 312
at main(String[] arguments) in c:\program files\phoenix rdk march 2007\src\sa
mples\proctraceinstr\cpp\proctraceinstr.cpp:line 170
at mainCRTStartupStrArray(String[] arguments) in f:\sp\vctools\crt_bld\self_x
86\crt\src\mcrtexe.cpp:line 324

The enumerable contribution units are not being formed in this case.

Does ProcTrace work for managed applications or is it only for native applications?

I am trying to instrument a code from a managed dll into a managed application which instruments this code by passing a parameter value. Is this the right thing to be looking at?

Thanking you,

ADG

[3491 byte] By [ArjunDasgupta] at [2008-3-7]
# 1

I think the error is occuring since ProcTrace instruments for native code. Sorry for the noise.

ADG

ArjunDasgupta at 2007-10-2 > top of Msdn Tech,Visual Studio,Phoenix...

Visual Studio

Site Classified