From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id F303B3858D3C for ; Thu, 5 Oct 2023 23:12:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F303B3858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-691c05bc5aaso1364371b3a.2 for ; Thu, 05 Oct 2023 16:12:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696547542; x=1697152342; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references:from:to:cc:subject:date :message-id:reply-to; bh=nl5GyVyvJVw+B7wtdux9mLvHpZetLnSSlCss05byNX4=; b=k4MJqDodM02O2xW9g6YwBr8oT9yXJSfIrYiRf6zonfOrXrM02rUk5tLQnSGlex1cpT A1NXeEK52R322Ip+Nxe30WGTwuOUQz6SurK9soPdYV3HYsIwXKNEVfrWBdZuOnx/ck2P B3nbFpRCwRHTaalkiDSXOvZDuVKHL1EsDutiJqy9T+UZH8LvPgg/CZjKg6Lu0sM4vBzc RRbRC/VfyC/QG5PASgaG6CPW0mOgm9uSSX4gUzWTP3ZsWYBiRGvqL09r/cEZ/PsWjQtX mEf7oam3diOYxMr0SC80bfshY1RlCtodRQDrq6IWxjZII6cW1YUAktmbW8Nd5506WMXi nvUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696547542; x=1697152342; h=content-transfer-encoding:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=nl5GyVyvJVw+B7wtdux9mLvHpZetLnSSlCss05byNX4=; b=kwuberbSRrrt/kSfwu8eUbcavIlJh99M2m0hhm6GixdJGsDXuO9XdFo3ZcrWlPrRbe kti9NZBRYi9xwdCO7vUv50apu23NZzPpEpoEVwCBZr1HDRRlGqblkUYxZx8D5pHVP+Zl H6KI3gb2klZU9iwLS5u5McyukchFnN+nc3rxwWTxvPxBnwEXM+zOWjmSp9UhqQA0lkjg UrtnkwMr6jw2zrbFx/Dnd07PuAIZvbf2Hfir07Td/Grfk14EEKWzRG87uswjbc/jE5EV f9XjkX1CFoKigXb71JaXi2oPiOX9C299rEeMq/3f21N4qdC+ealnDyET6sHcahn/03AQ xWHw== X-Gm-Message-State: AOJu0YxRZ7RVYgKyc8qhL6n/5DoU69zYrn9692c46Sk3G1mfsIJ0O+yQ 5khaJoms1e1SE4uCHCipoGwSQA== X-Google-Smtp-Source: AGHT+IF23AxGnSIACoi7GOkIuAHXK5Pn1ZkAR0po7BwaQ1C39DsPrdqMuLOBauOtpDpDGrPtqThyDQ== X-Received: by 2002:a05:6a21:181:b0:13a:6bca:7a84 with SMTP id le1-20020a056a21018100b0013a6bca7a84mr8086091pzb.44.1696547541489; Thu, 05 Oct 2023 16:12:21 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8470:3b93:cf48:8e35:427b]) by smtp.gmail.com with ESMTPSA id du6-20020a056a002b4600b0068fe76cdc62sm126414pfb.93.2023.10.05.16.12.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 16:12:20 -0700 (PDT) References: <20231004183102.61669-1-thiago.bauermann@linaro.org> <831qe964lt.fsf@gnu.org> User-agent: mu4e 1.10.7; emacs 29.1 From: Thiago Jung Bauermann To: Eli Zaretskii Cc: gdb-patches@sourceware.org, tom@tromey.com Subject: Re: [PATCH v2] gdb/configure.ac: Add option --with-additional-debug-dirs In-reply-to: <831qe964lt.fsf@gnu.org> Date: Thu, 05 Oct 2023 20:12:17 -0300 Message-ID: <87y1ggll4e.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Eli Zaretskii writes: >> Cc: Tom Tromey >> Date: Wed, 4 Oct 2023 15:31:02 -0300 >> From: Thiago Jung Bauermann via Gdb-patches >>=20 >> If you want to install GDB in a custom prefix, have it look for debug in= fo >> in that prefix but also in the distro's default location (typically, >> /usr/lib/debug) and run the GDB testsuite before doing "make install", y= ou >> have a bit of a problem: >>=20 >> Configuring GDB with '--prefix=3D$PREFIX' sets the GDB 'debug-file-direc= tory' >> parameter to $PREFIX/lib/debug. Unfortunately this precludes GDB from >> looking for distro-installed debug info in /usr/lib/debug. For regular = GDB >> use you could set debug-file-directory to $PREFIX:/usr/lib/debug in >> $PREFIX/etc/gdbinit so that GDB will look in both places, but if you want >> to run the testsuite then that doesn't help because in that case GDB runs >> with the '-nx' option. >>=20 >> There's the configure option '--with-separate-debug-dir' to set the defa= ult >> value for 'debug-file-directory', but it accepts only one directory and = not >> a list. I considered modifying it to accept a list, but it's not obvious >> how to do that because its value is also used by BFD, as well as process= ed >> for "relocatability". >>=20 >> I thought it was simpler to add a new option to specify a list of >> additional directories that will be appended to the debug-file-directory >> setting. > > Thanks, the documentation parts are okay. Thank you! > However, I wonder: on MS-Windows, the "colon-separated list" becomes > "semi-colon separated list", and I have an old and annoying problem > with 2 similar configure-time options, --with-auto-load-safe-path=3D and > --with-auto-load-dir=3D, which fail to communicate semi-colon separated > lists to gdb/configure, and require me to manually edit gdb/config.h > and rebuild. So I wonder whether this new option will have the same > problem, and whether we could perhaps take this opportunity for fixing > this? > > This is https://sourceware.org/bugzilla/show_bug.cgi?id=3D18898, btw. I looked a bit into this, and I don't see an easy solution. The problem is that shell scripting language is notoriously bad at keeping data from leaking into the code. If I do: $ ~/src/binutils-gdb/configure \ --disable-{binutils,ld,gold,gas,sim,gprof,gprofng} \ --with-auto-load-dir=3D'foo;bar' && make I get: checking for default auto-load directory... /home/bauermann/src/binutils-gd= b/gdb/configure: line 18004: bar: command not found foo;bar checking for default auto-load safe-path... /home/bauermann/src/binutils-gd= b/gdb/configure: line 18031: bar: command not found foo;bar Line 18004 is: ac_define_dir=3D`eval echo $escape_dir` Line 18031 is identical. If the configure script could use bash features instead of having to assume a POSIX shell, we could use "printf %q" to escape the input. Is there an equivalent solution that's in POSIX shell? In any case, any solution would be in an autoconf macro, not in GDB. As a workaround, I was able to get away with some escaping: $ ~/src/binutils-gdb/configure \ --disable-{binutils,ld,gold,gas,sim,gprof,gprofng} \ --with-auto-load-dir=3D'foo\\\;bar\\\;baz' && make =E2=8B=AE checking for default auto-load directory... foo\\\;bar\\\;baz checking for default auto-load safe-path... foo\\\;bar\\\;baz =E2=8B=AE $ grep AUTO_LOAD gdb/config.h #define AUTO_LOAD_DIR "foo;bar;baz" #define AUTO_LOAD_SAFE_PATH "foo;bar;baz" > Reviewed-By: Eli Zaretskii --=20 Thiago