This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Provide useful completer for "info registers"
- From: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 10 Dec 2014 18:48:41 +0100
- Subject: Re: [PATCH] Provide useful completer for "info registers"
- Authentication-results: sourceware.org; auth=none
- References: <87h9xnqje8 dot fsf at br87z6lw dot de dot ibm dot com> <54809C18 dot 1030102 at redhat dot com>
On Thu, Dec 04 2014, Pedro Alves wrote:
> Also, ...
>
> On 11/25/2014 05:28 PM, Andreas Arnez wrote:
>> + for (i = 0; i < n_regs; i++)
>> + {
>> + const char *reg_name = gdbarch_register_name (gdbarch, i);
>> +
>> + if (reg_name != NULL && strncmp (text, reg_name, len) == 0)
>> + VEC_safe_push (char_ptr, result, xstrdup (reg_name));
>
> Not sure under which conditions "len" could be zero here. If it may,
> note that some registers have empty names. See default_print_registers_info:
>
> /* If the register name is empty, it is undefined for this
> processor, so don't display anything. */
> if (gdbarch_register_name (gdbarch, i) == NULL
> || *(gdbarch_register_name (gdbarch, i)) == '\0')
> continue;
>
>> + }
>> + }
Good point. This is fixed in the new version; registers with empty
names are skipped now.