X-Spam-Check-By: sourceware.org Message-ID: <45EEDE85.2C2CED5C@dessent.net> Date: Wed, 07 Mar 2007 07:47:17 -0800 From: Brian Dessent X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: managing breakpoints in gdb References: <1d9535c10703070346v3d26bdf2md325e27bd5263e14 AT mail DOT gmail DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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/