Debugging in Eclipse

Hi!

Am am currently trying Eclipse with CDT for running CUDA applications. I am having problems running debug mode. Eclipse gives me the error:

No symbol “new” in current context
Stopped due to shared library event
[Thread debugging using libthread_db enabled]

I tried with and without the -deviceemu flag.

I manage to run normal GPU execution and get the corrent output. It would be nice though to be able to step inside code and look at values and so on. Is this possible or do I have to start using NetBeans as described in another post in the forum? And how can I set different make targets for release and debug? I have two targets in my makefile, but I don’t see how I can make Eclipse use the debug target (with -deviceemu) when running debugger. Any ideas?

  • Atle

Hi!

Same problem here. I used to work with eclipse+cdt in other computer without problems using CUDA 1.0, now I’m using CUDA 1.1

For adding different MAKE TARGETS for release and debug right-click
on your project and select “Build Make Target”. You’ll need to create
different “run” profiles for running/debugging each executable

When trying to debug my code the program exits in CUT_DEVICE_INIT():

A syntax error in expression, near `-console'.

Stopped due to shared library event

[Thread debugging using libthread_db enabled]

[New Thread -1225648416 (LWP 11881)]

Stopped due to shared library event

[Switching to Thread -1225648416 (LWP 11881)]

Stopped due to shared library event

Warning:

Cannot insert breakpoint 0.

Error accessing memory address 0x806: Input/output error.

Single stepping until exit from function _dl_debug_state, 

which has no line number information.

Ok, after a couple of headaches I finally found out how to get rid of this.

For a given run/debug configuration: select debugger tab->shared libraries tab

uncheck option “Load shared library symbols automatically”

Hope this helps you