Index: gdb/source.c
===================================================================
RCS file: /cvs/src/src/gdb/source.c,v
retrieving revision 1.83
diff -u -p -r1.83 source.c
--- gdb/source.c	1 Jan 2008 22:53:13 -0000	1.83
+++ gdb/source.c	9 Jan 2008 16:09:40 -0000
@@ -895,7 +895,7 @@ get_substitute_path_rule (const char *pa
    Return NULL if no substitution rule was specified by the user,
    or if no rule applied to the given PATH.  */
    
-static char *
+char *
 rewrite_source_path (const char *path)
 {
   const struct substitute_path_rule *rule = get_substitute_path_rule (path);
Index: gdb/source.h
===================================================================
RCS file: /cvs/src/src/gdb/source.h,v
retrieving revision 1.9
diff -u -p -r1.9 source.h
--- gdb/source.h	1 Jan 2008 22:53:13 -0000	1.9
+++ gdb/source.h	9 Jan 2008 16:09:40 -0000
@@ -20,6 +20,7 @@
 #define SOURCE_H
 
 struct symtab;
+struct partial_symtab;
 
 /* Open a source file given a symtab S.  Returns a file descriptor or
    negative number for error.  */
@@ -66,4 +67,7 @@ extern struct symtab_and_line set_curren
 
 /* Reset any information stored about a default file and line to print. */
 extern void clear_current_source_symtab_and_line (void);
+
+extern char *rewrite_source_path (const char *path);
+
 #endif
Index: gdb/utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.184
diff -u -p -r1.184 utils.c
--- gdb/utils.c	1 Jan 2008 22:53:13 -0000	1.184
+++ gdb/utils.c	9 Jan 2008 16:09:40 -0000
@@ -34,6 +34,8 @@
 #include <pc.h>
 #endif
 
+#include "source.h"
+
 /* SunOS's curses.h has a '#define reg register' in it.  Thank you Sun. */
 #ifdef reg
 #undef reg
@@ -3223,3 +3225,21 @@ ldirname (const char *filename)
   dirname[base - filename] = '\0';
   return dirname;
 }
+
+int
+is_absolute_path (const char *path)
+{
+  char *rwpath = rewrite_source_path (path);
+
+  if (rwpath == NULL)
+    rwpath = (char *) path;
+  else
+    make_cleanup (xfree, rwpath);
+
+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+  return IS_ABSOLUTE_PATH_DOS (rwpath);
+#else
+  return IS_ABSOLUTE_PATH_POSIX (rwpath);
+#endif
+
+}
Index: include/filenames.h
===================================================================
RCS file: /cvs/src/src/include/filenames.h,v
retrieving revision 1.4
diff -u -p -r1.4 filenames.h
--- include/filenames.h	29 Mar 2007 21:03:43 -0000	1.4
+++ include/filenames.h	9 Jan 2008 16:09:41 -0000
@@ -26,6 +26,22 @@ Foundation, Inc., 51 Franklin Street - F
 #ifndef FILENAMES_H
 #define FILENAMES_H
 
+/* For DOS style paths.  */
+
+#define IS_DIR_SEPARATOR_DOS(c)	  ((c) == '/' || (c) == '\\')
+
+/*Note that IS_ABSOLUTE_PATH_DOS macro does not recognize
+  path starting with '/' as an absolute path. Otherwise, it behaves
+  as IS_DIR_SEPARATOR macro when configured for DOS-like
+  file system (see comment for IS_ABSOLUTE_PATH below).  */
+
+#define IS_ABSOLUTE_PATH_DOS(f)	  (IS_DIR_SEPARATOR_DOS((f)[0]) || (((f)[0]) && ((f)[1] == ':')))
+
+/* For POSIX style paths.  */
+
+#define IS_DIR_SEPARATOR_POSIX(c)	  ((c) == '/')
+#define IS_ABSOLUTE_PATH_POSIX(f)	  (IS_DIR_SEPARATOR_POSIX((f)[0]))
+
 #if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) || defined (__CYGWIN__)
 
 #ifndef HAVE_DOS_BASED_FILE_SYSTEM
@@ -37,16 +53,19 @@ Foundation, Inc., 51 Franklin Street - F
    only semi-absolute.  This is because the users of IS_ABSOLUTE_PATH
    want to know whether to prepend the current working directory to
    a file name, which should not be done with a name like d:foo.  */
-#define IS_ABSOLUTE_PATH(f)	(IS_DIR_SEPARATOR((f)[0]) || (((f)[0]) && ((f)[1] == ':')))
+//#define IS_ABSOLUTE_PATH(f)	(IS_DIR_SEPARATOR((f)[0]) || (((f)[0]) && ((f)[1] == ':')))
 
 #else  /* not DOSish */
 
 #define IS_DIR_SEPARATOR(c)	((c) == '/')
-#define IS_ABSOLUTE_PATH(f)	(IS_DIR_SEPARATOR((f)[0]))
+// #define IS_ABSOLUTE_PATH(f)	(IS_DIR_SEPARATOR((f)[0]))
+extern int is_absolute_path (const char *path);
 
 #endif /* not DOSish */
 
 extern int filename_cmp (const char *s1, const char *s2);
 #define FILENAME_CMP(s1, s2)	filename_cmp(s1, s2)
 
+extern int is_absolute_path (const char *path);
+#define IS_ABSOLUTE_PATH(f) is_absolute_path(f)
 #endif /* FILENAMES_H */
