Binutils with MCST patches
Go to file
Pedro Alves c1e36e3e91 range stepping: gdb
This patch teaches GDB to take advantage of target-assisted range
stepping.  It adds a new 'r ADDR1,ADDR2' action to vCont (vCont;r),
meaning, "step once, and keep stepping as long as the thread is in the
[ADDR1,ADDR2) range".

Rationale:

When user issues the "step" command on the following line of source,

   a = b + c + d * e - a;

GDB single-steps every single instruction until the program reaches a
new different line.  E.g., on x86_64, that line compiles to:

   0x08048434 <+65>:    mov    0x1c(%esp),%eax
   0x08048438 <+69>:    mov    0x30(%esp),%edx
   0x0804843c <+73>:    add    %eax,%edx
   0x0804843e <+75>:    mov    0x18(%esp),%eax
   0x08048442 <+79>:    imul   0x2c(%esp),%eax
   0x08048447 <+84>:    add    %edx,%eax
   0x08048449 <+86>:    sub    0x34(%esp),%eax
   0x0804844d <+90>:    mov    %eax,0x34(%esp)
   0x08048451 <+94>:    mov    0x1c(%esp),%eax

and the following is the RSP traffic between GDB and GDBserver:

 --> vCont;s:p2e13.2e13;c
 <-- T0505:68efffbf;04:30efffbf;08:3c840408;thread:p2e13.2e13;core:1;
 --> vCont;s:p2e13.2e13;c
 <-- T0505:68efffbf;04:30efffbf;08:3e840408;thread:p2e13.2e13;core:2;
 --> vCont;s:p2e13.2e13;c
 <-- T0505:68efffbf;04:30efffbf;08:42840408;thread:p2e13.2e13;core:2;
 --> vCont;s:p2e13.2e13;c
 <-- T0505:68efffbf;04:30efffbf;08:47840408;thread:p2e13.2e13;core:0;
 --> vCont;s:p2e13.2e13;c
 <-- T0505:68efffbf;04:30efffbf;08:49840408;thread:p2e13.2e13;core:0;
 --> vCont;s:p2e13.2e13;c
 <-- T0505:68efffbf;04:30efffbf;08:4d840408;thread:p2e13.2e13;core:0;
 --> vCont;s:p2e13.2e13;c
 <-- T0505:68efffbf;04:30efffbf;08:51840408;thread:p2e13.2e13;core:0;

IOW, a lot of roundtrips between GDB and GDBserver.

If we add a new command to the RSP, meaning "keep stepping and don't
report a stop until the program goes out of the [0x08048434,
0x08048451) address range", then the RSP traffic can be reduced down
to:

 --> vCont;r8048434,8048451:p2db0.2db0;c
 <-- T0505:68efffbf;04:30efffbf;08:51840408;thread:p2db0.2db0;core:1;

As number of packets is reduced dramatically, the performance of
stepping source lines is much improved.

In case something is wrong with range stepping on the stub side, the
debug info or even gdb, this adds a "set/show range-stepping" command
to be able to turn range stepping off.

gdb/
2013-05-23  Yao Qi  <yao@codesourcery.com>
	    Pedro Alves  <palves@redhat.com>

	* gdbthread.h (struct thread_control_state) <may_range_step>: New
	field.
	* infcmd.c (step_once, until_next_command): Enable range stepping.
	* infrun.c (displaced_step_prepare): Disable range stepping.
	(resume): Disable range stepping if stepping over a breakpoint or
	we have software watchpoints.  If range stepping is enabled,
	assert the thread is in the stepping range.
	(clear_proceed_status_thread): Clear may_range_step.
	(handle_inferior_event): Disable range stepping as soon as we know
	the thread that hit the event.  Re-enable it whenever we're going
	to step with a step range.
	* remote.c (struct vCont_action_support) <r>: New field.
	(use_range_stepping): New global.
	(remote_vcont_probe): Handle 'r' action.
	(append_resumption): Append an 'r' action if the thread may range
	step.
	(show_range_stepping): New function.
	(set_range_stepping): New function.
	(_initialize_remote): Call add_setshow_boolean_cmd to register the
	'set range-stepping' and 'show range-stepping' commands.
	* NEWS: Mention range stepping, the new vCont;r action, and the
	new "set/show range-stepping" commands.

gdb/doc/
2013-05-23  Yao Qi  <yao@codesourcery.com>
	    Pedro Alves  <palves@redhat.com>

	* gdb.texinfo (Packets): Document 'vCont;r'.
	(Continuing and Stepping): Document target-assisted range
	stepping, and the 'set range-stepping' and 'show range-stepping'
	commands.
