Author Topic: gdb can't find sources  (Read 17021 times)

Offline Joerg

  • Multiple posting newcomer
  • *
  • Posts: 100
gdb can't find sources
« 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

It's never too late to fail!

Offline Joerg

  • Multiple posting newcomer
  • *
  • Posts: 100
Re: gdb can't find sources
« Reply #1 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.....
It's never too late to fail!

Offline jomeggs

  • Multiple posting newcomer
  • *
  • Posts: 92
Re: gdb can't find sources
« Reply #2 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.

Offline Joerg

  • Multiple posting newcomer
  • *
  • Posts: 100
Re: gdb can't find sources
« Reply #3 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
It's never too late to fail!

mariocup

  • Guest
Re: gdb can't find sources
« Reply #4 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

Offline martind

  • Multiple posting newcomer
  • *
  • Posts: 47
Re: gdb can't find sources
« Reply #5 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.

Offline Joerg

  • Multiple posting newcomer
  • *
  • Posts: 100
Re: gdb can't find sources
« Reply #6 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
It's never too late to fail!

Offline Joerg

  • Multiple posting newcomer
  • *
  • Posts: 100
Re: gdb can't find sources
« Reply #7 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:
It's never too late to fail!

Offline martind

  • Multiple posting newcomer
  • *
  • Posts: 47
Re: gdb can't find sources
« Reply #8 on: June 27, 2008, 10:15:11 pm »
Hi Reksium,

Can you zip and send your project?

Martin.

Offline Joerg

  • Multiple posting newcomer
  • *
  • Posts: 100
Re: gdb can't find sources
« Reply #9 on: July 01, 2008, 03:30:35 pm »
yes, but I don't know how
can you give me your e-mail?
It's never too late to fail!