diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2019-12-27 20:58:42 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2019-12-27 21:02:35 -0500 |
commit | b28a729db188235ce61f3a03e35a27f9427af12e (patch) | |
tree | 4048192488afe36e73036d6fea7f46cb1ecfec4c /gdb/testsuite/gdb.ada | |
parent | 1ddaf334cfca50957fe33a6b23fab79a85ea1655 (diff) | |
download | gdb-b28a729db188235ce61f3a03e35a27f9427af12e.zip gdb-b28a729db188235ce61f3a03e35a27f9427af12e.tar.gz gdb-b28a729db188235ce61f3a03e35a27f9427af12e.tar.bz2 |
[PATCH] Adjust test gdb.ada/ptype_tagged_param.exp for when GNAT runtime does not have debug info
This test verifies that GDB correctly identifies the run-time type of
"s" as being the type "Circle". However, that can only be done
correctly if the GNAT runtime has been compiled and shipped with debug
information, so that GDB can poke in its internal data structures.
Currently the test fails when when running against a GNAT runtime
without debug info. This is the case, for example, on Arch Linux using
the distribution package.
This patch adds a helper in lib/ada.exp to check whether the GNAT
runtime has debug info or not. It then uses it in
gdb.ada/ptype_tagged_param.exp to expect a different result, depending
on whether we have debug info or not in the runtime.
At first, I made it so we would XFAIL the test, in the absence of debug
info, but then I thought that we might as well test for the output we
expect in the absence of debug info instead.
gdb/testsuite/ChangeLog:
* lib/ada.exp (gnat_runtime_has_debug_info): New proc.
* lib/gnat_debug_info_test.adb: New file.
* gdb.ada/ptype_tagged_param.exp: Use
gnat_runtime_has_debug_info, expect a different output if
runtime does not have debug info.
Diffstat (limited to 'gdb/testsuite/gdb.ada')
-rw-r--r-- | gdb/testsuite/gdb.ada/ptype_tagged_param.exp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.ada/ptype_tagged_param.exp b/gdb/testsuite/gdb.ada/ptype_tagged_param.exp index 567ef82..08d3e5d 100644 --- a/gdb/testsuite/gdb.ada/ptype_tagged_param.exp +++ b/gdb/testsuite/gdb.ada/ptype_tagged_param.exp @@ -21,14 +21,31 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } return -1 } +set has_runtime_debug_info [gnat_runtime_has_debug_info] + clean_restart ${testfile} if ![runto "position_x" ] then { return -1 } -set eol "\[\r\n\]+" -set sp "\[ \t\]*" +# Identifying the runtime type of S can only be done when we have the debug +# info for the GNAT runtime. + +if { $has_runtime_debug_info } { + gdb_test "ptype s" \ + [multi_line \ + "type = <ref> new pck.shape with record" \ + " r: integer;" \ + "end record"] \ + "ptype s, with debug info" +} else { + gdb_test "ptype s" \ + [multi_line \ + "type = <ref> tagged record" \ + " x: integer;" \ + " y: integer;" \ + "end record" ] \ + "ptype s, without debug info" +} -gdb_test "ptype s" \ - "type = <ref> new pck.shape with record${eol}${sp}r: integer;${eol}end record" |