public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] gdb: Rework command completion on 'tui reg'.
Date: Tue, 09 Jun 2015 16:45:00 -0000	[thread overview]
Message-ID: <5577180E.8030309@redhat.com> (raw)
In-Reply-To: <20150602101111.GO17330@embecosm.com>

On 06/02/2015 11:11 AM, Andrew Burgess wrote:
> Thanks for the review.  I've reworked the patch to address all the
> issues raised.  Here's the new version.
> 

Thanks.  Sorry for the delay, I was away last week.

This version looks fine apart from a couple details.  Go ahead
and push with these fixed.

> gdb/ChangeLog:
> 
> 	* completer.c Add arch-utils.h include.

Missing colon.


> -/* Complete on a register or reggroup.  */
> +/* Bit-flags for selecting what the register and/or register-group
> +   completer should complete on.  */
>  
> -VEC (char_ptr) *
> -reg_or_group_completer (struct cmd_list_element *ignore,
> -			const char *text, const char *word)
> +enum reg_completer_targets
> +  {
> +    complete_register_names = 0x1,
> +    complete_reggroup_names = 0x2
> +  };
> +
> +/* Complete on a register names (when WITH_REGISTERS is true) and/or
> +   reggroup names (when WITH_REGGROUPS) is true.  One, or both of
> +   WITH_REGISTERS and WITH_REGGROUPS must be true.  */

The comment is stale wrt to the bit flags.

> +
> +static VEC (char_ptr) *
> +reg_or_group_completer_1 (struct cmd_list_element *ignore,
> +			  const char *text, const char *word,
> +			  enum reg_completer_targets targets)
>  {
>    VEC (char_ptr) *result = NULL;
>    size_t len = strlen (word);
>    struct gdbarch *gdbarch;
> -  struct reggroup *group;
>    const char *name;
> -  int i;
>  
>    if (!target_has_registers)
>      return result;

Unless I'm missing something, I think you need to remove
this check, otherwise completion doesn't really work when there's
no running program yet.

>  
> -  gdbarch = get_frame_arch (get_selected_frame (NULL));
> +  gdb_assert ((targets & (complete_register_names
> +			  | complete_reggroup_names)) != 0);
> +  gdbarch = get_current_arch ();
>  

> +following groups are avaiable on most targets:

typo "available".

Thanks,
Pedro Alves

      parent reply	other threads:[~2015-06-09 16:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-21 22:17 [PATCH 0/2] Improvements to 'tui reg' command Andrew Burgess
2015-05-21 22:17 ` [PATCH 1/2] gdb: Add 'tui reg prev' command Andrew Burgess
2015-05-22  1:06   ` Pedro Alves
2015-05-22 16:37     ` Andrew Burgess
2015-05-22 17:06       ` Pedro Alves
2015-05-22  7:15   ` Eli Zaretskii
2015-05-21 22:17 ` [PATCH 2/2] gdb: Rework command completion on 'tui reg' Andrew Burgess
2015-05-23 13:18   ` Pedro Alves
2015-06-02 10:11     ` Andrew Burgess
2015-06-02 15:01       ` Eli Zaretskii
2015-06-09 16:45       ` Pedro Alves [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=5577180E.8030309@redhat.com \
    --to=palves@redhat.com \
    --cc=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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).