public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "thiago.bauermann at linaro dot org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug build/18898] Cannot specify non-default list of directories as argument of --with-auto-load-dir on Windows
Date: Fri, 27 Oct 2023 00:07:44 +0000	[thread overview]
Message-ID: <bug-18898-4717-ot3Ud0M0yF@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-18898-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=18898

Thiago Jung Bauermann <thiago.bauermann at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thiago.bauermann at linaro dot org

--- Comment #2 from Thiago Jung Bauermann <thiago.bauermann at linaro dot org> ---
I looked into this issue a bit more today. Here is my understanding of the
problem:

It happens because the AC_DEFINE_DIR macro calls eval twice on the value
provided via these configure options, causing the ';' to be interpreted by the
shell.  E.g.,

  $ ~/src/binutils-gdb/configure \
      --disable-{binutils,ld,gold,gas,sim,gprof,gprofng} \
      --with-auto-load-dir='foo;bar' && make
      ⋮
  checking for default auto-load directory...
/home/bauermann/src/binutils-gdb/gdb/configure: line 18004: bar: command not
found
  foo;bar
  checking for default auto-load safe-path...
/home/bauermann/src/binutils-gdb/gdb/configure: line 18031: bar: command not
found
  foo;bar

Line 18004 is:

  ac_define_dir=`eval echo $escape_dir`

Line 18031 is identical.

With some escaping, it's possible to avoid the problem:

  $ ~/src/binutils-gdb/configure \
      --disable-{binutils,ld,gold,gas,sim,gprof,gprofng} \
      --with-auto-load-dir='foo\\\;bar\\\;baz' && make
      ⋮
  checking for default auto-load directory... foo\\\;bar\\\;baz
  checking for default auto-load safe-path... foo\\\;bar\\\;baz
      ⋮
  $ grep AUTO_LOAD gdb/config.h
  #define AUTO_LOAD_DIR "foo;bar;baz"
  #define AUTO_LOAD_SAFE_PATH "foo;bar;baz"

We provide the definition of AC_DEFINE_DIR in gdb/acinclude.m4 so the simplest
approach to fix this problem would be to remove the evals from the macro.

I don't know why they are there however, so a more conservative solution is to
make gdb/configure.ac automatically add those escaping characters to the values
of the options if the host OS is Windows.

I just posted a patch doing that:

https://inbox.sourceware.org/gdb-patches/20231026234013.937210-1-thiago.bauermann@linaro.org/

-- 
You are receiving this mail because:
You are on the CC list for the bug.

      parent reply	other threads:[~2023-10-27  0:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-29 12:57 [Bug build/18898] New: " eliz at gnu dot org
2015-08-29 13:06 ` [Bug build/18898] " jan.kratochvil at redhat dot com
2023-10-26 11:55 ` eliz at gnu dot org
2023-10-27  0:07 ` thiago.bauermann at linaro dot org [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-18898-4717-ot3Ud0M0yF@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).