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] Add tests for JIT debugging interface


On Tuesday 11 January 2011 23:26:41, Paul Pluzhnikov wrote:
> +int main(int argc, char *argv[])
> +{
> +  if (argc < 2)
> +    usage(argv[0]);
> +  else
> +    {

You're using GNU formatting throughout the file except here.


> +proc one_test {count match_str} {
> +    global solib_binfile gdb_prompt
> +
> +    gdb_test_no_output "set args $solib_binfile $count" "set args"
> +    if ![runto_main] then {
> +       fail "Can't run to main"
> +       return 0
> +    }
> +
> +    gdb_breakpoint [gdb_get_line_number "break here 1"]
> +    gdb_continue_to_breakpoint "break here 1"
> +    gdb_test "info function jit_function" "$match_str"
> +    gdb_breakpoint [gdb_get_line_number "break here 2"]
> +    gdb_continue_to_breakpoint "break here 2"
> +    # All jit librares must have been unregistered
> +    gdb_test "info function jit_function" \
> +       "All functions matching regular expression \"jit_function\":"

Tests should have distinct messages.  Since this procedure
is ran more than once, you'll have identical output more than
once in your gdb.sum.  I suggest making use of $pf_prefix (grep will
find uses).

This is okay with that, and Yao's comments addressed.

Thanks much!

> +}
> +
> +one_test 1 "${hex}  jit_function_0000"
> +one_test 2 "${hex}  jit_function_0000\[\r\n\]+${hex}  jit_function_0001"

-- 
Pedro Alves


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