From 2c074f49026acbe0597e0d2d2f7385195dcac565 Mon Sep 17 00:00:00 2001 From: Hannes Domani Date: Wed, 13 May 2020 12:38:54 +0200 Subject: [PATCH] Handle Windows drives in rbreak paths Fixes this testsuite fail on Windows: FAIL: gdb.base/fullpath-expand.exp: rbreak XXX/fullpath-expand-func.c:func If the found colon is actually part of a Windows drive, look for another. gdb/ChangeLog: 2020-06-14 Hannes Domani * symtab.c (rbreak_command): Ignore Windows drive colon. --- gdb/ChangeLog | 4 ++++ gdb/symtab.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3be14fdc30a..133f97103a1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2020-06-14 Hannes Domani + + * symtab.c (rbreak_command): Ignore Windows drive colon. + 2020-06-12 Simon Marchi * NEWS: Mention removed GDBserver host support. diff --git a/gdb/symtab.c b/gdb/symtab.c index 791ce11a737..b255cc72327 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -5196,6 +5196,11 @@ rbreak_command (const char *regexp, int from_tty) { const char *colon = strchr (regexp, ':'); + /* Ignore the colon if it is part of a Windows drive. */ + if (HAS_DRIVE_SPEC (regexp) + && (regexp[2] == '/' || regexp[2] == '\\')) + colon = strchr (STRIP_DRIVE_SPEC (regexp), ':'); + if (colon && *(colon + 1) != ':') { int colon_index; -- 2.30.2