2013-05-23 17:15:35 +00:00
bfd * format.c (bfd_check_format_matches): Don't match a target in 2013-05-23 03:35:59 +00:00
binutils binutils/ 2013-05-15 16:36:38 +00:00
config 2013-04-30 Jan-Benedict Glaw <jbglaw@lug-owl.de> 2013-04-30 12:40:42 +00:00
cpu PR binutils/15241 2013-03-08 17:25:12 +00:00
elfcpp elfcpp/ 2013-03-01 22:45:56 +00:00
etc PR other/46202: implement install-strip. 2010-11-20 19:37:58 +00:00
gas 2013-05-23 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> 2013-05-23 15:48:47 +00:00
gdb range stepping: gdb 2013-05-23 17:15:35 +00:00
gold gold/ 2013-05-21 21:14:40 +00:00
gprof * aarch64.c: New file. 2013-05-22 13:29:43 +00:00
include include/opcode/ 2013-05-22 18:08:26 +00:00
intl merge from gcc 2010-09-27 21:01:18 +00:00
ld PR ld/12982 2013-05-21 07:15:22 +00:00
libdecnumber merge from gcc 2013-03-28 02:00:05 +00:00
libiberty merge from gcc 2013-05-10 03:03:04 +00:00
opcodes 2013-05-23 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> 2013-05-23 15:48:47 +00:00
readline readline/ 2013-05-22 09:51:49 +00:00
sim sim: arm: add support for MOVW and MOVT instructions 2013-05-15 17:49:44 +00:00
texinfo * texinfo/texinfo.tex: Update to version 2009-03-28.05. 2009-04-21 12:36:46 +00:00
.cvsignore add autom4te.cache to .cvsignore 2007-02-13 15:25:58 +00:00
.gitignore Sync the root .gitignore file with GCC's. 2013-01-11 15:17:35 +00:00
COPYING 2005-07-14 Kelley Cook <kcook@gcc.gnu.org> 2005-07-14 01:24:56 +00:00
COPYING.LIB 2005-07-16 Kelley Cook <kcook@gcc.gnu.org> 2005-07-16 02:41:34 +00:00
COPYING.LIBGLOSS 2013-01-07 Jeff Johnston <jjohnstn@redhat.com> 2013-01-07 21:39:26 +00:00
COPYING.NEWLIB 2013-05-06 Sandra Loosemore <sandra@codesourcery.com> 2013-05-06 18:31:56 +00:00
COPYING3 * COPYING3: New file. Contains version 3 of the GNU General Public License. 2007-07-17 13:50:23 +00:00
COPYING3.LIB * COPYING3: New file. Contains version 3 of the GNU General Public License. 2007-07-17 13:50:23 +00:00
ChangeLog 2013-05-06 Sandra Loosemore <sandra@codesourcery.com> 2013-05-06 18:31:56 +00:00
MAINTAINERS MAINTAINERS: clarify policy with config/ (and other top level files) 2012-05-12 03:10:17 +00:00
Makefile.def 2013-04-22 Jan-Benedict Glaw <jbglaw@lug-owl.de> 2013-04-22 17:11:22 +00:00
Makefile.in 2013-04-22 Jan-Benedict Glaw <jbglaw@lug-owl.de> 2013-04-22 17:11:22 +00:00
Makefile.tpl * Makefile.tpl (BOOT_ADAFLAGS): Remove -gnata. 2013-01-11 11:48:54 +00:00
README
README-maintainer-mode Cleanups after the update to Autoconf 2.64, Automake 1.11. 2009-08-22 17:08:11 +00:00
compile Update automake-provided files in the toplevel. 2009-08-22 11:48:33 +00:00
config-ml.in * config-ml.in: Don't handle arc-*-elf*. 2011-03-22 20:01:13 +00:00
config.guess * config.guess: Update from config repo. 2013-04-29 15:13:53 +00:00
config.rpath Remove freebsd1 from libtool.m4 macros and config.rpath. 2011-02-13 21:00:14 +00:00
config.sub * config.guess: Update from config repo. 2013-04-29 15:13:53 +00:00
configure 2013-04-22 Jan-Benedict Glaw <jbglaw@lug-owl.de> 2013-04-22 15:25:09 +00:00
configure.ac 2013-04-22 Jan-Benedict Glaw <jbglaw@lug-owl.de> 2013-04-22 15:25:09 +00:00
depcomp Update automake-provided files in the toplevel. 2009-08-22 11:48:33 +00:00
djunpack.bat * djunpack.bat: Use ".." quoting in Sed command, for the sake of 2009-03-27 13:37:09 +00:00
install-sh Update automake-provided files in the toplevel. 2009-08-22 11:48:33 +00:00
libtool.m4 PR target/38607 2012-09-14 23:55:22 +00:00
ltgcc.m4 * libtool.m4: Update to libtool 2.2.6. 2008-09-29 15:28:14 +00:00
ltmain.sh Backport from Libtool: Fix relink mode to use absolute path if hardcode_minus_L. 2011-01-13 18:52:53 +00:00
ltoptions.m4 Sync Libtool from GCC. 2010-01-09 21:11:44 +00:00
ltsugar.m4 * libtool.m4: Update to libtool 2.2.6. 2008-09-29 15:28:14 +00:00
ltversion.m4 Sync Libtool from GCC. 2010-01-09 21:11:44 +00:00
lt~obsolete.m4 Sync Libtool from GCC. 2010-01-09 21:11:44 +00:00
makefile.vms
missing Update automake-provided files in the toplevel. 2009-08-22 11:48:33 +00:00
mkdep
mkinstalldirs Update automake-provided files in the toplevel. 2009-08-22 11:48:33 +00:00
move-if-change Import move-if-change script from gnulib. 2011-02-12 15:47:02 +00:00
setup.com 2009-09-01 Tristan Gingold <gingold@adacore.com> 2009-09-01 13:38:26 +00:00
src-release src-release: fix version look up for bfd based projects 2013-03-22 23:16:40 +00:00
symlink-tree 2005-07-14 Kelley Cook <kcook@gcc.gnu.org> 2005-07-14 01:24:56 +00:00
ylwrap Update automake-provided files in the toplevel. 2009-08-22 11:48:33 +00:00

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.