This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 08/12] [PowerPC] Add support for PPR and DSCR


On 08/10/2018 03:52 AM, Pedro Franco de Carvalho wrote:
> +# At the breakpoint the inferior should have set the
> +# registers to these expected values.
> +gdb_test "info reg dscr" "dscr.*0x0*20\[ \t\]+.*"
> +gdb_test "info reg ppr" "ppr.*0x0*8000000000000\[ \t\]+.*"

...

> +
> +gdb_test "info reg dscr" "dscr.*0x0*8+\[ \t\]+.*"
> +gdb_test "info reg ppr" "ppr.*0x0*\[cC\]000000000000\[ \t\]+.*"

Skimming the patch I noticed the duplicated test names/messages
above.  Take a look here:

 https://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Make_sure_test_messages_are_unique

Here I'd use with_test_prefix, something like:

with_test_prefix "something relevant" {
  gdb_test "info reg dscr" "dscr.*0x0*20\[ \t\]+.*"
  gdb_test "info reg ppr" "ppr.*0x0*8000000000000\[ \t\]+.*"
}

gdb_test "stepi" "asm.*"

with_test_prefix "something else" {
  gdb_test "info reg dscr" "dscr.*0x0*20\[ \t\]+.*"
  gdb_test "info reg ppr" "ppr.*0x0*8000000000000\[ \t\]+.*"
}


BTW, isn't the series NEWS-worthy?

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]