Go to file
Tom de Vries 154f2735ad [gdb/testsuite] Fix gdb.ada/access_tagged_param.exp for aarch64
On aarch64-linux, I run into:
...
Breakpoint 2, pck.inspect (obj=0x430eb0 \
  <system.pool_global.global_pool_object>, <objL>=0) at pck.adb:17^M
17         procedure Inspect (Obj: access Top_T'Class) is^M
(gdb) FAIL: gdb.ada/access_tagged_param.exp: continue
...
while on x86_64-linux, I see:
...
Breakpoint 2, pck.inspect (obj=0x62b2a0, <objL>=2) at pck.adb:19^M
19            null;^M
(gdb) PASS: gdb.ada/access_tagged_param.exp: continue
...
Note the different line numbers, 17 vs 19.

The difference comes from the gdbarch_skip_prologue implementation.

The amd64_skip_prologue implementation doesn't use gcc line numbers, and falls
back to the architecture-specific prologue analyzer, which correctly skips
past the prologue, to address 0x4022f7:
...
00000000004022ec <pck__inspect>:
  4022ec:       55                      push   %rbp
  4022ed:       48 89 e5                mov    %rsp,%rbp
  4022f0:       48 89 7d f8             mov    %rdi,-0x8(%rbp)
  4022f4:       89 75 f4                mov    %esi,-0xc(%rbp)
  4022f7:       90                      nop
  4022f8:       90                      nop
  4022f9:       5d                      pop    %rbp
  4022fa:       c3                      ret
...

The aarch64_skip_prologue implementation does use gcc line numbers, which are:
...
File name                    Line number    Starting address    View    Stmt
pck.adb                               17            0x402580               x
pck.adb                               17            0x402580       1       x
pck.adb                               19            0x40258c               x
pck.adb                               20            0x402590               x
...
and which are represented like this internally in gdb:
...
INDEX  LINE   ADDRESS            IS-STMT PROLOGUE-END
0      17     0x0000000000402580 Y
1      17     0x0000000000402580 Y
2      19     0x000000000040258c Y
3      20     0x0000000000402590 Y
4      END    0x00000000004025a0 Y
...

The second entry is interpreted as end-of-prologue, so 0x402580 is used, while
the actual end of the prologue is at 0x40258c:
...
0000000000402580 <pck__inspect>:
  402580:       d10043ff        sub     sp, sp, #0x10
  402584:       f90007e0        str     x0, [sp, #8]
  402588:       b90007e1        str     w1, [sp, #4]
  40258c:       d503201f        nop
  402590:       d503201f        nop
  402594:       910043ff        add     sp, sp, #0x10
  402598:       d65f03c0        ret
  40259c:       d503201f        nop
...

Note that the architecture-specific prologue analyzer would have gotten this
right:
...
(gdb) p /x aarch64_analyze_prologue (gdbarch, pc, pc + 128, 0)
$2 = 0x40258c
...

Fix the FAIL by making the test-case more robust against problems in prologue
skipping, by setting the breakpoint on line 19 instead.

Likewise in a few similar test-cases.

Tested on x86_64-linux and aarch64-linux.
2022-09-07 11:29:11 +02:00
bfd Automatic date update in version.in 2022-09-07 00:00:08 +00:00
binutils Add debuginfod support for objdump -S 2022-09-06 10:43:07 -04:00
config Add markers for 2.39 branch 2022-07-08 10:41:07 +01:00
contrib
cpu Add markers for 2.39 branch 2022-07-08 10:41:07 +01:00
elfcpp Add gold support for --package-metadata option. 2022-08-04 17:37:32 -07:00
etc
gas LoongArch: fix gas BFD_RELOC_8/16/24 bug 2022-09-07 11:19:38 +08:00
gdb [gdb/testsuite] Fix gdb.ada/access_tagged_param.exp for aarch64 2022-09-07 11:29:11 +02:00
gdbserver Use strwinerror in gdb/windows-nat.c 2022-08-16 08:04:37 -06:00
gdbsupport gdbsupport: add wrapper around result_of and invoke_result 2022-08-30 14:43:26 -04:00
gnulib
gold PR29462, internal error in relocate, at powerpc.cc:10796 2022-08-10 15:31:35 +09:30
gprof Don't use BFD_VMA_FMT in binutils 2022-08-04 12:22:39 +09:30
gprofng gprofng: fix bug 29479 Collection fails when built without java support 2022-08-18 11:15:56 -07:00
include opcodes: Add non-enum disassembler options 2022-09-06 02:23:21 +00:00
intl
ld xtensa: bfd: fix TLS relocations generated for PIE 2022-09-02 09:54:49 -07:00
libbacktrace
libctf libctf: Avoid use of uninitialised variables 2022-08-01 09:30:33 +09:30
libdecnumber
libiberty Add markers for 2.39 branch 2022-07-08 10:41:07 +01:00
opcodes opcodes: Add non-enum disassembler options 2022-09-06 02:23:21 +00:00
readline
sim sim/riscv: Complete tidying up with SBREAK 2022-09-05 09:42:06 +01:00
texinfo
zlib Regenerate with automake-1.15.1 2022-07-09 20:10:47 +09:30
.cvsignore
.editorconfig
.gitattributes binutils-gdb/git: highlight whitespace errors in source files 2022-07-25 14:35:41 +01:00
.gitignore
ar-lib
ChangeLog Add markers for 2.39 branch 2022-07-08 10:41:07 +01:00
compile
config-ml.in
config.guess
config.rpath
config.sub
configure Disable year 2038 support on 32-bit hosts by default 2022-08-10 11:17:53 +01:00
configure.ac Disable year 2038 support on 32-bit hosts by default 2022-08-10 11:17:53 +01: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
Makefile.in
Makefile.tpl
makefile.vms
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
README-maintainer-mode
setup.com
src-release.sh
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.