From patchwork Fri Nov 30 22:54:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Baldwin X-Patchwork-Id: 30490 Received: (qmail 117010 invoked by alias); 30 Nov 2018 22:56:59 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 116989 invoked by uid 89); 30 Nov 2018 22:56:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_SOFTFAIL, TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=escaped, HContent-Transfer-Encoding:8bit X-HELO: mail.baldwin.cx Received: from bigwig.baldwin.cx (HELO mail.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Nov 2018 22:56:47 +0000 Received: from ralph.com (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 211EA10B429 for ; Fri, 30 Nov 2018 17:56:45 -0500 (EST) From: John Baldwin To: gdb-patches@sourceware.org Subject: [PATCH] Use sed -E to escape variables in auto-load directories. Date: Fri, 30 Nov 2018 14:54:24 -0800 Message-Id: <20181130225424.13537-1-jhb@FreeBSD.org> MIME-Version: 1.0 X-IsSubscribed: yes Not all sed implementations support alternation via \| in the default regular expressions. However, POSIX ERE available via -E do support these. Switch to using POSIX ERE via -E when generating the escaped versions of the auto-load directories. This fixes the default setting of the auto-load directories on FreeBSD. Previously on FreeBSD the sed invocation was a no-op causing the debugdir and datadir values to be expanded yielding an autoload path of ':${prefix}/share/gdb'. gdb/ChangeLog: * configure: Re-generate. * configure.ac: Use sed -E to escape variables in auto-load directories. --- gdb/ChangeLog | 6 ++++++ gdb/configure | 4 ++-- gdb/configure.ac | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 348eb65ec7..f7b45793b3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2018-11-30 John Baldwin + + * configure: Re-generate. + * configure.ac: Use sed -E to escape variables in auto-load + directories. + 2018-11-30 John Baldwin * fbsd-nat.c [__FreeBSD_version >= 700009] (USE_SIGINFO): Macro diff --git a/gdb/configure b/gdb/configure index 7665ba6531..9e925cd27d 100755 --- a/gdb/configure +++ b/gdb/configure @@ -6579,7 +6579,7 @@ else with_auto_load_dir='$debugdir:$datadir/auto-load' fi -escape_dir=`echo $with_auto_load_dir | sed 's/[$]\(datadir\|debugdir\)\>/\\\\\\\\\\\\&/g'` +escape_dir=`echo $with_auto_load_dir | sed -E 's/[$](datadir|debugdir)\>/\\\\\\\\\\\\&/g'` test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' @@ -6606,7 +6606,7 @@ else with_auto_load_safe_path="$with_auto_load_dir" fi -escape_dir=`echo $with_auto_load_safe_path | sed 's/[$]\(datadir\|debugdir\)\>/\\\\\\\\\\\\&/g'` +escape_dir=`echo $with_auto_load_safe_path | sed -E 's/[$](datadir|debugdir)\>/\\\\\\\\\\\\&/g'` test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' diff --git a/gdb/configure.ac b/gdb/configure.ac index e1ea60660b..4e18f94fed 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -146,7 +146,7 @@ AC_ARG_WITH(auto-load-dir, AS_HELP_STRING([--with-auto-load-dir=PATH], [directories from which to load auto-loaded scripts @<:@$debugdir:$datadir/auto-load@:>@]),, [with_auto_load_dir='$debugdir:$datadir/auto-load']) -escape_dir=`echo $with_auto_load_dir | sed 's/[[$]]\(datadir\|debugdir\)\>/\\\\\\\\\\\\&/g'` +escape_dir=`echo $with_auto_load_dir | sed -E 's/[[$]](datadir|debugdir)\>/\\\\\\\\\\\\&/g'` AC_DEFINE_DIR(AUTO_LOAD_DIR, escape_dir, [Directories from which to load auto-loaded scripts.]) AC_MSG_RESULT([$with_auto_load_dir]) @@ -161,7 +161,7 @@ AS_HELP_STRING([--without-auto-load-safe-path], with_auto_load_safe_path="/" fi], [with_auto_load_safe_path="$with_auto_load_dir"]) -escape_dir=`echo $with_auto_load_safe_path | sed 's/[[$]]\(datadir\|debugdir\)\>/\\\\\\\\\\\\&/g'` +escape_dir=`echo $with_auto_load_safe_path | sed -E 's/[[$]](datadir|debugdir)\>/\\\\\\\\\\\\&/g'` AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir, [Directories safe to hold auto-loaded files.]) AC_MSG_RESULT([$with_auto_load_safe_path])