binutils-gdb/gdb/testsuite
Joel Brobecker 2fa15f237d crash printing optimized out variant type
Assuming the following declarations:

   type Discriminants_Record (A : Integer; B : Boolean) is record
      C : Float;
   end record;
   Z : Discriminants_Record := (A => 1, B => False, C => 2.0);

If variable Z is not used, and the compiler optimizes it out,
GDB would crash as follow:

    (gdb) print Z
    /[...]/gdb/valops.c:1121: internal-error: Unexpected lazy value type.

This is because the ada-lang module forgot to set the optimized_out
flag in the value returned by ada_evaluate_subexp during the value's
"fixing" process.  Later on, when trying to print the resulting value,
GDB finds that the value is still lazily allocated, and thus tries to
fetch it. But this is not allowed for not_lval values, hence the internal
error.

gdb/ChangeLog:

        * ada-lang.c (coerce_unspec_val_to_type): Make sure that
        the optimized_out flag is preserved.

gdb/testsuite/ChangeLog:

        * gdb.ada/optim_drec: New testcase.
2012-09-10 22:18:24 +00:00
..
boards * boards/fission.exp: Explicitly mark "board" as not remote. 2012-09-10 17:48:11 +00:00
config 2012-07-19 Pedro Alves <palves@redhat.com> 2012-07-19 20:00:59 +00:00
gdb.ada crash printing optimized out variant type 2012-09-10 22:18:24 +00:00
gdb.arch gdb/testsuite/ 2012-08-27 16:34:35 +00:00
gdb.asm * gdb.asm/asm-source.exp: Use standard_output_file, 2012-06-25 20:11:43 +00:00
gdb.base * gdb.base/info-macros.c: Fix whitespace. 2012-09-05 18:20:53 +00:00
gdb.cell * lib/gdb.exp (skip_altivec_tests, skip_vsx_tests) 2012-06-21 20:46:25 +00:00
gdb.cp PR gdb/13483 2012-09-10 17:12:53 +00:00
gdb.disasm * Makefile.in (clean): Remove Fission .dwo and .dwp files. 2012-05-17 19:03:59 +00:00
gdb.dwarf2 PR c++/14365 2012-08-19 19:37:51 +00:00
gdb.fortran * gdb.fortran/subarray.exp: Use standard_testfile, 2012-06-25 20:51:35 +00:00
gdb.gdb 2012-09-08 Khoo Yit Phang <khooyp@cs.umd.edu> 2012-09-08 05:29:21 +00:00
gdb.go * gdb.go/package.exp: Partially revert earlier patch; use 2012-06-28 13:52:51 +00:00
gdb.hp * gdb.hp/gdb.aCC/exception.exp: Remove. 2012-08-21 19:36:47 +00:00
gdb.java * lib/gdb.exp (skip_unwinder_tests): New proc. 2012-08-22 14:27:49 +00:00
gdb.linespec * linespec.c (linespec_lex_number): A number followed 2012-07-30 17:45:37 +00:00
gdb.mi gdb/ 2012-08-09 12:53:46 +00:00
gdb.modula2 * gdb.modula2/unbounded-array.exp: Use standard_testfile, 2012-06-25 20:28:23 +00:00
gdb.multi * gdb.multi/watchpoint-multi.exp: Use standard_testfile. 2012-06-25 21:07:32 +00:00
gdb.objc * Makefile.in (SFILES): Remove objc-exp.y. 2012-07-26 20:11:10 +00:00
gdb.opencl * Makefile.in (clean): Remove Fission .dwo and .dwp files. 2012-05-17 19:03:59 +00:00
gdb.opt * gdb.opt/clobbered-registers-O2.exp: Use standard_testfile, 2012-06-25 20:24:57 +00:00
gdb.pascal * gdb.pascal/integers.exp: Use standard_testfile, clean_restart. 2012-06-25 20:43:40 +00:00
gdb.python (test_subscript_regression): Remove no longer necessary globals, 2012-09-06 17:57:41 +00:00
gdb.reverse 2012-07-19 Pedro Alves <palves@redhat.com> 2012-07-19 20:00:59 +00:00
gdb.server * gdb.base/annota1.exp: Accept no frames-invalid notification 2012-08-02 15:59:59 +00:00
gdb.stabs * gdb.stabs/weird.exp: Remove directory-checking code. Use 2012-06-26 17:32:44 +00:00
gdb.threads * gdb.base/annota1.exp: Accept no frames-invalid notification 2012-08-02 15:59:59 +00:00
gdb.trace gdb/ 2012-08-23 16:11:10 +00:00
gdb.xml * Makefile.in (clean): Remove Fission .dwo and .dwp files. 2012-05-17 19:03:59 +00:00
lib * lib/gdb.exp (skip_unwinder_tests): Don't leave 'ok' set if 2012-08-24 15:26:23 +00:00
ChangeLog crash printing optimized out variant type 2012-09-10 22:18:24 +00:00
Makefile.in * Makefile.in (clean): Remove Fission .dwo and .dwp files. 2012-05-17 19:03:59 +00:00
TODO
aclocal.m4 gdb 2009-06-29 16:41:45 +00:00
configure Initial pass at Go language support. 2012-04-25 14:07:23 +00:00
configure.ac Initial pass at Go language support. 2012-04-25 14:07:23 +00:00
dg-extract-results.sh * dg-extract-results.sh: Handle KFAILs. 2012-03-18 04:17:16 +00:00