Fulgator

Hello!

I have already started C++ learning with VC++ 2005 Express Edition. Unfortunately during debugging one of my first programs I had to unintentionally enable some debugger configuration feature which turns on Disassembly Window at the end of every my program (basic example below).

Could you tell me how to disable this feature because low-level debugging isn't necessary yet in my situation at all.


Code Snippet


int main()
{
//some instructions;
// ................
>> return 0; //
debug caret placement -> Disassembly Window emerges here when F10 pressed
}




Re: Visual C++ Express Edition How to disable disassembly window in VC++ 2005?

crescens2k

This can't be helped. You are then stepping out into the CRT calls and the EE doesn't have the CRT source code.

What you should do is just press F5 there to finish it off there.






Re: Visual C++ Express Edition How to disable disassembly window in VC++ 2005?

Fulgator

Thanks!

Is that mean other VC++ 2005 editions have CRT source code files and thus they don't call assembler in that situation





Re: Visual C++ Express Edition How to disable disassembly window in VC++ 2005?

nobugz

Nah, they'll just show you the source code of the CRT. Practice using Debug + Step Over instead of Debug + Step Into. Use the latter only if you want to trace into the function call. Not sure what the function key is, I modified mine.





Re: Visual C++ Express Edition How to disable disassembly window in VC++ 2005?

Fulgator

OK, I will be practicing debug modes hardly!
Is that mean this assembler code seen in the Disassembler Window is a hidden CRT source file
Doesn't CRT mean C Runtime Library If so, what CRT is needed for in my pure C++ programs They should only use C++ libraries! I mention about it because I observed another strange behavior. Let's have a look at some basic C++ code:

#include<iostream>
using namespace std;

int main()
{
cout << "Something_1" << endl;
printf("Something_2");
return 0;
}

Well, VC++ compiler builds this program regardless of lacking <cstdio> header which includes printf declaration! Oddly enough...







Re: Visual C++ Express Edition How to disable disassembly window in VC++ 2005?

nobugz

Perhaps not wanting to practice debug modes is your hangup. Yes, using Debug + Step Into will show you the assembly code if you don't have the source code. That's the way the unmanaged code debugger works. You can usually get out of Dodge with Debug + Step Out. The CRT is the same for 'C' and C++ code. If you don't want to deal with the plumbing, perhaps writing managed C++/CLI code is more to your liking.





Re: Visual C++ Express Edition How to disable disassembly window in VC++ 2005?

Fulgator

OK as for my debugging troubles!

And what about this undeclared printf example program

Code Snippet

#include <iosteram>

using namespace std;

int main()

{

printf("Something");

return 0;

}






Re: Visual C++ Express Edition How to disable disassembly window in VC++ 2005?

nobugz

Sorry, I don't follow. You misspelled "iostream". I assume you're talking about something else...





Re: Visual C++ Express Edition How to disable disassembly window in VC++ 2005?

Fulgator

nobugz wrote:
Sorry, I don't follow. You misspelled "iostream". I assume you're talking about something else...


Of course! It should be #include <iostream> in this program. But it doesn't change my question because this program is also compiled by VC++ 2005 with such corrected instruction. Why





Re: Visual C++ Express Edition How to disable disassembly window in VC++ 2005?

nobugz

Sorry, I still don't get it. Guessing: <iostream> includes <istream> which includes <ios> which includes <xlocnum> which includes <cstdio> which includes <stdio.h> which defined printf(). Almost anything in the STL headers requires the CRT to get the job done. What are you looking for A compile error on using printf() Or should the debugger magically hide CRT functions you didn't explicitly include/define It doesn't work that way.





Re: Visual C++ Express Edition How to disable disassembly window in VC++ 2005?

Fulgator

nobugz wrote:
Sorry, I still don't get it. Guessing: <iostream> includes <istream> which includes <ios> which includes <xlocnum> which includes <cstdio> which includes <stdio.h> which defined printf(). Almost anything in the STL headers requires the CRT to get the job done. What are you looking for A compile error on using printf() Or should the debugger magically hide CRT functions you didn't explicitly include/define It doesn't work that way.


This is object streams architecture which is understood to me. But I also know that ISO C++ standard forbids using old C style I/O functions like printf...so





Re: Visual C++ Express Edition How to disable disassembly window in VC++ 2005?

nobugz

It plain-old doesn't work that way, 25 years of backwards compatibility messes up the best intentions. As long as you're starting out learning to program, you might want to consider the fact that C/C++ has too much cruft built-up to be a suitable starter language. Anything newer is less crufty, C# is usually a good match. That or figuring out how the debugger works, the choice is up to you.





Re: Visual C++ Express Edition How to disable disassembly window in VC++ 2005?

Fulgator

Yes, I understand now that object oriented C++ is an old procedural C descendant and that is why it must include all outdated solutions taken from C "portable assembler" and C++ compiler's backward compatibility with C as well.
I will consider learning C# instead of C++ but earlier I must find out more about C# because I don't know much about this language. I only read somewhere that C# and .NET concept is similar to Java and JVM portable environment but I don't get Java either.
Main option against C# and Java is that programs written in these languages are significantly slower than ones written in C++.
Besides guys from MS VC++ Developed Team are working on new marshal library for Orcas which can translate data types from C++/STL into CLI/.NET and vice versa. So C++ has a future in Microsoft as well!