Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / March 2006

Tip: Looking for answers? Try searching our database.

Generating Assembler Code in CLR App

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mclagett - 22 Mar 2006 17:20 GMT
I discovered that when I compiled my C++ /clr app with the /clr option, I
have lost the ability to view (and thus debug) Intel assembly language code I
am generating.  In my app I allocate a piece of memory with VirtualAlloc and
use the PAGE_EXECUtE_READWRITE flag, but when I attempt to type an address
from the allocated range into the Address: combo in the Disassembly window, I
get the following popup message:  

The specified address cannot be displayed.  There is no code at the supplied
location.

Is there something I should be doing that am I'm not (or perhaps something I
shouldn't be doing that I am)?

Any guidance would be greatly appreciated.

Regards,

Mike  
Ole Nielsby - 22 Mar 2006 19:32 GMT
>I discovered that when I compiled my C++ /clr app with the
> /clr option, I have lost the ability to view (and thus debug)
> Intel assembly language code I am generating.

Worse than that, I can't debug MASM code linked into a
C++ /clr app. Sometimes it is possible to see snippets of
MASM source in the disassembler window together with
the disassembly, at other times the display is erratic.

I suspect this quirk has to do with the MASM code being
called from inside a message handler.

Not sure this is really a microsoft.public.vstudio.extensibility
topic...
mclagett - 23 Mar 2006 13:36 GMT
Hi --

I found an anser to this problem through the general Visual C++ forum, so I
thought I would post the solution.  It turns out that assembly code can't be
viewed from the disassembly window if the currently active stack frame is a
managed one.  The solution is to switch via the call stack to some native
function (probably the one that calls the assembly code) and then it will be
visible.  This certainly worked for me.

> I discovered that when I compiled my C++ /clr app with the /clr option, I
> have lost the ability to view (and thus debug) Intel assembly language code I
[quoted text clipped - 14 lines]
>
> Mike  

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.