From: Andrew Burgess <andrew.burgess@embecosm.com>
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 [thread overview]
Message-ID: <cover.1620248278.git.andrew.burgess@embecosm.com> (raw)
In-Reply-To: <87bl9pq9li.fsf@tromey.com>
* Tom Tromey <tom@tromey.com> [2021-05-05 13:11:37 -0600]:
> >>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> 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<char> 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
next prev parent reply other threads:[~2021-05-05 21:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-05 17:40 [PATCH] " Andrew Burgess
2021-05-05 19:11 ` Tom Tromey
2021-05-05 21:01 ` Andrew Burgess [this message]
2021-05-05 21:01 ` [PATCHv2 1/2] " Andrew Burgess
2021-05-06 2:23 ` Simon Marchi via Gdb-patches
2021-05-07 10:29 ` Andrew Burgess
2021-05-07 14:55 ` Simon Marchi via Gdb-patches
2021-05-07 21:23 ` Andrew Burgess
2021-05-05 21:01 ` [PATCHv2 2/2] gdb/guile: Have gdbscm_safe_source_script return a unique_ptr Andrew Burgess
2021-05-06 2:28 ` Simon Marchi via Gdb-patches
2021-05-06 2:32 ` Simon Marchi via Gdb-patches
2021-05-07 8:55 ` Andrew Burgess
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=cover.1620248278.git.andrew.burgess@embecosm.com \
--to=andrew.burgess@embecosm.com \
--cc=gdb-patches@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