Go to file
Tom de Vries f3e033f32a [gdb/testsuite] Fix gdb.base/vla-optimized-out.exp for ppc64le
On powerpc64le-linux, I run into:
...
(gdb) PASS: gdb.base/vla-optimized-out.exp: o1: printed optimized out vla
p sizeof (a)^M
$2 = <optimized out>^M
(gdb) FAIL: gdb.base/vla-optimized-out.exp: o1: \
  printed size of optimized out vla
...

The problem happens as follows.

In order to find the size of the optimized out vla, gdb needs to evaluate:
...
<155> DW_AT_upper_bound : 13 byte block: f3 1 53 23 1 8 20 24 8 20 26 31 1c \
  (DW_OP_GNU_entry_value: (DW_OP_reg3 (r3)); DW_OP_plus_uconst: 1;
   DW_OP_const1u: 32; DW_OP_shl; DW_OP_const1u: 32; DW_OP_shra; DW_OP_lit1;
   DW_OP_minus)
...

When trying to evaluate DW_OP_GNU_entry_value, it looks for a call site
matching the pc, but doesn't find it:
...
$ gdb -q -batch outputs/gdb.base/vla-optimized-out/vla-optimized-out-o1 \
  -ex "break f1" -ex run -ex "set debug entry-values 1" -ex "print sizeof (a)"
Breakpoint 1 at 0x1000067c: file vla-optimized-out.c, line 34.

Breakpoint 1, f1 (i=5) at vla-optimized-out.c:34
34      }
DW_OP_entry_value resolving cannot find DW_TAG_call_site 0x100006b0 in main
$1 = <optimized out>
....

The call site lookup fails because the call site label .LVL4:
...
        bl f1    # 11   *call_value_nonlocal_aixdi      [length = 8]
        nop
.LVL4:
...
is not placed directly after the bl insn.  This is gcc PR target/107909.

However, after manually fixing the .s file we have instead:
...
Cannot find matching parameter at DW_TAG_call_site 0x10000690 at main
$1 = <optimized out>
...
due to the fact that the call site has no call site parameters.

The call site does have a reference to the corresponding function f1, with
parameter i, for which we find location list entries:
...
  0037 1000067c 10000680 (DW_OP_reg3 (r3))
  004a 10000680 10000690 (DW_OP_GNU_entry_value: (DW_OP_reg3 (r3));
                          DW_OP_stack_value)
...
and we could use the fact that the current pc is in the 1000067c-10000680
range, and that that the range starts at the start of the function, to deduce
that DW_OP_GNU_entry_value: (DW_OP_reg3 (r3)) == DW_OP_reg3 (r3).
But that's a non-trivial enhancement, filed as enhancement PR symtab/29836.

Fix this by allowing <optimized out> for target powerpc and the gcc compiler.

Reviewed-By: Carl Love <cel@us.ibm.com>
Tested-By: Carl Love <cel@us.ibm.com>
PR testsuite/29813
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29813
2022-11-29 22:47:31 +01:00
bfd xtensa: allow dynamic configuration 2022-11-28 18:16:12 -08:00
binutils PR10368, ISO 8859 mentioned as 7bit encoding in strings documentation 2022-11-28 20:16:59 +10:30
config libsframe: add the SFrame library 2022-11-15 15:24:29 -08:00
contrib
cpu
elfcpp gold, dwp: support zstd compressed input debug sections [PR 29641] 2022-11-10 21:42:14 -08:00
etc
gas xtensa: allow dynamic configuration 2022-11-28 18:16:12 -08:00
gdb [gdb/testsuite] Fix gdb.base/vla-optimized-out.exp for ppc64le 2022-11-29 22:47:31 +01:00
gdbserver gdbserver: switch to right process in find_one_thread 2022-11-28 09:13:30 -05:00
gdbsupport fix leak in gdb_environ 2022-11-27 21:08:24 +01:00
gnulib [PR build/29791] gnulib: Disable _GL_ATTRIBUTE_DEALLOC on Solaris 2022-11-20 14:55:52 +01:00
gold Re: gold: add --compress-debug-sections=zstd [PR 29641] 2022-11-11 18:05:36 +10:30
gprof
gprofng gprofng: remove unused gprofng/src/DbeSession.cc.1 2022-11-28 20:52:10 -08:00
include xtensa: allow dynamic configuration 2022-11-28 18:16:12 -08:00
intl
ld xtensa: allow dynamic configuration 2022-11-28 18:16:12 -08:00
libbacktrace
libctf libctf: use libtool for link test in configure 2022-11-11 22:01:25 -08:00
libdecnumber
libiberty Impport libiberty commit: 885b6660c17f from gcc mainline. Fix gas's acinclude.m4 to stop a potwntial configure time warning message. 2022-11-24 12:31:46 +00:00
libsframe sframe/doc: remove usage of xrefautomaticsectiontitle 2022-11-24 10:14:08 -08:00
opcodes RISC-V: Better support for long instructions (disassembler) 2022-11-28 01:03:18 +00:00
readline
sim sim: pru: Fix behaviour when loop count is zero 2022-11-12 15:10:07 +02:00
texinfo
zlib
.cvsignore
.editorconfig
.gitattributes
.gitignore
ar-lib
ChangeLog
compile
config-ml.in
config.guess
config.rpath
config.sub
configure libsframe: add the SFrame library 2022-11-15 15:24:29 -08:00
configure.ac libsframe: add the SFrame library 2022-11-15 15:24:29 -08:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.LIBGLOSS
COPYING.NEWLIB
depcomp
djunpack.bat
install-sh
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS
Makefile.def bfd: linker: merge .sframe sections 2022-11-15 15:49:47 -08:00
Makefile.in bfd: linker: merge .sframe sections 2022-11-15 15:49:47 -08:00
Makefile.tpl
makefile.vms
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
README-maintainer-mode
setup.com
src-release.sh src-release.sh: Add libsframe 2022-11-15 15:50:05 -08:00
symlink-tree
test-driver
ylwrap

		   README for GNU development tools

This directory contains various GNU compilers, assemblers, linkers, 
debuggers, etc., plus their support routines, definitions, and documentation.

If you are receiving this as part of a GDB release, see the file gdb/README.
If with a binutils release, see binutils/README;  if with a libg++ release,
see libg++/README, etc.  That'll give you info about this
package -- supported targets, how to use it, how to report bugs, etc.

It is now possible to automatically configure and build a variety of
tools with one command.  To build all of the tools contained herein,
run the ``configure'' script here, e.g.:

	./configure 
	make

To install them (by default in /usr/local/bin, /usr/local/lib, etc),
then do:
	make install

(If the configure script can't determine your type of computer, give it
the name as an argument, for instance ``./configure sun4''.  You can
use the script ``config.sub'' to test whether a name is recognized; if
it is, config.sub translates it to a triplet specifying CPU, vendor,
and OS.)

If you have more than one compiler on your system, it is often best to
explicitly set CC in the environment before running configure, and to
also set CC when running make.  For example (assuming sh/bash/ksh):

	CC=gcc ./configure
	make

A similar example using csh:

	setenv CC gcc
	./configure
	make

Much of the code and documentation enclosed is copyright by
the Free Software Foundation, Inc.  See the file COPYING or
COPYING.LIB in the various directories, for a description of the
GNU General Public License terms under which you can copy the files.

REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info
on where and how to report problems.