Binutils with MCST patches
Go to file
Yao Qi d89fa914ad Remove get_thread_id
This patch removes get_thread_id from aarch64-linux-nat.c,
arm-linux-nat.c and xtensa-linux-nat.c.

get_thread_id was added in this commit below in 2000,

  41c49b06c4
  https://sourceware.org/ml/gdb-patches/2000-04/msg00398.html

which predates the ptid_t stuff added into GDB.  Nowadays, lwpid of
inferior_ptid is only zero when the inferior is created (in
fork-child.c:fork_inferior) and its lwpid will be set after
linux_nat_wait_1 gets the first event.  After that, lwpid of
inferior_ptid is not zero for linux-nat target, then we can use
ptid_get_lwp, so this function isn't needed anymore.

Even when GDB attaches to a process, the lwp of inferior_ptid
isn't zero,  see linux-nat.c:linux_nat_attach,

  /* The ptrace base target adds the main thread with (pid,0,0)
     format.  Decorate it with lwp info.  */
  ptid = ptid_build (ptid_get_pid (inferior_ptid),
		     ptid_get_pid (inferior_ptid),
		     0);

Note that linux_nat_xfer_partial shifts lwpid to pid for inferior_ptid
temperately for calling linux_ops->to_xfer_partial, but all the
affected functions in this patch are not called in
linux_ops->to_xfer_partial.

I think we can safely remove get_thread_id for all linux native targets.

Regression tested on arm-linux and aarch64-linux.  Unable to build
native GDB and test it on xtensa-linux.

gdb:

2015-08-05  Yao Qi  <yao.qi@linaro.org>

	* aarch64-linux-nat.c (get_thread_id): Remove.
	(debug_reg_change_callback): Call ptid_get_lwp instead of
	get_thread_id.
	(fetch_gregs_from_thread): Likewise.
	(store_gregs_to_thread): Likewise.
	(fetch_fpregs_from_thread): Likewise.
	(store_fpregs_to_thread): Likewise.
	(aarch64_linux_get_debug_reg_capacity): Likewise.
	* arm-linux-nat.c (get_thread_id): Remove.
	(GET_THREAD_ID): Update macro to use ptid_get_lwp.
	* xtensa-linux-nat.c (get_thread_id): Remove.
	(GET_THREAD_ID): Update macro to use ptid_get_lwp.
	* arm-linux-nat.c (get_thread_id): Remove.
	(GET_THREAD_ID): Remove.
	(fetch_fpregs): Call ptid_get_lwp instead of GET_THREAD_ID.
	(store_fpregs, fetch_regs, store_regs): Likewise.
	(fetch_wmmx_regs, store_wmmx_regs): Likewise.
	(fetch_vfp_regs, store_vfp_regs): Likewise.
	(arm_linux_read_description): Likewise.
	(arm_linux_get_hwbp_cap): Likewise.
	* xtensa-linux-nat.c (get_thread_id): Remove.
	(GET_THREAD_ID): Remove.
	(fetch_gregs, store_gregs): Call ptid_get_lwp instead of
	GET_THREAD_ID.
2015-08-05 08:41:19 +01:00
bfd Automatic date update in version.in 2015-08-05 00:00:08 +00:00
binutils Fix stack buffer overflows when parsing corrupt ihex files. 2015-08-04 16:51:53 +01:00
config Sync config with GCC 2015-07-27 07:43:26 -07:00
cpu Remove leading/trailing white spaces in ChangeLog 2015-07-24 04:16:47 -07:00
elfcpp Add chdr_size, Chdr, Chdr_write and Chdr_data 2015-04-08 10:29:40 -07:00
etc
gas 2015-08-04 Thomas Preud'homme <thomas.preudhomme@arm.com> 2015-08-04 09:39:42 +08:00
gdb Remove get_thread_id 2015-08-05 08:41:19 +01:00
gold Regenerate configure files 2015-07-27 07:56:32 -07:00
gprof Regenerate configure files 2015-07-27 07:56:32 -07:00
include Remove leading/trailing white spaces in ChangeLog 2015-07-24 04:16:47 -07:00
intl Remove leading/trailing white spaces in ChangeLog 2015-07-24 04:16:47 -07:00
ld ld: map option for run_dump_test requires no program. 2015-08-04 11:25:37 +01:00
libdecnumber Remove leading/trailing white spaces in ChangeLog 2015-07-24 04:16:47 -07:00
libiberty Remove leading/trailing white spaces in ChangeLog 2015-07-24 04:16:47 -07:00
opcodes Properly disassemble movnti in Intel mode 2015-07-30 04:17:02 -07:00
readline Revert "Sync readline/ to version 7.0 alpha" 2015-07-25 15:57:00 -04:00
sim Remove leading/trailing white spaces in ChangeLog 2015-07-24 04:16:47 -07:00
texinfo
zlib Remove leading/trailing white spaces in ChangeLog 2015-07-24 04:16:47 -07:00
.cvsignore
.gitattributes
.gitignore
COPYING
COPYING.LIB
COPYING.LIBGLOSS
COPYING.NEWLIB
COPYING3
COPYING3.LIB
ChangeLog Sync toplevel files with GCC 2015-07-27 07:49:05 -07:00
MAINTAINERS
Makefile.def Configure zlib with --enable-host-shared for shared bfd 2015-05-01 08:34:08 -07:00
Makefile.in Sync Makefile.tpl with GCC 2015-07-14 09:52:36 -07:00
Makefile.tpl Sync Makefile.tpl with GCC 2015-07-14 09:52:36 -07:00
README
README-maintainer-mode
compile
config-ml.in Sync toplevel files with GCC 2015-07-27 07:49:05 -07:00
config.guess Update config.guess and config.sub to the latest upstream version 2015-03-30 16:28:14 -04:00
config.rpath
config.sub Update config.guess and config.sub to the latest upstream version 2015-03-30 16:28:14 -04:00
configure Sync toplevel files with GCC 2015-07-27 07:49:05 -07:00
configure.ac Sync toplevel files with GCC 2015-07-27 07:49:05 -07:00
depcomp
djunpack.bat
install-sh
libtool.m4 Update libtool.m4 from GCC trunk 2014-11-24 09:14:09 -08:00
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
makefile.vms
missing
mkdep
mkinstalldirs
move-if-change
setup.com
src-release.sh Adjust src-release.sh for sim using the gdb create-version.sh. 2015-04-15 04:08:51 +02:00
symlink-tree
ylwrap

README

		   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.