[PATCH 3/7] Handle Windows drives in rbreak paths

Hannes Domani
2020-05-25T18:57:35Z

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-05-25 Hannes Domani <ssbssa@yahoo.de>

* symtab.c (rbreak_command): Ignore Windows drive colon.
---
gdb/symtab.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/gdb/symtab.c b/gdb/symtab.c
index dc771c5679..d399ccef9b 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -5210,6 +5210,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.26.2