Hello ladies and gents,

Wanted to ask if someone could help me out with the debug settings in VC++ 2005.

What I want to be able to do is to follow my program step by step and see what happens with the variables.

I know it's related to the settings in the Project Properties, but, problem is, I don't know what to change in the C/C++ and Linker tabs.

I have changed for example the C/C++ -> General -> "Debug Information Forma" -> into -> Program Database for Edit & Continue (/ZI). But, I have to change these in the linker tab aswell, but, don't know which to change into what???

I was hoping any of you could help me out here.

Recommended Answers

All 9 Replies

Aren't just the breakpoints enough? F9 to set the breakpoint. F10 to step line by line from a breakpoint. F11 to jump in to the next function. ....

Hi Wolfpack,

No it doesn't, when I put a breakpoint at a certain function call like:

multi(i); in main

and the debugger gets to that point, and I press Get Into, I am being brought to the ostream header, and not into my function which I would like to follow.

Example:

#include <iostream>

using namespace std;

void multi(int& x)
{
	cout << x * 2 << ' ';
}

int main()
{
	//insert elements from 1 to 9
	for (int i = 1; i <= 9; ++i){
		cout << i << ' ';
	}
	cout << endl;

	for (int i = 1; i <= 9; ++i){
		multi(i);
	}
	cout << endl;

	cout << "Press enter to exit." << endl;
	cin.get();
}

Sorry for the delay. I was cooking. :cheesy:
I ran your code on a Visual C++ Express that I installed just yesterday. It is still on the factory settings.
When I set the breakpoint in line number 19,

for (int i = 1; i <= 9; ++i){
		multi(i);// this is line number 19
	}

Pressing F11 will take you to the multi function. However if you press F11 where there is a line with cout, you will be taken to the ostream file. Maybe that is where you are doing wrong. For those places try F10.

Sorry for the delay. I was cooking. :cheesy:

No problem, enjoy your meal ;)

I ran your code on a Visual C++ Express that I installed just yesterday. It is still on the factory settings.

That's what I'm not certain of anymore, I think I allready changed some settings, don't remember which ones exactly :o

When I set the breakpoint in line number 19,

for (int i = 1; i <= 9; ++i){
		multi(i);// this is line number 19
	}

Pressing F11 will take you to the multi function. However if you press F11 where there is a line with cout, you will be taken to the ostream file. Maybe that is where you are doing wrong. For those places try F10.

There are some problems with those:

1) When I'm even on

cout << i << ' ';

this line and press F10, it just stays there and doesn't do anything. When pressing F11 I get the ostream headerfile. The only way to get out of here is when I use Step Out.

2) When I used Step Out and get towards the code line N°19 as you say, press F11, I get back towards ostream headerfile. When using F10, it just stays in place and doesn't do anything.

1) When I'm even on

cout << i << ' ';

this line and press F10, it just stays there and doesn't do anything. When pressing F11 I get the ostream headerfile. The only way to get out of here is when I use Step Out.

No idea. I can move between the lines in the for loops using F10. But F11 takes me to ostream as expected.

2) When I used Step Out and get towards the code line N°19 as you say, press F11, I get back towards ostream headerfile. When using F10, it just stays in place and doesn't do anything.

No idea again.

That's what I'm not certain of anymore, I think I allready changed some settings, don't remember which ones exactly

If you want to reset the options you could try the following, BUT AT YOUR OWN RISK. I have tried it for Microsoft Office and it worked, but have not tried it for Visual Studio. Close VCExpress, open regedit and try deleting the [HKEY_CURRENT_USER\SOFTWARE\Microsoft\VCExpress] Key. and then restart VCExpress. Should reset ALL your VCExpress Settings.
If you decide to do that REMEMBER TO BACKUP YOUR REGISTRY BEFOREHAND.
Good luck. Tell me how it goes.

If you decide to do that REMEMBER TO BACKUP YOUR REGISTRY BEFOREHAND.
Good luck. Tell me how it goes.

Well, thanks for the help, but, I prefer to stay clear of that, think the only thing left is to keep on trying and change some parameters in the Property Settings.

Well, I found a solution to get the original settings once again --> Tools --> Import and Export Settings ...

So, I tried once again to set a breakpoint at the function call and press F11 to see whether I would be brought to the function, but alas, once again, the ostream headerfile opened once again.

If you or anyone else is reading this Wolfpack, could you please see which settings I have to change to get the correct result :)

Thanks.

Hello ladies and gents,

I know this is an old thread, but, just in case anyone else has similar problems, I found the cause of the problem.

Up untill now, I didn't find a solution in to getting the debugger to work correctly, but I started to look for a solution again and changed a few parameters in the configuration panel which I thought where necessary to get it to work, but again, to no avail.

However, I highered my Panda virus protection to give me an indication of any virus, hack, etc... that was trying to intrude my computer and what did I see, my anti virus system was saying that my .exe that I was working with on that moment was a virus. To test it out, I disconnected my antivirus system for a minute and tried to use the debugger again and it worked the way it was supposed to work.

Maybe this is hard to believe but, it's working now, I only have to figure out how I can keep my antivirus system working and use the debugger at the same time.

Everything is working now, closed anti-virus, opened it again, and the debugger still works, closed VS EE and opened it again, opened the program and it still is working, keeping fingers crossed. :)

I have seen that problem on occasion when using Norton Antivirus. And depending on the program you might have to disable a firewall that may be running on your ocmputer.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.