[RFA/commit] (Ada) fix GDB crash printing packed array

Joel Brobecker brobecker@adacore.com
Sat May 11 17:23:00 GMT 2019


Hi Pedro,

> I was running some regression tests for gdb 8.3, and I noticed that
> there was a regression introduced by this patch for test
> gdb.ada/pckd_arr_ren.exp.
> 
> I tried investigating, and it seems that this happened due to the
> compiler in my system being relatively old (GNAT 4.9.3).  I don't know
> much about Ada, so I couldn't figure out if this is an issue with the
> debug symbols generated by the older compiler or if GDB should handle
> this, but it worked before the patch.
> 
> This is the relevant output from the test:
> 
> (gdb) break foo.adb:22
> Breakpoint 1 at 0x10002410: file /home/pedromfc/binutils-gdb/gdb/testsuite/gdb.ada/pckd_arr_ren/foo.adb, line 22.
> (gdb) run 
> Starting program: /home/pedromfc/binutils-gdb/build-bisect/gdb/testsuite/outputs/gdb.ada/pckd_arr_ren/foo 
> 
> Breakpoint 1, foo () at /home/pedromfc/binutils-gdb/gdb/testsuite/gdb.ada/pckd_arr_ren/foo.adb:22
> 22         Do_Nothing (A2'Address); -- STOP
> (gdb) print A2
> Could not find renamed variable: a1
> (gdb) FAIL: gdb.ada/pckd_arr_ren.exp: print var
> 
> That error message seems to come from ada-exp.y:write_object_renaming.

Thanks for the heads up.

Most likely the version of the compiler you are using is generating
the debug info improperly, but why don't you send me privately your
binary, and I will try to take a look, to see what's happening.

-- 
Joel



More information about the Gdb-patches mailing list