binutils-gdb/gdb/testsuite/gdb.dwarf2
Simon Marchi 41bd68f52c Show optimized out local variables in "info locals"
Currently, optimized out variables are not shown when doing "info
locals".  Some users found that confusing, thinking GDB forgot to print
their variable.  This patch adds them to the "info locals" output.  I
added a test in gdb.dwarf2 to test for that behavior.  I think doing a
synthetic DWARF test is the easiest way to have an optimized out local
variable for sure.

However, this change reveals what I think is a bug in GDB, see:

http://lists.dwarfstd.org/pipermail/dwarf-discuss-dwarfstd.org/2017-September/004394.html

This patch marks the tests in inline-locals.exp that start failing as
KFAIL.  I'd like to tackle this bug eventually, but I don't have the
time right now.  I think it's still better to show an extra erroneous
entry than to not show the optimized out variables at all.  I haven't
created a bug in bugzilla yet, but if we agree it's indeed a bug,  I'll
create one and update the setup_kfail lines with the actual bug number
before pushing.

gdb/ChangeLog:

	* stack.c (iterate_over_block_locals): Add LOC_OPTIMIZED_OUT
	case in switch.

gdb/testsuite/ChangeLog:

	* gdb.opt/inline-locals.exp: Mark tests as KFAIL.
	* gdb.dwarf2/info-locals-optimized-out.exp: New file.
	* gdb.dwarf2/info-locals-optimized-out.c: New file.
