 gdb/linespec.c |    3 ++-
 gdb/main.c     |   25 ++++++++++++++++++++++++-
 gdb/source.c   |    8 +++++++-
 gdb/stack.c    |   13 ++++++++++---
 gdb/utils.c    |   32 ++++++++++++++++++++++++++++++++
 5 files changed, 75 insertions(+), 6 deletions(-)

diff --git a/gdb/linespec.c b/gdb/linespec.c
index 137ef9c..b7e925e 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -1219,7 +1219,8 @@ locate_first_half (char **argptr, int *is_quote_enclosed)
 	 quotes we do not break on enclosed spaces.  */
       if (!*p
 	  || p[0] == '\t'
-	  || (p[0] == ':')
+      || ((p[0] == ':')
+          && ((p[1] == ':') || (strchr (p + 1, ':') == NULL)))
 	  || ((p[0] == ' ') && !*is_quote_enclosed))
 	break;
       if (p[0] == '.' && strchr (p, ':') == NULL)
diff --git a/gdb/main.c b/gdb/main.c
index 187c690..2fd6604 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -44,6 +44,10 @@
 #include "python/python.h"
 #include "objfiles.h"
 
+#ifdef _WIN32
+extern int get_app_fullpath(char *location, int length);
+#endif
+
 /* The selected interpreter.  This will be used as a set command
    variable, so it should always be malloc'ed - since
    do_setshow_command will free it.  */
@@ -350,8 +354,27 @@ captured_main (void *data)
   debug_file_directory = relocate_gdb_directory (DEBUGDIR,
 						 DEBUGDIR_RELOCATABLE);
 
+
+#ifdef _WIN32
+  {
+    char location[500];
+    int len= get_app_fullpath(location, sizeof (location));
+    if (len == 0 || len > 500 - 1)
+      gdb_datadir = relocate_gdb_directory (GDB_DATADIR,GDB_DATADIR_RELOCATABLE);
+    else
+    {
+        char *p_slash =strrchr(location,'\\');
+        *p_slash = '\000';
+        p_slash =strrchr(location,'\\'); /* remove the bin folder*/
+        *p_slash = '\000';   
+        strcat(location,"\\share\\gdb");
+        gdb_datadir = xstrdup (location);
+    }
+  } 
+#else
   gdb_datadir = relocate_gdb_directory (GDB_DATADIR,
-					GDB_DATADIR_RELOCATABLE);
+					GDB_DATADIR_RELOCATABLE);   
+#endif
 
 #ifdef WITH_PYTHON_PATH
   {
diff --git a/gdb/source.c b/gdb/source.c
index d01dff4..15ae89e 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -1002,6 +1002,7 @@ find_and_open_source (const char *filename,
   char *path = source_path;
   const char *p;
   int result;
+  char *lpath;
 
   /* Quick way out if we already know its full name.  */
 
@@ -1020,7 +1021,12 @@ find_and_open_source (const char *filename,
 
       result = open (*fullname, OPEN_MODE);
       if (result >= 0)
-	return result;
+      {
+        lpath = gdb_realpath(*fullname);
+        xfree(*fullname);
+        *fullname = lpath;
+        return result;
+      }
       /* Didn't work -- free old one, try again.  */
       xfree (*fullname);
       *fullname = NULL;
diff --git a/gdb/stack.c b/gdb/stack.c
index 4e050fc..771347b 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -780,14 +780,21 @@ print_frame (struct frame_info *frame, int print_level,
   ui_out_text (uiout, ")");
   if (sal.symtab && sal.symtab->filename)
     {
+	  const char *fullname;
       annotate_frame_source_begin ();
       ui_out_wrap_hint (uiout, "   ");
       ui_out_text (uiout, " at ");
       annotate_frame_source_file ();
-      ui_out_field_string (uiout, "file", sal.symtab->filename);
-      if (ui_out_is_mi_like_p (uiout))
+      
+
+	fullname = symtab_to_fullname (sal.symtab);
+        if (fullname != NULL)
+           ui_out_field_string (uiout, "file", fullname);
+        else
+           ui_out_field_string (uiout, "file", sal.symtab->filename);
+        
+        if (ui_out_is_mi_like_p (uiout))
 	{
-	  const char *fullname = symtab_to_fullname (sal.symtab);
 
 	  if (fullname != NULL)
 	    ui_out_field_string (uiout, "fullname", fullname);
diff --git a/gdb/utils.c b/gdb/utils.c
index 13e99b4..1b78b4b 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -3302,6 +3302,30 @@ gdb_realpath (const char *filename)
   }
 #endif
 
+  /* The MS Windows method.  If we don't have realpath, we assume we
+     don't have symlinks and just canonicalize to a Windows absolute
+     path.  GetFullPath converts ../ and ./ in relative paths to
+     absolute paths, filling in current drive if one is not given
+     or using the current directory of a specified drive (eg, "E:foo").
+     It also converts all forward slashes to back slashes.  */
+#if defined (_WIN32)
+  {
+    char buf[MAX_PATH];
+    char* basename;
+    DWORD len = GetFullPathName (filename, MAX_PATH, buf, &basename);
+    if (len == 0 || len > MAX_PATH - 1)
+      return xstrdup (filename);
+    else
+      {
+    /* The file system is case-preserving but case-insensitive,
+       Canonicalize to lowercase, using the codepage associated
+       with the process locale.  */
+        CharLowerBuff (buf, len);
+        return xstrdup (buf);
+      }
+  }
+#endif
+
   /* This system is a lost cause, just dup the buffer.  */
   return xstrdup (filename);
 }
@@ -3683,3 +3707,11 @@ _initialize_utils (void)
   add_internal_problem_command (&internal_error_problem);
   add_internal_problem_command (&internal_warning_problem);
 }
+
+#ifdef _WIN32
+int get_app_fullpath(char *location, int length)
+{
+    int len = GetModuleFileName(0, location, length);
+    return len;
+}
+#endif
