public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Tom Tromey <tom@tromey.com>,
	Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [RFC 0/3] [gdb/testsuite] Introduce is_x86_64_m64_target
Date: Thu, 26 Jan 2023 10:30:54 +0100	[thread overview]
Message-ID: <3b85f763-dcc0-7430-423e-e90f636884ce@suse.de> (raw)
In-Reply-To: <87v8kutiej.fsf@tromey.com>

On 1/25/23 22:26, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Tom> I used a refactoring setup I wrote in python for another refactoring to
> Tom> rewrite:
> Tom> ...
> Tom> if { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
> Tom>     verbose "Skipping ${testfile}."
> Tom>     return
> Tom> }
> Tom> ...
> Tom> into:
> Tom> ...
> Tom> require is_x86_64_m64_target
> Tom> ...
> 
> Tom> It also handles the elseif case.
> 
> Tom> Due to a recent commit, only the elseif cases are transformed, the others
> Tom> have been handled already.
> 
> If you want the existing requires could be converted to use the new
> proc.  Seems a little simpler.
> 

Done.

> I sent a comment to one patch but otherwise this looks good to me.
> Thanks for doing it.
> 
> FWIW I also have some refactoring scripts, but mine are
> idiosyncratically written in emacs lisp, which is convenient in some
> ways (easier to do multi-line edits, and back in the day I could have
> them make ChangeLog entries) but worse in others (slow).

I see.  I love to use emacs, but I'm not familiar with lisp, so that's 
not an option for me :)

Anyway, I don't think that the refactoring scripts I've posted here are 
ready for contribution, but ideally I'd love to have some refactoring 
tool commonly used, with the idea that it would enable not only posting 
the result of the transformation, put also the transformation itself, 
and you could get feedback on the transformation, people could try it 
out themselves, find cases they think could be handled in addition, post 
improved versions.  And something in python seems not a bad choice, 
considering the popularity of it.

FWIW, I've started out with the idea of using cocinelle for some gdb 
source transformation, but pretty soon found out that c++ support is 
missing/poor, so I abandoned that idea.

Thanks,
- Tom

      reply	other threads:[~2023-01-26  9:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-25 20:06 Tom de Vries
2023-01-25 20:06 ` [RFC 1/3] [gdb/contrib] Add refactor.py Tom de Vries
2023-01-25 20:06 ` [RFC 2/3] [gdb/contrib] Add refactor_require.py Tom de Vries
2023-01-25 20:06 ` [RFC 3/3] [gdb/testsuite] Add and use is_x86_64_m64_target Tom de Vries
2023-01-25 21:25   ` Tom Tromey
2023-01-26  9:17     ` [pushed] " Tom de Vries
2023-01-26 15:48       ` Tom de Vries
2023-01-26 16:10         ` Tom Tromey
2023-01-26 16:36           ` Tom de Vries
2023-01-26 16:38           ` Pedro Alves
2023-01-26 17:08             ` Tom de Vries
2023-01-26 18:25               ` Tom Tromey
2023-01-26 18:34               ` Pedro Alves
2023-01-25 21:26 ` [RFC 0/3] [gdb/testsuite] Introduce is_x86_64_m64_target Tom Tromey
2023-01-26  9:30   ` Tom de Vries [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=3b85f763-dcc0-7430-423e-e90f636884ce@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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).