aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2011-11-11 19:52:46 +0000
committerKeith Seitz <keiths@redhat.com>2011-11-11 19:52:46 +0000
commit731971ed4bd85104dd2ada14a5897d29d063966a (patch)
tree2b6a7ff547b5b77c4809d6c7da59c52483c7dc98
parenta4b5b48aa84a29e515c53eadac5e5558f3bf7f8d (diff)
downloadbinutils-731971ed4bd85104dd2ada14a5897d29d063966a.zip
binutils-731971ed4bd85104dd2ada14a5897d29d063966a.tar.gz
binutils-731971ed4bd85104dd2ada14a5897d29d063966a.tar.bz2
PR gdb/12843
* linespec.c (locate_first_half): Keep ':' if it looks like it could be part of a Windows path starting with a drive letter.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/linespec.c11
2 files changed, 18 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8aaf0dd..b601cbb 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2011-11-11 Keith Seitz <keiths@redhat.com>
+
+ PR gdb/12843
+ * linespec.c (locate_first_half): Keep ':' if it looks
+ like it could be part of a Windows path starting with
+ a drive letter.
+
2011-11-10 Pedro Alves <pedro@codesourcery.com>
* linux-nat.c (linux_nat_wait): Don't force waking up the event
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 37ec368..64ba837 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -43,6 +43,7 @@
#include "arch-utils.h"
#include <ctype.h>
#include "cli/cli-utils.h"
+#include "filenames.h"
/* Prototypes for local functions. */
@@ -1194,6 +1195,16 @@ locate_first_half (char **argptr, int *is_quote_enclosed)
++p;
}
}
+
+
+ /* Check for a drive letter in the filename. This is done on all hosts
+ to capture cross-compilation environments. On Unixen, directory
+ separators are illegal in filenames, so if the user enters "e:/foo.c",
+ he is referring to a directory named "e:" and a source file named
+ "foo.c", and we still want to keep these two pieces together. */
+ if (isalpha (p[0]) && p[1] == ':' && IS_DIR_SEPARATOR (p[2]))
+ p += 3;
+
for (; *p; p++)
{
if (p[0] == '<')