2017-11-22 15:51:44 -05:00
..
arr-stride.c
arr-stride.exp
arr-subrange.c
arr-subrange.exp
atomic-type.exp
atomic.c
bad-regnum.c
bad-regnum.exp
bitfield-parent-optimized-out.exp
callframecfa.exp
callframecfa.S
clztest.c
clztest.exp
clztest.S
comp-unit-lang.c
comp-unit-lang.exp
corrupt.c
corrupt.exp
count.exp
data-loc.c
data-loc.exp
dup-psym.exp
dup-psym.S
dw2-abs-hi-pc-hello-dbg.S
dw2-abs-hi-pc-hello.c
dw2-abs-hi-pc-world-dbg.S
dw2-abs-hi-pc-world.c
dw2-abs-hi-pc.c
dw2-abs-hi-pc.exp
dw2-ada-ffffffff.exp
dw2-ada-ffffffff.S
dw2-anon-mptr.exp
dw2-anon-mptr.S
dw2-anonymous-func.exp
dw2-anonymous-func.S
dw2-bad-mips-linkage-name.c
dw2-bad-mips-linkage-name.exp
dw2-bad-parameter-type.exp
dw2-bad-parameter-type.S
dw2-bad-unresolved.c
dw2-bad-unresolved.exp
dw2-basic.exp
dw2-basic.S
dw2-canonicalize-type.exp
dw2-canonicalize-type.S
dw2-case-insensitive-debug.S
dw2-case-insensitive.c
dw2-case-insensitive.exp
dw2-common-block.exp
dw2-common-block.S
dw2-compdir-oldgcc.exp
dw2-compdir-oldgcc.S
dw2-compressed.exp
dw2-compressed.S
dw2-const.exp
dw2-const.S
dw2-cp-infcall-ref-static-main.c
dw2-cp-infcall-ref-static.exp
dw2-cp-infcall-ref-static.S
dw2-cu-size.exp
dw2-cu-size.S
dw2-dir-file-name.c
dw2-dir-file-name.exp
dw2-dos-drive.exp
dw2-dos-drive.S
dw2-double-set-die-type.exp
dw2-double-set-die-type.S
dw2-dummy-cu.exp
dw2-dummy-cu.S
dw2-dup-frame.c
dw2-dup-frame.exp
dw2-dup-frame.S
dw2-empty-namespace.exp
dw2-empty-namespace.S
dw2-empty-pc-range.exp
dw2-empty-pc-range.S
dw2-entry-value-main.c
dw2-entry-value.exp
dw2-entry-value.S
dw2-error.c
dw2-error.exp DWARF-5 basic functionality 2017-02-20 20:59:56 +01:00
dw2-error.S
dw2-filename.exp
dw2-filename.S
dw2-icc-opaque.exp
dw2-icc-opaque.S
dw2-icycle.c
dw2-icycle.exp
dw2-icycle.S
dw2-ifort-parameter.c
dw2-ifort-parameter.exp
dw2-inheritance.exp
dw2-inheritance.S
dw2-inline-break.exp
dw2-inline-break.S
dw2-inline-param-main.c
dw2-inline-param.exp
dw2-inline-param.S
dw2-intercu.exp
dw2-intercu.S
dw2-intermix.exp
dw2-intermix.S
dw2-lexical-block-bare.exp
dw2-linkage-name-trust-main.cc
dw2-linkage-name-trust.exp
dw2-linkage-name-trust.S
dw2-minsym-in-cu.exp
dw2-minsym-in-cu.S
dw2-modula2-self-type.exp
dw2-modula2-self-type.S
dw2-namespaceless-anonymous.exp
dw2-namespaceless-anonymous.S
dw2-noloc-main.c
dw2-noloc.exp
dw2-noloc.S
dw2-objfile-overlap-inner.S
dw2-objfile-overlap-outer.S
dw2-objfile-overlap.exp
dw2-op-call.exp
dw2-op-call.S
dw2-op-out-param.exp
dw2-op-out-param.S
dw2-op-stack-value.exp Big-endian targets: Don't ignore offset into DW_OP_implicit_value 2017-02-01 16:59:00 +01:00
dw2-op-stack-value.S
dw2-opt-structptr.c
dw2-opt-structptr.exp
dw2-param-error-main.c
dw2-param-error.exp
dw2-param-error.S
dw2-producer.exp
dw2-producer.S
dw2-ranges2.c
dw2-ranges3.c
dw2-ranges-base.c
dw2-ranges-base.exp
dw2-ranges.c
dw2-ranges.exp
dw2-ref-missing-frame-func.c
dw2-ref-missing-frame-main.c
dw2-ref-missing-frame.exp
dw2-ref-missing-frame.S
dw2-reg-undefined.c
dw2-reg-undefined.exp
dw2-reg-undefined.S
dw2-regno-invalid.exp
dw2-restore.exp
dw2-restore.S
dw2-restrict.c
dw2-restrict.exp
dw2-restrict.S
dw2-simple-locdesc.exp
dw2-simple-locdesc.S
dw2-single-line-discriminators.c
dw2-single-line-discriminators.exp
dw2-single-line-discriminators.S
dw2-skip-prologue.c
dw2-skip-prologue.exp Stop assuming no-debug-info variables have type int 2017-09-04 20:21:15 +01:00
dw2-skip-prologue.S
dw2-stack-boundary.exp
dw2-stack-boundary.S
dw2-strp.exp
dw2-strp.S
dw2-undefined-ret-addr.c
dw2-undefined-ret-addr.exp
dw2-undefined-ret-addr.S
dw2-unresolved-main.c
dw2-unresolved.exp
dw2-unresolved.S
dw2-var-zero-addr.exp
dw2-var-zero-addr.S
dw4-sig-type-unused.exp
dw4-sig-type-unused.S
dw4-sig-types-b.cc
dw4-sig-types.cc
dw4-sig-types.exp
dw4-sig-types.h
dwp-sepdebug.c
dwp-sepdebug.exp
dwp-symlink.c
dwp-symlink.exp
dwz.exp
dwzbuildid.exp
dynarr-ptr.c
dynarr-ptr.exp
enum-type.exp
file1.txt
fission-base.c
fission-base.exp
fission-base.S
fission-loclists-pie.exp
fission-loclists-pie.S
fission-loclists.exp
fission-loclists.S
fission-mix2.c
fission-mix.c
fission-mix.exp
fission-mix.h
fission-multi-cu1.c Fission support for multiple CUs per DWO file 2017-07-06 11:59:39 -07:00
fission-multi-cu2.c Fission support for multiple CUs per DWO file 2017-07-06 11:59:39 -07:00
fission-multi-cu.exp Fission support for multiple CUs per DWO file 2017-07-06 11:59:39 -07:00
fission-multi-cu.S Fission support for multiple CUs per DWO file 2017-07-06 11:59:39 -07:00
fission-reread.exp
fission-reread.S
formdata16.c DWARF-5: DW_FORM_data16 2017-02-20 21:02:20 +01:00
formdata16.exp gdb/testsuite: Add "get_endianness" convenience proc 2017-06-13 15:20:26 +02:00
gdb-index.exp
implptr-64bit.exp Use dwarf assembler in gdb.dwarf2/implptr-64bit.exp 2017-01-25 16:24:44 +00:00
implptr-optimized-out.exp
implptr.c
implptr.exp
implptr.S
implptrconst.c
implptrconst.exp
implptrpiece.exp gdb/testsuite: Add "get_endianness" convenience proc 2017-06-13 15:20:26 +02:00
implref-array.c
implref-array.exp
implref-const.exp
implref-global.c
implref-global.exp
implref-struct.c
implref-struct.exp
info-locals-optimized-out.c Show optimized out local variables in "info locals" 2017-11-22 15:51:44 -05:00
info-locals-optimized-out.exp Show optimized out local variables in "info locals" 2017-11-22 15:51:44 -05:00
mac-fileno.exp
mac-fileno.S
main-subprogram.c
main-subprogram.exp
main.c
member-ptr-forwardref.exp
member-ptr-forwardref.S
method-ptr.cc
method-ptr.exp
missing-sig-type.exp
nonvar-access.exp gdb/testsuite: Add "get_endianness" convenience proc 2017-06-13 15:20:26 +02:00
nostaticblock.exp
opaque-type-lookup-2.c
opaque-type-lookup.c
opaque-type-lookup.exp
pieces-optimized-out.c
pieces-optimized-out.exp
pieces-optimized-out.S
pieces.c
pieces.exp
pieces.S
pr10770.c
pr10770.exp [testsuite] Don't skip gdb.dwarf2/pr10770.exp for non-gcc compiler 2017-11-22 14:47:42 +00:00
pr11465.exp
pr11465.S
pr13961.exp
pr13961.S
shortpiece.exp Fix size check in dwarf2_evaluate_loc_desc_full 2017-07-09 10:46:49 -06:00
staticvirtual.exp
subrange.exp
symtab-producer.exp
trace-crash.exp
trace-crash.S
typeddwarf-amd64.S
typeddwarf.c
typeddwarf.exp
typeddwarf.S
valop.exp
valop.S
var-access.c Add test for modifiable DWARF locations 2017-06-13 15:20:25 +02:00
var-access.exp Fix two regressions in scalar printing 2017-08-14 10:14:05 -06:00
watch-notconst2.c
watch-notconst2.S
watch-notconst.c
watch-notconst.exp