This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
RE: GDB/Cygwin source path problem fix suggestion
- From: Kristian Otnes <kristian dot otnes at tevero dot no>
- To: gdb at sources dot redhat dot com
- Date: Sun, 28 Sep 2003 10:59:06 +0200
- Subject: RE: GDB/Cygwin source path problem fix suggestion
Eh, I guess one should use MAX_PATH + 1, so the fix would be:
/* Start recording information about source code that came from an
included (or otherwise merged-in) source file with a different
name. NAME is the name of the file (cannot be NULL), DIRNAME is
the directory in which it resides (or NULL if not known). */
/* START FIX by Kristian Otnes, 2003-09-28, see details below */
#ifdef __CYGWIN__
#include <windows.h> /* For MAX_PATH... */
#include <sys/cygwin.h> /* For cygwin_conv_to_... */
#endif
/* END FIX by Kristian Otnes, 2003-09-28 */
void
start_subfile (char *name, char *dirname)
{
struct subfile *subfile;
/* START FIX by Kristian Otnes, 2003-09-28 */
/* In case the symbol info contained Windows type paths (c:\...) we */
/* should convert to Posix style path. Otherwise there might be */
/* problems later with opening source files in the debugger. */
#ifdef __CYGWIN__
char *_dirname;
char *_name;
/* 'name' will typically not be a full path, but it doesn't hurt to */
/* convert it to Posix style... */
if (name)
{
_name = alloca(MAX_PATH + 1);
cygwin_conv_to_posix_path(name, _name);
name = _name;
}
if (dirname)
{
_dirname = alloca(MAX_PATH + 1);
cygwin_conv_to_posix_path(dirname, _dirname);
dirname = _dirname;
}
#endif
/* END FIX by Kristian Otnes, 2003-09-28 */
/* See if this subfile is already known as a subfile of the current
main source file. */