Re: [PATCH 5/5] arc: Add prologue analysis

Pedro Alves
2017-02-17T13:25:59Z

On 02/14/2017 10:01 AM, Anton Kolesov wrote:
> +
> +/* Copy of fprintf_disasm from disasm.c. */
> +
> +static int ATTRIBUTE_PRINTF (2, 3)
> +arc_fprintf_disasm (void *stream, const char *format, ...)
> +{
> + va_list args;
> +
> + va_start (args, format);
> + vfprintf_filtered ((struct ui_file *) stream, format, args);
> + va_end (args);
> + /* Something non -ve. */

This is always the null stream AFAICS,
so why waste time with calling vfprintf_filtered?
See disasm.c:gdb_buffered_insn_length_fprintf, for example.

> + return 0;
> +}
> +
> +/* Return properly initialized disassemble_info. */
> +
> +struct disassemble_info
> +arc_disassemble_info (struct gdbarch *gdbarch)

Also, something's odd with the patch split, since this function
was used by an earlier patch.

> +# Test more levels of backtrace.
> +gdb_breakpoint nested_prologue_inner temporary
> +gdb_continue_to_breakpoint nested_prologue_inner
> +gdb_test "backtrace 10" \
> + "#0\[ \t\]*$hex in nested_prologue_inner .*\r\n#1\[ \t\]*$hex in nested_prologue_outer .*\r\n#2\[ \t\]*$hex in main.*" \
> + "backtrace in nested_prologue_inner"
> + set regs [saved_regs_to_str {r13 r18}]
> + gdb_test "info frame" ".*Saved registers:$regs" \
> + "saved registers in nested_prologue_inner"
> + set regs [saved_regs_to_str {r14 r15 blink}]
> + gdb_test "info frame 1" ".*Saved registers:$regs" \
> + "saved registers in nested_prologue_outer"
> +

Something's odd with indentation here.

This is missing a NEWS entry for the command.

But otherwise, this looks very good to me.

Thanks,
Pedro Alves