Go to file
Thiago Jung Bauermann bbb12eb9c8 gdb/arm: Remove tpidruro register from non-FreeBSD target descriptions
Commit 92d48a1e4e ("Add an arm-tls feature which includes the tpidruro
register from CP15.") introduced the org.gnu.gdb.arm.tls feature, which
adds the tpidruro register, and unconditionally enabled it in
aarch32_create_target_description.

In Linux, the tpidruro register isn't available via ptrace in the 32-bit
kernel but it is available for an aarch32 program running under an arm64
kernel via the ptrace compat interface.  This isn't currently implemented
however, which causes GDB on arm-linux with 64-bit kernel to list the
register but show it as unavailable, as reported by Tom de Vries:

  $ gdb -q -batch a.out -ex start -ex 'p $tpidruro'
  Temporary breakpoint 1 at 0x512

  Temporary breakpoint 1, 0xaaaaa512 in main ()
  $1 = <unavailable>

Simon Marchi then clarified:

> The only time we should be seeing some "unavailable" registers or memory
> is in the context of tracepoints, for things that are not collected.
> Seeing an unavailable register here is a sign that something is not
> right.

Therefore, disable the TLS feature in aarch32 target descriptions for Linux
and NetBSD targets (the latter also doesn't seem to support accessing
tpidruro either, based on a quick look at arm-netbsd-nat.c).

This patch fixes the following tests:

Running gdb.base/inline-frame-cycle-unwind.exp ...
FAIL: gdb.base/inline-frame-cycle-unwind.exp: cycle at level 3: backtrace when the unwind is broken at frame 3
FAIL: gdb.base/inline-frame-cycle-unwind.exp: cycle at level 5: backtrace when the unwind is broken at frame 5
FAIL: gdb.base/inline-frame-cycle-unwind.exp: cycle at level 1: backtrace when the unwind is broken at frame 1

Tested with Ubuntu 22.04.3 on armv8l-linux-gnueabihf in native,
native-gdbserver and native-extended-gdbserver targets with no regressions.

PR tdep/31418
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31418

Approved-By: John Baldwin <jhb@FreeBSD.org>
2024-02-29 12:27:27 -03:00
bfd bfd: Add ATTRIBUTE_HIDDEN to x86 internal functions 2024-02-29 04:32:26 -08:00
binutils x86: also permit YMM/ZMM use in CFI directives 2024-02-23 11:59:09 +01:00
config
contrib
cpu PR21739, Inconsistent diagnostics 2024-02-29 21:07:04 +10:30
elfcpp x86-64: Add R_X86_64_CODE_6_GOTTPOFF 2024-02-08 03:45:43 -08:00
etc
gas RISC-V: Add assembly support for TLSDESC. 2024-02-29 15:02:51 +08:00
gdb gdb/arm: Remove tpidruro register from non-FreeBSD target descriptions 2024-02-29 12:27:27 -03:00
gdbserver gdb/arm: Remove tpidruro register from non-FreeBSD target descriptions 2024-02-29 12:27:27 -03:00
gdbsupport Rewrite final cleanups 2024-02-27 10:30:29 -07:00
gnulib
gold x86-64: Add R_X86_64_CODE_6_GOTTPOFF 2024-02-08 03:45:43 -08:00
gprof
gprofng gprofng: change use of bignum to use of bigint 2024-02-28 16:32:29 -08:00
include RISC-V: Add TLSDESC reloc definitions. 2024-02-29 15:02:49 +08:00
ld RISC-V: Initial ld.bfd support for TLSDESC. 2024-02-29 15:02:55 +08:00
libbacktrace
libctf
libdecnumber
libiberty
libsframe libsframe: Fix calloc argument order in dump_sframe_header 2024-01-22 18:19:03 +01:00
opcodes PR21739, Inconsistent diagnostics 2024-02-29 21:07:04 +10:30
readline
sim sim: no rule to make sim/ppc/Makefile.in 2024-02-24 11:52:10 +10:30
texinfo
zlib
.cvsignore
.editorconfig
.gitattributes
.gitignore
ar-lib
ChangeLog
compile
config-ml.in
config.guess
config.rpath
config.sub
configure Fix disabling of year 2038 support on 32-bit hosts by default 2024-02-05 15:28:05 -03:00
configure.ac Fix disabling of year 2038 support on 32-bit hosts by default 2024-02-05 15:28:05 -03: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
SECURITY.txt
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.