From: Pedro Alves <pedro@codesourcery.com>
To: Doug Evans <dje@google.com>
Cc: Eli Zaretskii <eliz@gnu.org>, "gdb-patches" <gdb-patches@sourceware.org>
Subject: Re: [RFA, doc RFA] Add gdb.add_command_alias
Date: Thu, 22 Sep 2011 14:08:00 -0000 [thread overview]
Message-ID: <201109221454.41805.pedro@codesourcery.com> (raw)
In-Reply-To: <CADPb22SVb=CB4O--VttPknOHu56vSKFNzeMeUY4tMO1=CvqSJQ@mail.gmail.com>
Thanks!
On Wednesday 21 September 2011 22:12:11, Doug Evans wrote:
> + make_cleanup ((make_cleanup_ftype *) dyn_string_delete, from_prefix);
> + to_prefix = dyn_string_new (10);
> + make_cleanup ((make_cleanup_ftype *) dyn_string_delete, to_prefix);
Please don't add more casts to make_cleanup_ftype.
/* NOTE: cagney/2000-03-04: This typedef is strictly for the
make_cleanup function declarations below. Do not use this typedef
as a cast when passing functions into the make_cleanup() code.
Instead either use a bounce function or add a wrapper function.
Calling a f(char*) function with f(void*) is non-portable. */
typedef void (make_cleanup_ftype) (void *);
Any special reason `-f "maint bah foo" -t "info bar"' is forbidden?
I was thinking that we'd only verify whether "info" exists. But maybe
that shouldn't either be verified. Having aliases not erroring out if the
destination doesn't exist allows one putting aliases in .gdbinit
without worrying if the gdb that'll load has FROM already (it may be
too old, but not old enough to not support "alias").
It's fine with me to put this in as in. I'll try to change this
at some point if I feel so inclined. I realize the alias mechanism
as is today does not even create the alias if the FROM does not
exist. So this branch ...
> + if (to_argv[1] == NULL)
> + {
> + /* add_cmd requires we allocate space for name, hence the xstrdup. */
> + add_com_alias (xstrdup (to_argv[0]), from, class_alias, abbrev_flag);
> + }
is silent if FROM does not exist, though the other branch errors out.
Just pointing it out -- not sure it was on purpose.
With the make_cleahup_ftype thing fixed, this is fine with me.
Thanks again!
--
Pedro Alves
next prev parent reply other threads:[~2011-09-22 13:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-09 19:25 Doug Evans
2011-09-09 21:15 ` Eli Zaretskii
2011-09-13 17:40 ` Doug Evans
2011-09-13 17:47 ` Pedro Alves
2011-09-13 19:15 ` Doug Evans
2011-09-13 19:32 ` Pedro Alves
2011-09-13 21:42 ` Doug Evans
2011-09-21 21:46 ` Doug Evans
2011-09-22 14:08 ` Pedro Alves [this message]
2011-09-22 17:45 ` Doug Evans
2011-09-22 18:13 ` Eli Zaretskii
2011-09-22 21:48 ` Doug Evans
2011-09-23 11:40 ` Eli Zaretskii
2011-09-13 18:49 ` Pedro Alves
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=201109221454.41805.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=dje@google.com \
--cc=eliz@gnu.org \
--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