This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: managing breakpoints in gdb


Domen Vrankar wrote:

> I can't set breakpoints in gdb under cygwin with whole path to the source file:
> break "C:/cygwin/home/moon/uart/hello.c:69"
> break "/cygdrive/c/cygwin/home/moon/uart/hello.c:69"
> 
> The only thing similar to those two that works is:
> break "/home/moon/uart/hello.c:69"

Like Dave said, gdb only knows what the compiler specified as the path
to the source file when it created the object.  So if gcc records it as
/home/moon/uart/hello.c, that's what gdb expects to see -- it's a simple
string compare.  But as long as you haven't moved the source since
compiling, you should be able to just do "break hello.c:69".

And it is very unlikely that win32 paths (i.e. c:/foo/bar) will ever
work.  Cygwin and GDB exist to emulate a posix environment, which
specifically means no win32 paths.

Note that gdb now has commands to help in this situation, to allow
substituting parts of filename paths:

set substitute-path
unset substitute-path
show substitute-path
  Manage a list of substitution rules that GDB uses to rewrite the name
  of the directories where the sources are located. This can be useful
  for instance when the sources were moved to a different location
  between compilation and debugging.

These were added around 2006-08-09, which means you'll have to use 6.6
or a current CVS version of gdb, since the one packaged is a CVS
snapshot from 2006-07-06.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]