VS2005 debugger yellow arrow shows wrong line?

Hi,

I am not sure this is only related with Cuda code or not but when I am trying to debug(F10-line by line) my CUDA code(of course the host part) the yellow arrow which supposedly to show the next line of execution shows somewhere else. Sometimes it shows smtg like 20 lines before the real execution line or somewhere else.It just makes it impossible to follow. Has anybody get into a situation like this.And any idea how can i make it correct?

Thanks in advance.

Akif,

rebuild your project~ and add the debug information into the compiler command

this is happened when you are building the project but some of the old .objs don’t be built…

so sometimes you should close the project first, then delete all the files in the debug category.
then rebuild them…

good luck…

Replying my own question :)

I finally found out what is wrong with my code. When I write code I prefer to use multiple lines if that line is going to be a long line.

For example calling a function with long variable names I would write

[codebox]functionA(int intVariable1,

      float* floatPointer,

      float* anotherOneHere,

      float* oneMoreAgain);[/codebox]

Well today I learnt you should not do this with macros.(or at least with CUDA_SAFE_CALL macro)

If you write smtg like this

[codebox] CUDA_SAFE_CALL( cudaMemcpy( h_odata,

                            d_odata, 

                            memSize,

                            cudaMemcpyDeviceToHost) );

[/codebox]

Instead of 4 lines compiler assumes it is only 1 line and after that point all warning and error messages are shifted 3 lines upwards.

In release mode there is no problem because I think this macro is ignored.Right?

But searching thorough web I think people are splitting these lines with no problem. For example:

http://www.gpgpu.org/developer/cudpp/rel/r…mplecudpp.html)

So can you confirm what I found is true or this problem is specific to my compiler?

Thank you.

Akif,