User forums > Help
No cursor in debugger
Jerome:
I'm not sure if this is a bug or a configuration issue.
I am doing CUDA programming in C++ on Debian. I need to use a make file, to invoke the nvcc compiler wrapper. That all works fine. When I debug, there is no little yellow triangular cursor inside the source member, and the source editor does not page down when the execution point goes off the bottom of the screen. The debugger correctly displays the source file and line number in text, and it sets break points correctly when I click on them inside the source code, and stops at them. It would appear that C::B is supposed to parse the debugger text and display a cursor, and that is not working. It seems possible that it does not recognize the file name as referring to the source file being edited, but that is hard to reconcile with the fact that it correctly sets break points when a line is clicked in that file.
Additional info; CUDA make puts all executables in a common directory which is not under the project directory. I got the debugger to work by setting the Output filename under the Build Targets options. Since make is generating the executables, this was not needed to get Build to work, but it appears to be used to set the Debug target.
oBFusCATed:
C::B and GDB versions please?
Does GDB work from the command line?
Does it work with simple c/c++ project?
Where is the full log from the debugger (see the settings for details)?
Jerome:
C::B version 10.05,
GDB version 7.0.1
The cursor is there in a Hello World project.
Here is the debugger messages;
Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: /home/jerome/NV_SDK/C/src/VA/
Adding source dir: /home/jerome/NV_SDK/C/src/VA/
Changing directory to: /home/jerome/NV_SDK/C/bin/linux/debug
Adding file: ../../bin/linux/debug/VA
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.0.1-debian
At /home/jerome/NV_SDK/C/src/VA/VA.cu:91
Continuing...
At /home/jerome/NV_SDK/C/src/VA/VA.cu:103
At /home/jerome/NV_SDK/C/src/VA/VA.cu:104
Child process PID: 9107
At /home/jerome/NV_SDK/C/src/VA/VA.cu:105
At /home/jerome/NV_SDK/C/src/VA/VA.cu:110
At /home/jerome/NV_SDK/C/src/VA/VA.cu:111
At /home/jerome/NV_SDK/C/src/VA/VA.cu:112
Continuing...
Program exited with code 0377.
Debugger finished with status 0
I set a breakpoint, started the program, it hit the break. I set another BP, continued. it hit that. I single-stepped off the bottom of the page (at line 109). At no point was there a cursor, and the editor window did not move.
Here is the debugger log
LD_LIBRARY_PATH=.:
Command-line: /usr/bin/gdb -nx -fullname -quiet -args ../../bin/linux/debug/VA
Working dir : /home/jerome/NV_SDK/C/src/VA/
Reading symbols from /home/jerome/NV_SDK/C/bin/linux/debug/VA...
done.
(gdb)
> set prompt >>>>>>cb_gdb:
Executing: xterm -T 'Program Console' -e sleep 83452
>>>>>>cb_gdb:
> show version
GNU gdb (GDB) 7.0.1-debian
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set unwindonsignal on
>>>>>>cb_gdb:
> set disassembly-flavor intel
>>>>>>cb_gdb:
> catch throw
Function "__cxa_throw" not defined.
Catchpoint 1 (throw)
>>>>>>cb_gdb:
> source /usr/share/codeblocks/scripts/stl-views-1.0.3.gdb
Executing: ps x -o tty,pid,command
>>>>>>cb_gdb:
> cd /home/jerome/NV_SDK/C/bin/linux/debug
>>>>>>cb_gdb:
> directory /home/jerome/NV_SDK/C/src/VA/
>>>>>>cb_gdb:
> break "/home/jerome/NV_SDK/C/src/VA/VA.cu:91"
PS result: ? 9103 ps x -o tty,pid,command
PS result: pts/1 9100 sleep 83452
TTY is[/dev/pts/1]
GetConsoleTTY[/dev/pts/1]ConsolePid[9098]
Queued:[tty /dev/pts/1]
Breakpoint 2 at 0x4014df: file VA.cu, line 91.
>>>>>>cb_gdb:
> tty /dev/pts/1
>>>>>>cb_gdb:
> run
[Thread debugging using libthread_db enabled]
Breakpoint 2, main (argc=1, argv=0x7fffffffe8e8) at VA.cu:91
/home/jerome/NV_SDK/C/src/VA/VA.cu:91:2490:beg:0x4014df
>>>>>>cb_gdb:
> break "/home/jerome/NV_SDK/C/src/VA/VA.cu:103"
Breakpoint 3 at 0x401514: file VA.cu, line 103.
>>>>>>cb_gdb:
> cont
Breakpoint 3, main (argc=1, argv=0x7fffffffe8e8) at VA.cu:103
/home/jerome/NV_SDK/C/src/VA/VA.cu:103:2818:beg:0x401514
>>>>>>cb_gdb:
> next
/home/jerome/NV_SDK/C/src/VA/VA.cu:104:2848:beg:0x401520
>>>>>>cb_gdb:
> next
[New Thread 0x7ffff5dd9700 (LWP 9107)]
/home/jerome/NV_SDK/C/src/VA/VA.cu:105:2898:beg:0x40153d
>>>>>>cb_gdb:
> next
/home/jerome/NV_SDK/C/src/VA/VA.cu:110:3013:beg:0x40155a
>>>>>>cb_gdb:
> next
/home/jerome/NV_SDK/C/src/VA/VA.cu:111:3045:beg:0x40156d
>>>>>>cb_gdb:
> next
/home/jerome/NV_SDK/C/src/VA/VA.cu:112:3083:beg:0x40157e
>>>>>>cb_gdb:
> cont
[Thread 0x7ffff5dd9700 (LWP 9107) exited]
Program exited with code 0377.
>>>>>>cb_gdb:
> quit
The program crashed, but that is what I was debugging. I know what's causing that.
I don't normally use dbg from the command line, so I am not sure if it works. But since it isn't supposed to display a cursor from the command line, that's kind of moot, isn't it? dbg actually seems to work just fine from within C::B. It's C::B that isn't working. But if you want to give me a string of commands to enter at the command line, I'll be happy to do it.
Thanks for your time!
Jerome
Jerome:
By the way, if you like, I will try to debug this myself. Just point me at the source for this feature. I am relatively new to Linux, but I'm here to learn. I am thinking I might try to add extensions to support the CUDA debugger, which is basically just gdb with some additional functions to handle the GPU.
Jerome
ollydbg:
Please use tags next time.
--- Code: ---> next
/home/jerome/NV_SDK/C/src/VA/VA.cu:110:3013:beg:0x40155a
>>>>>>cb_gdb:
--- End code ---
--- Code: ---At /home/jerome/NV_SDK/C/src/VA/VA.cu:110
--- End code ---
From the above message, I see that the debugger plugin works fine, and it parse the message from gdb correctly, and "cursor" should goto the file "VA.cu" and line "110".
About the source code, they are under:
cb_trunk\src\plugins\debuggergdb\gdb_driver.cpp
--- Code: ---void GDB_driver::ParseOutput(const wxString& output)
{
m_Cursor.changed = false;
........
........
if (m_Cursor.changed || m_forceUpdate)
NotifyCursorChanged();
}
if (m_ProgramIsStopped)
RunQueue();
}
--- End code ---
I believe that the NotifyCursorChanged(); call will actually change the cursor in the editor.
Navigation
[0] Message Index
[#] Next page
Go to full version