From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id CFCEF385142A for ; Wed, 5 May 2021 21:01:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CFCEF385142A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wr1-x436.google.com with SMTP id z6so3306253wrm.4 for ; Wed, 05 May 2021 14:01:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sdLRP4vpZalE2VCLxq/u10x97jKiR78+BPGH1OLnIp0=; b=hq+982Gkon93lWhO9/YTwErzmvU3XsJvtA/dzAqC1tddVxx364V2UnqXlEzRP8ixh8 Cu6b8lna3REgMSuKMux60LluKMueNuDr0drxO4CstzekhRyl3u3EJzhCZbdEueSVoF2m GNzCajYjQZSUcOm4SrFXXDgALcmkOrzF2w17My7tczox86hB/tvLBCOL0Ujva9KrlV4c Sv9OpAyxMbEgL7TYIHWq+CPGm7u9oIvRBhcWQi2SvvIzhLeGHGGYZC506UOMZ3ti3sFZ OzELvV4ODkdYwKtlh989sYXjzVcfDvliYOthNt7nx7ZjfBfVto0QOr+/Ykxx9ifQv+Jz lqOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sdLRP4vpZalE2VCLxq/u10x97jKiR78+BPGH1OLnIp0=; b=m4smzf4YEGdzPFx81L0VkMxtyYnYq9u2Cc7gBrvGOuIs0zvKTCn6hSByhG8OVdILN4 qD1VGeWSC+Q8G1w2uZVHjBM8qpMNjbPK5JxPtO4OY877vg0l4LYQDA0mkere78mbK1yo +68I4BgWIy6XKlpKFw2G2c86DUS9EIV4KG2BfhGEpRhgZYoz9eMBPV8nm2GwrUooijSU wp8E2zpfIcJUSX8X9IjZ1hT9FQwOS5gXAMv1ugJ2hOftlCv6YXkQEejUC2Gigl3O9awh Ld9PSw4oic19LCFVUHeutMurLpekwsdsDl0bIIrNEU4IaXKeV+34Ulz21tXw2voheBTC S73g== X-Gm-Message-State: AOAM533wq3tLuyj/XQ0VRWIlMJN28hCPJgl/crVW2KMfgSDiA5V3lj+p 3bgSOZHGCM4pTuFx+bETR7GoqO4RyAQkJQ== X-Google-Smtp-Source: ABdhPJzHUaUfEY8Fd4hD4gaH0omVgAEg51GXw5oJXrVfPYI0H87CGDiPXYipRQPTx0OotZwT86giTg== X-Received: by 2002:a05:6000:2c4:: with SMTP id o4mr1011497wry.232.1620248510816; Wed, 05 May 2021 14:01:50 -0700 (PDT) Received: from localhost (host109-151-46-70.range109-151.btcentralplus.com. [109.151.46.70]) by smtp.gmail.com with ESMTPSA id r17sm7153921wmh.25.2021.05.05.14.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 14:01:50 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Subject: [PATCHv2 0/2] gdb/guile: perform tilde expansion when sourcing guile scripts Date: Wed, 5 May 2021 22:01:39 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: <87bl9pq9li.fsf@tromey.com> References: <87bl9pq9li.fsf@tromey.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.0 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 May 2021 21:01:53 -0000 * Tom Tromey [2021-05-05 13:11:37 -0600]: > >>>>> "Andrew" == Andrew Burgess writes: > > Andrew> This is because the path is not tilde expanded. In contrast, when > Andrew> sourcing a .py or .gdb script the path is tilde expanded. > > Andrew> This commit fixes this oversight, and allows the above source command > Andrew> to work as expected. > > It seems a little strange to me that each extension language must do > this, rather than the caller doing it. I believe that this is the right solution though. I have updated the commit message (in patch #1) to better explain why I think this. If you still disagree, just let me know and I'll move the logic. > > Andrew> + gdb::unique_xmalloc_ptr msg > Andrew> + (gdbscm_safe_source_script (full_path.c_str ())); > > I suppose gdbscm_safe_source_script could return a unique_xmalloc_ptr, > and this could just use the '=' form. That would be better, then all of the users would be forced to change (which would be a good thing). I span this out into patch #2. Thanks, Andrew --- Andrew Burgess (2): gdb/guile: perform tilde expansion when sourcing guile scripts gdb/guile: Have gdbscm_safe_source_script return a unique_ptr gdb/ChangeLog | 17 +++++++++++++++++ gdb/guile/guile-internal.h | 3 ++- gdb/guile/guile.c | 7 ++----- gdb/guile/scm-objfile.c | 9 ++------- gdb/guile/scm-safe-call.c | 8 +++++--- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.guile/guile.exp | 7 +++++++ 7 files changed, 39 insertions(+), 16 deletions(-) -- 2.25.4