Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Andreas Arnez <arnez@linux.vnet.ibm.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v4 2/2] Provide completer for "info registers"
Date: Fri, 12 Dec 2014 13:20:00 -0000	[thread overview]
Message-ID: <548AEB86.60809@redhat.com> (raw)
In-Reply-To: <1418298589-23120-3-git-send-email-arnez@linux.vnet.ibm.com>

On 12/11/2014 11:49 AM, Andreas Arnez wrote:

> +set regs_output [capture_command_output "mt print registers" \
> +		     ".*Name.*Nr.*Rel.*Offset.*Size.*Type.\[^\n\]*\n"]
> +append regs_output "\n"
> +append regs_output [capture_command_output "mt print reggroups" \
> +			".*Group.*Type\[^\n]*\n"]
> +set all_regs {}
> +foreach {-> reg} [regexp -all -inline -line {^\s+(\w+\S*)} $regs_output] {

This "->" here confused me a little.  AFAIK, $- is a more common "don't care"
variable (and what foreach's documentation suggests).  Any reason to
pick -> instead?

Also, why do we need the "\S*" ?  I'd assume {^\s+(\w+)} works just as well.

> +    lappend all_regs $reg
> +}
> +
> +set regs_output [capture_command_output "mt print user-registers" \
> +		     ".*Nr.*Name\[^\n]*\n"]
> +foreach {-> reg} [regexp -all -inline -line {\d+\s+(\w+\S*)} $regs_output] {

Likewise.

Otherwise this looks good to me.

Thanks,
Pedro Alves


  reply	other threads:[~2014-12-12 13:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-11 11:49 [PATCH v4 0/2] Provide useful " Andreas Arnez
2014-12-11 11:49 ` [PATCH v4 2/2] Provide " Andreas Arnez
2014-12-12 13:20   ` Pedro Alves [this message]
2014-12-12 15:20     ` Andreas Arnez
2014-12-12 15:30       ` Pedro Alves
2014-12-12 17:45       ` Doug Evans
2014-12-12 19:04         ` Andreas Arnez
2014-12-15 12:41           ` Pedro Alves
2014-12-11 11:49 ` [PATCH v4 1/2] Add new GDB command "maint print user-registers" Andreas Arnez
2014-12-12 13:19   ` 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=548AEB86.60809@redhat.com \
    --to=palves@redhat.com \
    --cc=arnez@linux.vnet.ibm.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