This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 2/2] [GDB] Add trailing dash on triplet regexp
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: GDB Patches <gdb-patches at sourceware dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Tom Tromey <tom at tromey dot com>, Keith Seitz <keiths at redhat dot com>, Phil Muldoon <pmuldoon at redhat dot com>, Alexandre Oliva <aoliva at redhat dot com>
- Date: Wed, 23 Aug 2017 00:18:25 -0400
- Subject: [PATCH 2/2] [GDB] Add trailing dash on triplet regexp
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=sergiodj at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 091977F6BA
- References: <87mv6qhq9u.fsf@redhat.com>
This is the GDB patch.
It is very simple, and just a necessary adjustment needed because of the
modifications made in the "make_regexp" functions on libcc1.
Now, GDB will provide a full regexp for triplet names, including the
trailing dash ("-"). Therefore, we will have a regexp that truly
matches the full triplet (e.g., "^(x86_64|i.86)(-[^-]*)?-linux(-gnu)?-")
instead of one that leaves the trailing "-" match to libcc1.
OK to apply?
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/
gdb/ChangeLog:
2017-08-23 Sergio Durigan Junior <sergiodj@redhat.com>
* compile/compile.c (compile_to_object): Add trailing dash on
triplet regexp.
diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c
index 91e084f89f..0ce77a8b95 100644
--- a/gdb/compile/compile.c
+++ b/gdb/compile/compile.c
@@ -509,7 +509,7 @@ compile_to_object (struct command_line *cmd, const char *cmd_string,
arch_rx = gdbarch_gnu_triplet_regexp (gdbarch);
/* Allow triplets with or without vendor set. */
- triplet_rx = concat (arch_rx, "(-[^-]*)?-", os_rx, (char *) NULL);
+ triplet_rx = concat (arch_rx, "(-[^-]*)?-", os_rx, "-", (char *) NULL);
make_cleanup (xfree, triplet_rx);
/* Set compiler command-line arguments. */