gdb: no source file named main.cpp problem

General questions regarding the usage of CodeLite
varnie
CodeLite Veteran
Posts: 64
Joined: Wed Jun 11, 2008 3:48 am
Contact:

gdb: no source file named main.cpp problem

Post by varnie »

good day.

when i try to debug my project on CodeLite IDE i get the following:
Debug session started successfully!
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
set unwindonsignal on
set width 0
set height 0
No source file named /usr/home/varnie/.codelite/int/myprogram/main.cpp.
Continuing...
i'm using "debug" configuration type with "-g" flag for g++ (which is used to enable debug info), but have no result. this all results in inability of tracing program.
but if i'm using "gdb myprogram" right in console, everything works fine.

what i've missed? thanks for ideas.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: gdb: no source file named main.cpp problem

Post by eranif »

Can u enable to the full debugger logging and paste the entire content of the log?

To enable the log:
'Settings -> Debugger Settings ... -> Loaded Debuggers'

and enable the option "Enable full debugger logging"

- Eran
Make sure you have read the HOW TO POST thread
varnie
CodeLite Veteran
Posts: 64
Joined: Wed Jun 11, 2008 3:48 am
Contact:

Re: gdb: no source file named main.cpp problem

Post by varnie »

here it is:
Debug session started successfully!
DEBUG>>~"GNU gdb 6.1.1 [FreeBSD]\n"
GNU gdb 6.1.1 [FreeBSD]
DEBUG>>~"Copyright 2004 Free Software Foundation, Inc.\n"
Copyright 2004 Free Software Foundation, Inc.
DEBUG>>~"GDB is free software, covered by the GNU General Public License, and you are\n"
GDB is free software, covered by the GNU General Public License, and you are
DEBUG>>~"welcome to change it and/or distribute copies of it under certain conditions.\n"
welcome to change it and/or distribute copies of it under certain conditions.
DEBUG>>~"Type \"show copying\" to see the conditions.\n"
Type "show copying" to see the conditions.
DEBUG>>~"There is absolutely no warranty for GDB. Type \"show warranty\" for details.\n"
There is absolutely no warranty for GDB. Type "show warranty" for details.
DEBUG>>~"This GDB was configured as \"i386-marcel-freebsd\"..."
This GDB was configured as "i386-marcel-freebsd"...
DEBUG>>~"\n"
DEBUG>>(gdb)
DEBUG>>&"set unwindonsignal on\n"
set unwindonsignal on
DEBUG>>^done
DEBUG>>(gdb)
DEBUG>>&"set width 0\n"
set width 0
DEBUG>>^done
DEBUG>>(gdb)
DEBUG>>&"set height 0\n"
set height 0
DEBUG>>^done
DEBUG>>(gdb)
DEBUG>>&"No source file named /usr/home/varnie/.codelite/int/interpreter/CSyntaxer.h.\n"
No source file named /usr/home/varnie/.codelite/int/interpreter/CSyntaxer.h.
DEBUG>>00000071^error,msg="No source file named /usr/home/varnie/.codelite/int/interpreter/CSyntaxer.h."
No source file named /usr/home/varnie/.codelite/int/interpreter/CSyntaxer.h.
DEBUG>>(gdb)
DEBUG>>&"No source file named /usr/home/varnie/.codelite/int/interpreter/CSyntaxer.h.\n"
No source file named /usr/home/varnie/.codelite/int/interpreter/CSyntaxer.h.
DEBUG>>00000072^error,msg="No source file named /usr/home/varnie/.codelite/int/interpreter/CSyntaxer.h."
No source file named /usr/home/varnie/.codelite/int/interpreter/CSyntaxer.h.
DEBUG>>(gdb)
DEBUG>>&"No source file named /usr/home/varnie/.codelite/int/interpreter/main.cpp.\n"
No source file named /usr/home/varnie/.codelite/int/interpreter/main.cpp.
DEBUG>>00000073^error,msg="No source file named /usr/home/varnie/.codelite/int/interpreter/main.cpp."
No source file named /usr/home/varnie/.codelite/int/interpreter/main.cpp.
DEBUG>>(gdb)
DEBUG>>&"No source file named /usr/home/varnie/.codelite/int/interpreter/main.cpp.\n"
No source file named /usr/home/varnie/.codelite/int/interpreter/main.cpp.
DEBUG>>00000074^error,msg="No source file named /usr/home/varnie/.codelite/int/interpreter/main.cpp."
No source file named /usr/home/varnie/.codelite/int/interpreter/main.cpp.
DEBUG>>(gdb)
DEBUG>>&"No source file named /usr/home/varnie/.codelite/int/interpreter/main.cpp.\n"
No source file named /usr/home/varnie/.codelite/int/interpreter/main.cpp.
DEBUG>>00000075^error,msg="No source file named /usr/home/varnie/.codelite/int/interpreter/main.cpp."
No source file named /usr/home/varnie/.codelite/int/interpreter/main.cpp.
DEBUG>>(gdb)
DEBUG>>&"No source file named /usr/home/varnie/.codelite/int/interpreter/main.cpp.\n"
No source file named /usr/home/varnie/.codelite/int/interpreter/main.cpp.
DEBUG>>00000076^error,msg="No source file named /usr/home/varnie/.codelite/int/interpreter/main.cpp."
No source file named /usr/home/varnie/.codelite/int/interpreter/main.cpp.
DEBUG>>(gdb)
DEBUG>>00000077^running
Continuing...
DEBUG>>(gdb)
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: gdb: no source file named main.cpp problem

