Code::Blocks Forums

User forums => Embedded development => Topic started by: Joerg on June 16, 2008, 11:13:08 am

Title: gdb can't find sources
Post by: Joerg on June 16, 2008, 11:13:08 am
Hi,

it's not necessarily related to C::B but maybe someone around here can help.
I'm not able to set breakpoints anymore because gdb says

No source file named D:/Projekte/icps-sw/src/mmc.c.

Some testing showed that cygdrive/d/... works.
Seems like this arm-elf-gdb was compiled for cygwin.
Typing 'list keyboard.c:0' as user command works too.
I there an option to tell codeblocks not to use absolute paths to set beakpoints?
Using no path at all shoul work too.

Joerg

Title: Re: gdb can't find sources
Post by: Joerg on June 16, 2008, 11:40:17 am
hmm,

when i copy the sources in my project path it works.
Even though the path is absolute too.
It seems more to be a problem if the sources are in a different directory.
We got them relatively under ../../src.
I can copy the sources in my project dir temporary  but
that is not a stable solution.
grrrr.....
Title: Re: gdb can't find sources
Post by: jomeggs on June 17, 2008, 12:41:52 am
Hi,

if I understood correctly, you've copied the sources to another destination before debugging. In this case, a complete rebuild will help.
Title: Re: gdb can't find sources
Post by: Joerg on June 17, 2008, 10:42:08 am
No,
I copied them to my local project source to
be able to debug them! ;-)
we organized our sources like:
/proj/myprojects
/src
Where the main/common sources lies under src
and my local project under proj.

I think its a gdb/c::b problem because when I type
'list source.c:0' in the gdb command line I can
see the source and set breakpoints.
Regards,
Joerg
Title: Re: gdb can't find sources
Post by: mariocup on June 17, 2008, 11:33:45 am
Hi rekisum,

I observed that if you switch between different CB projects then sometimes the working directory is not correct, but I did not find a way to reproduce it. But perhaps this could be your problem. Just use the command pwd in the debugger to see if the working directory is correct. You could even force the debugger to use a certain working directory with the comannd line option --cd=<workingdir>. This fixed my problem with an external debugger.

Bye,

Mario
Title: Re: gdb can't find sources
Post by: martind on June 17, 2008, 05:19:12 pm
Hi,

If you go into the advanced options for the compiler settings, do you have "use full pathnames" checked?

Martin.
Title: Re: gdb can't find sources
Post by: Joerg on June 18, 2008, 10:06:51 am
Hi,

the gdb path seems to be ok. Changing it didn't help the problem.
The 'use full pathnames' option was not checked.
Activating it didn't change anything,
C::B sends full paths to GDB anyway.
Will ask the queistion in the OpenOCD forum.
Maybe someone there runs over the same problem.
Thanks
Title: Re: gdb can't find sources
Post by: Joerg on June 26, 2008, 02:39:05 pm
Buhuhuuu,
debugging still doesn't work with newest nightly:

>>>>>>cb_gdb:
> break "D:/Projekte/cps-sw/src/lcd/screen.c:162"
No source file named D:/Projekte/cps-sw/src/lcd/screen.c.

Setting 'use forward slashes' and/or 'full path for gdb'
doesn't change anything regarding this problem.
:cry:
Title: Re: gdb can't find sources
Post by: martind on June 27, 2008, 10:15:11 pm
Hi Reksium,

Can you zip and send your project?

Martin.
Title: Re: gdb can't find sources
Post by: Joerg on July 01, 2008, 03:30:35 pm
yes, but I don't know how
can you give me your e-mail?