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: Pedro Alves <palves at redhat dot com>
- To: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>, gdb-patches at sourceware dot org
- Date: Thu, 04 Dec 2014 17:38:32 +0000
- 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>
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;
> + }
> + }
Thanks,
Pedro Alves