Post by eranif »

Hi,

Can u check the 'Automatically break at main" and start debugging again?

Eran
Make sure you have read the HOW TO POST thread
varnie
CodeLite Veteran
Posts: 64
Joined: Wed Jun 11, 2008 3:48 am
Contact:

Re: gdb: no source file named main.cpp problem

Post by varnie »

hmm.. it seems it works now! suppose there is a need of a little "explanation" about what have been wrong with my approach? thanks.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: gdb: no source file named main.cpp problem

Post by eranif »

I am not sure what is wrong here, but did you set a break points? (sorry for the dumb question ...)

But I am missing this line of the form "break "<file_name>":linenumer
For example, here is the debugger output test from my machine:

Code: Select all

There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-mingw32"...
set  new-console on
Debuggee process ID: 3928
set unwindonsignal on
set width 0
set height 0
break "C:/TestArea/main.cpp":8
Breakpoint 1 at 0x401339: file main.cpp, line 8.
Successfully set breakpoint at: C:\TestArea\main.cpp:8
Continuing...
enabling the flag "automatically break at main" sends the debugger the command (right after the gdb starts and before any other command from the user):

Code: Select all

break main
Which seems to work.

One more test, now that the debuggers stops, can you break at another line and hit the continue button? does it work for you?

Eran
Make sure you have read the HOW TO POST thread
varnie
CodeLite Veteran
Posts: 64
Joined: Wed Jun 11, 2008 3:48 am
Contact:

Re: gdb: no source file named main.cpp problem

Post by varnie »

nope. can't do that. if i disable "automatically set break point at main" and enable my own several break points and then press F5/Start continue debug the debugger won't stop on them. don't know why. after i set it back again to automatically breaks at main it stops again on the main function.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: gdb: no source file named main.cpp problem

Post by eranif »

Can u enable the 'enable pending breakpoints' and give it a try again.

Eran
Make sure you have read the HOW TO POST thread
varnie
CodeLite Veteran
Posts: 64
Joined: Wed Jun 11, 2008 3:48 am
Contact:

Re: gdb: no source file named main.cpp problem

Post by varnie »

after enabling this option the debugger stops in main.cpp on my comments' line (which isn't marked to be break point at all) and i can't step further.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: gdb: no source file named main.cpp problem

Post by eranif »

Can you do this:
- Perform a complete re-build (Clean followed by Build)
- make sure that in build log there is a '-g' option
- Right click on project -> settings ->General tab - and make sure that the 'Command' field contains the executable that was created.

Off topic question: Can you update CodeLite to newer version? I have made some changes in the debugger which may impact on bug you are experiencing.

Eran
Make sure you have read the HOW TO POST thread
Post Reply