[RFA v5] (Ada) Fix frame argument printing when using auto language mode
Joel Brobecker
brobecker@adacore.com
Wed Feb 28 09:23:00 GMT 2018
> gdb/ChangeLog:
>
> * ada-valprint.c (ada_val_print_gnat_array): Remove language
> parameter and use Ada language definition instead.
> (ada_val_print_ptr): Remove unused language parameter.
> (ada_val_print_num): Remove language parameter and use Ada language
> definition instead.
> (ada_val_print_enum, ada_val_print_flt): Remove unused language
> parameter.
> (ada_val_print_struct_union, ada_val_print_ref): Remove language
> parameter and use Ada language definition instead.
> (ada_val_print_1): Update all ada_val_print_xxx calls.
You forgot to say that you removed the "language" parameter.
> (ada_val_print): Update ada_val_print_1 call.
>
> gdb/testsuite/ChangeLog:
>
> * gdb.ada/frame_arg_lang.exp: New testcase.
> * gdb.ada/frame_arg_lang/bla.adb: New file.
> * gdb.ada/frame_arg_lang/pck.ads: New file.
> * gdb.ada/frame_arg_lang/pck.adb: New file.
> * gdb.ada/frame_arg_lang/foo.c: New file.
This patch is OK for me, modulo the question below. Please give
everyone who commmented on the patch already a day or two to either
comment or request more time to comment before you push.
Thank you!
> +# Here is the scenario:
> +# - Once stopped in a C function, with language_mode set to auto, print
> +# backtrace, we should see the Ada frame arguments printed using Ada
> +# syntax.
> +# - Set language to C, then check that printing backtrace shows the Ada
> +# frame arguments using C syntax.
> +# - Set language back to auto, check language mode value, then print
> +# backtrace, we should see Ada frame arguments printed using Ada C
> +# syntax.
> +
> +gdb_test "show lang" \
> + "The current source language is \"auto; currently c\"." \
> + "show language #1"
> +
> +gdb_test "bt" \
> + "#1 $hex in pck\\.call_me \\(s=\"test\"\\).*" \
> + "backtrace with auto: c"
> +
> +gdb_test_no_output "set language c" \
> + "Set current source language to \"manual; currently c\"."
> +
> +gdb_test "show lang" \
> + "The current source language is \"c\"." \
> + "show language #2"
> +
> +gdb_test "bt" \
> + "#1 $hex in pck\\.call_me \\(s={P_ARRAY = $hex, P_BOUNDS = $hex}\\).*" \
> + "backtrace with manual: c"
> +
> +gdb_test_no_output "set language auto" \
> + "Set current source language to \"auto; currently c\"."
> +
> +gdb_test "show lang" \
> + "The current source language is \"auto; currently c\"." \
> + "show language #3"
> +
> +gdb_test "bt" \
> + "#1 $hex in pck\\.call_me \\(s=\"test\"\\).*" \
> + "backtrace with auto: ada"
I admit I do not understand the "ada" in the test label above.
This test is verifying a scenario which is exactly identical
to the first part where you backtrace right after hitting
the breakpoint. And yet, in the first case, you call is ": c",
but in this case you call it ": ada"....
--
Joel
More information about the Gdb-patches
mailing list