Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code::Blocks GDB Cannot Open file Error

Tags:

gdb

codeblocks

I use Code::Blocks 12.11 and Cygwin gdb in Windows 8. I configured the cygwin gdb in code::blocks, when debug, it reports "cannot open file" error. Using gdb in command line is alright.

I found this discussion from web, but I cannot find the registery entry. My guess is that the Debugger plugin cannot pass a right path name to gdb, there is ">>" in prefix of the path, i copied this into editor and it turns out to be two "sub" charaters (1A in ascii).

Here is the error log, the ">>" is added by hand, because when I copied it here, the "sub" charaters don't show.

Debugger name and version: GNU gdb (GDB) 7.6.50.20130728-cvs (cygwin-special)
Child process PID: 21936
Cannot open file: >>/cygdrive/e/code/test/main.cpp
At >>/cygdrive/e/code/test/main.cpp:17
Debugger finished with status 0

My question is

1.How can I make the gdb work in the Code::Blocks

2.Are the two "sub" charaters normal and why do they appear, how can I remove it.

like image 248
xiaobing Avatar asked Sep 01 '13 14:09

xiaobing


People also ask

How do I use GDB in code blocks?

1) Start CodeBlocks 2) Select the Settings menu 3) Select the Debugger... option in the Settings menu 4) In the Debugger Settings window, select the Default category under GDB/CDB debugger 5) You should see a field named "Executable path:" in the Debugger settings window.

How do I open code blocks files?

To open a project From the File menu select Open. From the Files of type: in the window, select “Code::Blocks project files” and then select the . cbp file pertaining to your program. Press Open when done.

Why is CodeBlocks not opening?

Re: Suddenly can't open CodeBlocks You could try to reset the config. Search your AppData for a CodeBlocks folder and there is a default. conf file. You could backup and delete the whole folder - this would reset your settings.


1 Answers

I made it work by doing the following:

I added a String Value under

HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2

and

HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\Cygwin\mounts v2

(none of the folders were there, so I had to create them manually by selecting New->Key)

with the following parameters:

name: cygdrive prefix

value: /cygdrive

like image 137
user2565010 Avatar answered Oct 06 '22 07:10

user2565010