在新的局部变量符号中存储方法调用的返回值 [英] Storing return value of a method call in a new local variable symbol

查看:83
本文介绍了在新的局部变量符号中存储方法调用的返回值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个应用程序来检测MSIL二进制文件。我需要添加一个新的局部变量符号,调用检测方法并将结果存储在新的局部变量中,以便我以后可以在检测中使用它。

I am trying to write an application to instrument MSIL binaries. I need to add a new local variable symbol, call the instrumentation method and store the result in the new local variable so that I can use it later on in the instrumentation.

我的目标是获得以下内容:

my aim is to get the following:

ldstr消息

调用intrumentationFunction

call intrumentationFunction

stloc //将结果存储在新的局部变量符号中

stloc                 // store the result in the new local variable symbol

以下代码给出以下断言失败并在编码阶段抛出空引用异常。

The following code gives the following assertion failure and throws a null reference exception in the encode phase.

在Profiler检测阶段后的消费者检查失败

Consitency check failures after Profiler instrumentation phase


操作数在生成帧后有一个未分配的帧变量

Operand has an unallocated frame variable after frame generation


& test.Program :: Main :: _ profMethodID

&test.Program::Main::_profMethodID


& test.Program :: Main :: _ profMethodID = stloc SR0

&test.Program::Main::_profMethodID = stloc SR0


Phoenic断言失败:d: \enlistments\sdk_march08\src\phx\ir\ir-check.cpp,1954行

Phoenic Assertion Failure: d:\enlistments\sdk_march08\src\phx\ir\ir-check.cpp, Line 1954

!this-> HaveEmittedDiagnostic:一致性检查失败

!this->HaveEmittedDiagnostic : Consistency check failures

in(功能号8272)Profiler检测阶段的主[第11行]

in (Function number 8272) Main [line 11] during Profiler instrumentation phase

我是以错误的方式解决这个问题还是我错过了什么?

Am I going about this the wrong way or am I missing something?

谢谢..




代码片段

推荐答案

您需要明确地为新本地提供位置。 这篇文章


这篇关于在新的局部变量符号中存储方法调用的返回值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