www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/03/07/10:50:02

X-Spam-Check-By: sourceware.org
Message-ID: <45EEDE85.2C2CED5C@dessent.net>
Date: Wed, 07 Mar 2007 07:47:17 -0800
From: Brian Dessent <brian AT dessent DOT net>
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>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019