[PATCH] Make gdb.ada/ptype_tagged_param.exp pass

Simon Marchi simark@simark.ca
Fri Jan 27 15:56:54 GMT 2023


On 1/27/23 09:11, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:
> 
> Simon> Woops, I hit a FAIL here.  I think the $has_runtime_debug_info condition
> Simon> is backwards
> 
> I can check in a patch to flip this if you think that will help.  I have
> no way to test it, though.  I tried installing and removing the relevant
> debuginfo packages on my machine, but the test works either way for me.

So, the current code is:


 50     -re -wrap $nodebug {
 51         if {$has_runtime_debug_info} {
 52             kfail "no debug info" $gdb_test_name
 53         } else {
 54             fail $gdb_test_name
 55         }
 56     }

This says: if we receive the wrong output, and we have GNAT debug info,
this is expected.  I think it's wrong, it should be: if we receive the
wrong output and we _don't_ have debug info, this is expected.

I see this on Ubuntu 22.04, with the gnat-11 package installed.  Without
libgnat-11-dbgsym, I get:

(gdb) ptype s
type = <ref> tagged record
    x: integer;
    y: integer;
end record
(gdb) FAIL: gdb.ada/ptype_tagged_param.exp: ptype s

And with libgnat-11-dbgsym installed:

type = <ref> new pck.shape with record
    r: integer;
end record
(gdb) PASS: gdb.ada/ptype_tagged_param.exp: ptype s

If I flip the condition to what I think makes more sense, the former
(without libgnat-11-dbgsym) case becomes:

type = <ref> tagged record
    x: integer;
    y: integer;
end record
(gdb) KFAIL: gdb.ada/ptype_tagged_param.exp: ptype s (PRMS: no debug info)

And the "with libgnat-11-dbgsym" case still passes fine, since it
outputs the right thing.

Simon


More information about the Gdb-patches mailing list