473,395 Members | 1,649 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Viewing IL when debugging

Hi,

I posted this question in the visual studio newsgroup, but didn't get a
reply. I'm reposting it here, hoping it's not too off-topic:

When debugging a C# program, how do I see the IL code? I can only get the
disassembly window to show the original C# source and the native Intel
assembly code. Thanks!
Nov 15 '05 #1
6 1730
Sheila
Unless I stand corrected, the only way to do this is to use the ILDASM.EXE
utility on the compiled assembly. You can certainly put
this into your Tools menu available from the IDE.
--Peter

"Sheila Jones" <sh**********@btopenworld.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,

I posted this question in the visual studio newsgroup, but didn't get a
reply. I'm reposting it here, hoping it's not too off-topic:

When debugging a C# program, how do I see the IL code? I can only get the
disassembly window to show the original C# source and the native Intel
assembly code. Thanks!

Nov 15 '05 #2
Oh. I was hoping to learn a bit about IL by seeing how my C# code had been
translated and stepping through it in the debugger. But it sounds like
that's not possible.

As an alternative, is there a way to generate an output file that includes
C# and IL code? That would be better than nothing.

Thank you for the reply.
"Peter Bromberg [C# MVP]" <pb*******@yahoo.com> wrote in message
news:Os**************@tk2msftngp13.phx.gbl...
Sheila
Unless I stand corrected, the only way to do this is to use the ILDASM.EXE
utility on the compiled assembly. You can certainly put
this into your Tools menu available from the IDE.
--Peter

"Sheila Jones" <sh**********@btopenworld.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,

I posted this question in the visual studio newsgroup, but didn't get a
reply. I'm reposting it here, hoping it's not too off-topic:

When debugging a C# program, how do I see the IL code? I can only get the disassembly window to show the original C# source and the native Intel
assembly code. Thanks!


Nov 15 '05 #3
Sheila,
As an alternative, is there a way to generate an output file that includes
C# and IL code? That would be better than nothing.


Ildasm.exe /source

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 15 '05 #4
Hello Mattias,

Thank you for your reply, which certainly works. But I now have a couple
more questions:

Is there a way to show the C# source in a different colour, to distinguish
it from the IL?

Also, I have some long C# statements that are split over 2 or more lines.
Ildasm shows the first line of source, then the IL, then the remaining
source line(s), which is confusing. Is there any way to show all the lines
of the statement first, then the corresponding IL?

Thanks once again.
"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:O9**************@TK2MSFTNGP12.phx.gbl...
Sheila,
As an alternative, is there a way to generate an output file that includesC# and IL code? That would be better than nothing.


Ildasm.exe /source

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 15 '05 #5
Sheila,
Is there a way to show the C# source in a different colour, to distinguish
it from the IL?
The C# source is included as comments in the IL assembler code right?
So any editor that can color the comments differently could do that.
But I don't think VS.NET will do that while debugging since it doesn't
have any IL assembler support.

Is there any way to show all the lines
of the statement first, then the corresponding IL?


Not that I know.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 15 '05 #6
Sheila,
Is there a way to show the C# source in a different colour, to distinguish
it from the IL?
The C# source is included as comments in the IL assembler code right?
So any editor that can color the comments differently could do that.
But I don't think VS.NET will do that while debugging since it doesn't
have any IL assembler support.

Is there any way to show all the lines
of the statement first, then the corresponding IL?


Not that I know.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 15 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Mark | last post by:
hello! is there a way in code to view the entire HTTP Header? Many of the variables in $_SERVER have much of the header, as do some of the apache functions, but none seem to have a way to show...
4
by: tperri | last post by:
I've got a user table with a field called Online, and when a user logs in, I set a value in this column to indicate they are online. And in the same fashion, when they click the logout button, I...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
10
by: NH | last post by:
I have a girdview with paging enabled. How can I add a message in the footer to say "Viewing records 1-15 of 45" etc Thanks
1
by: Ryan | last post by:
Is there any way to view what data is populating my DataSet tables during debugging? Thanks, Ryan
3
by: Madhur | last post by:
Hello This question is related to debugging. Suppose I add a Collection to my watch Window. Although that collection shows the count of item in it, there is no way I can see the some common...
0
by: David P. Donahue | last post by:
This is the first time I've had any problems viewing a report in any of my applications, so I'm not sure where to begin. But when I try to render my report in a report viewer, the application...
12
bartonc
by: bartonc | last post by:
Here's something cool that I just discovered (on IE7, I wonder about the others): I was viewing a long code block with some really long lines in it. Since the horizontal scroll bar was WAY of my...
0
by: Deceneu | last post by:
Hi everyone, this is my first post so please bear with me. I have the following situation: i have a local report that needs to have two "versions": one for viewing in the report viewer (with all...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.