Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tom@tromey.com>, Simon Marchi <simon.marchi@efficios.com>
Cc: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 2/2] gdb: remove TYPE_NAME macro
Date: Sat, 16 May 2020 15:10:34 -0400	[thread overview]
Message-ID: <84b324b6-480c-1ca4-a6c1-6568b63d7e4a@simark.ca> (raw)
In-Reply-To: <87367z7ng5.fsf@tromey.com>

On 2020-05-16 2:18 p.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
> 
> Simon> No, coccinelle doesn't work on C++ unfortunately.  When there's a C++
> Simon> construct in a function, it just skips it it seems.
> 
> Aha, cool.
> 
> Simon> Also, coccinelle doesn't really allow to specify the output code style,
> Simon> so it just never puts a space before the parenthesis.  I worked around
> Simon> that by making it use `a_very_unique_string` as the function name in its
> Simon> output, so I could easily replace it with the desired value with sed:
> 
> Nice hack.
> 
> FWIW I wrote some Emacs Lisp to do this kind of transform.  However, it
> is mostly ad hoc -- I rewrite bits of it when I need a new change.  I do
> have one that does the "function form to method form".
> 
> The main drawbacks of this are that elisp is pretty slow, and of course
> it's relatively obscure.  One of the big advantages is that I also
> taught it to write the ChangeLog entries... :-)
> 
> https://github.com/tromey/gdb-refactoring-scripts
> 
> For example maybe this one could have been done with
> 
> emacs --script .../rewriter.el method TYPE_NAME name

I'd be curious to run it.  This is what I get, it's probably not expected:

$ emacs --script gdb-refactoring-scripts/rewriter.el method TYPE_NAME name
Loading 00debian-vars...
Loading /etc/emacs/site-start.d/50autoconf.el (source)...
Loading /etc/emacs/site-start.d/50cmake-data.el (source)...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
Loading /etc/emacs/site-start.d/50latex-cjk-common.el (source)...
Loading cjk-enc...
Loading /etc/emacs/site-start.d/50latex-cjk-thai.el (source)...
Loading /etc/emacs/site-start.d/50texlive-lang-english.el (source)...
Loading /home/smarchi/src/binutils-gdb/gdb/gdb-refactoring-scripts/rewriter-method.el (source)...
Symbol's function definition is void: directory-files-recursively

My cwd is gdb's source directory.  Any idea what's going wrong?

Simon


  reply	other threads:[~2020-05-16 19:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14 18:18 [PATCH 1/2] gdb: add type::name / type::set_name Simon Marchi
2020-05-14 18:18 ` [PATCH 2/2] gdb: remove TYPE_NAME macro Simon Marchi
2020-05-16 16:00   ` Tom Tromey
2020-05-16 16:35     ` Simon Marchi
2020-05-16 18:18       ` Tom Tromey
2020-05-16 19:10         ` Simon Marchi [this message]
2020-05-16 19:26           ` Tom Tromey
2020-05-16 19:33             ` Simon Marchi
2020-05-16 15:58 ` [PATCH 1/2] gdb: add type::name / type::set_name Tom Tromey

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=84b324b6-480c-1ca4-a6c1-6568b63d7e4a@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.com \
    --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