Yep! NewObjectNoConstructor creates an object on the heap, so if it's a
value type it'll be boxed. CreateValue is used to make unboxed value types.
Jonathan
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: oleg stepanov <Oleg.Stepanov@jetbrains.com>
| Subject: RE: Passing constants to functions + boxing
| References: <liZoCpCoEHA.3636@cpmsftngxa06.phx.gbl>
| Content-Type: text/plain; charset=koi8-ru
| Message-ID: <eL74HJHoEHA.608@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.clr
| Date: Wed, 22 Sep 2004 00:03:34 -0700
| NNTP-Posting-Host: gw.intellij.net 195.5.138.42
| Lines: 1
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTFEED0
1.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.clr:11872
| X-Tomcat-NG: microsoft.public.dotnet.framework.clr
|
| Hello Jonathan,
|
| Thanks! Just didn't know that Int32 object value is guaranteed a boxed
value.
|
| --
| Oleg Stepanov
| Software Developer
| JetBrains, Inc
|
http://www.jetbrains.com | "Develop with pleasure!"
|
| > Oleg,
| > Use ICorDebugEval::NewObjectNoConstructor to create a new Int32.
| > (The
| > function has func-eval semantics, so you'll have to continue the
| > process
| > and get the result from an EvalComplete callback.)
| >
| > On the resulting ICorDebugBoxValue, call GetObject to get the
| > underlying integer.
| >
| > On the resulting ICorDebugValue, get the ICorDebugGenericValue
| > interface and set the integer to 12.
| >
| > Pass the ICorDebugBoxValue to ICorDebugEval::CallFunction.
| >
| > Jonathan
| >
| > This posting is provided "AS IS" with no warranties, and confers no
| > rights.
| >
| > --------------------
| > | From: oleg stepanov <Oleg.Stepanov@jetbrains.com>
| > | Subject: Passing constants to functions + boxing
| > | Content-Type: text/plain; charset=koi8-ru
| > | Message-ID: <ehrS$tLnEHA.2948@TK2MSFTNGP11.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.framework.clr
| > | Date: Fri, 17 Sep 2004 06:37:36 -0700
| > | NNTP-Posting-Host: gw.intellij.net 195.5.138.42
| > | Lines: 1
| > | Path:
| > cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MS
| > FTNGP0
| > 8.phx.gbl!TK2MSFTNGP11.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| > microsoft.public.dotnet.framework.clr:11840
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.clr
| > |
| > | Hi,
| > |
| > | I got a bit stuck with the Debug API. I have the following task:
| > imagine there's a simple function
| > |
| > | static object Foo( object value ) { return value; }
| > |
| > | in debuggee process and I want to evaluate Foo(12). Can anyone
| > tell me
| > step by step how can I do that? Thanks!
| > |
| > | --
| > | Oleg Stepanov
| > | Software Developer
| > | JetBrains, Inc
| > |
http://www.jetbrains.com | > | "Develop with pleasure!"
| > |
|
|