This is the mail archive of the gdb@sourceware.org mailing list for the GDB 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: Why gdb 6.5 prints fullname in /cygdrive/... format om Windows?


Nikolay Molchanov wrote:
Eli,

Date: Tue, 08 Aug 2006 12:20:36 -0700
From: Nikolay Molchanov <Nikolay.Molchanov@Sun.COM>
Cc: gdb@sourceware.org

Eli, the executable is built by Cygwin gcc,, but I don't know how to
find out the file name and the compilation directory actually recorded
in the debug info of the executable. Which command prints this info?

One way that should work is "strings -a foo.exe". You should see the
name of each of your source files (either with or without a leading
directory) and right after each file name the directory which was the
current when you compiled that file. Please show both the file names
and the directories that follow them.


Yes, it prints the directory with /cygdrive/:

bash-3.1$ strings -a t1-g.exe | grep t1
t1.c
/cygdrive/c/users/nik/t1/



And the main problem with file names in Cygwin format is that Java
does not understand such names, so we have to translate them to
Windows format, which is not a trivial task in general case, because
there could be many mounted filesystems, like "/tmp/...",
"/usr/include/..."
and so on.

In general, if you want to avoid such problems, you should be using a
coherent set of tools. Which in practice means that a Cygwin build
of GDB should be used with Cygwin front ends and other programs. If
your front end cannot be built with Cygwin, you might consider using
the MinGW GCC and GDB instead, which are native Windows executables
and understand Windows-style d:/foo file names.


Yes, we will try to support these compilers as well in future, but our primary
target is to provide a free open source IDE for java and C/C++ developers,
and this IDE shall work with Cygwin compilers on Windows, and with many
other compilers on Linux, Windows and Solaris. This IDE is based on Netbeans
(http://netbeans.org), which is a Java application, and it is very inconvenient to
translate file names from Cygwin format to Windows format in Java code.
For gdb it takes a few microseconds to translate a file name. We have to
spend 250-400 milliseconds to execute external binary "cygpath -m ..."
and to get translated name from its output. We can try to cache the
directory names, but it is not correct in general case because mount
points can be changed, and there is no way to notice such change
from Java application. So, if it is possible to provide an option to
print fullname in Windows format, we will very much appreciate it.



Hummm, how about?:
You could avoid the external executable loading time everytime you want to convert a path, by keeping one "cygpath -m -f -" loaded, and feeding it the pathnames to stdin / getting result from stdout.


Cheers,
Pedro Alves


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