Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Pedro Alves <pedro@codesourcery.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 17:45:00 -0000	[thread overview]
Message-ID: <CADPb22S3C-42qmyYKhovv_vppZbhMwTd-jcijRe1vwNAoPur8Q@mail.gmail.com> (raw)
In-Reply-To: <201109221454.41805.pedro@codesourcery.com>

On Thu, Sep 22, 2011 at 6:54 AM, Pedro Alves <pedro@codesourcery.com> wrote:
> 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.

/me wishes all existing uses got cleaned up - monkey see monkey do ...

> Any special reason `-f "maint bah foo" -t "info bar"' is forbidden?

Couldn't think of a use for it.
Support can be added later if/when warranted.

> 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").

I like being restrictive in error catching, at least in the early stages.

btw, if the gdb has python one could wrap it and catch alias failure.

Not that this helps people with older gdb's,
but maybe cli should have its own "try" command
(or we could just require python for such things).

> 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.

Oversight, thanks.

Now I just need a doc RFA.


  reply	other threads:[~2011-09-22 17:35 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
2011-09-22 17:45                 ` Doug Evans [this message]
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=CADPb22S3C-42qmyYKhovv_vppZbhMwTd-jcijRe1vwNAoPur8Q@mail.gmail.com \
    --to=dje@google.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.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