public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [commit] add some comments to testsuite/lib/gdb.exp
@ 2011-12-03 18:08 Doug Evans
  2011-12-03 18:39 ` Pedro Alves
  0 siblings, 1 reply; 8+ messages in thread
From: Doug Evans @ 2011-12-03 18:08 UTC (permalink / raw)
  To: gdb-patches

Hi.

In the process of cleaning up gdbserver testing I'm realizing
there is a bit of bitrot in stub testing.
gdbserver (e.g. the native-gdbserver.exp board file) uses it as a hack,
but it's a hack I'd like to remove.
Before that happens I want to do some cleanups of stub testing.

Here's a first step.

2011-12-03  Doug Evans  <dje@google.com>

	* gdb.exp (gdb_run_cmd, gdb_start_cmd, run_to_main): Add comments.
	(gdb_step_for_stub): Add comments.

Index: gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.194
diff -u -p -r1.194 gdb.exp
--- gdb.exp	2 Dec 2011 23:58:01 -0000	1.194
+++ gdb.exp	3 Dec 2011 17:50:11 -0000
@@ -187,14 +187,15 @@ proc delete_breakpoints {} {
     }
 }
 
-
-#
 # Generic run command.
 #
 # The second pattern below matches up to the first newline *only*.
 # Using ``.*$'' could swallow up output that we attempt to match
 # elsewhere.
 #
+# N.B. This function does not wait for gdb to return to the prompt,
+# that is the caller's responsibility.
+
 proc gdb_run_cmd {args} {
     global gdb_prompt
 
@@ -300,6 +301,9 @@ proc gdb_run_cmd {args} {
 
 # Generic start command.  Return 0 if we could start the program, -1
 # if we could not.
+#
+# N.B. This function does not wait for gdb to return to the prompt,
+# that is the caller's responsibility.
 
 proc gdb_start_cmd {args} {
     global gdb_prompt
@@ -451,12 +455,14 @@ proc runto { function args } {
     return 1
 }
 
+# Ask gdb to run until we hit a breakpoint at main.
+# The case where the target uses stubs has to be handled
+# specially--if it uses stubs, assuming we hit
+# breakpoint() and just step out of the function.
 #
-# runto_main -- ask gdb to run until we hit a breakpoint at main.
-#		The case where the target uses stubs has to be handled
-#		specially--if it uses stubs, assuming we hit
-#		breakpoint() and just step out of the function.
-#
+# N.B. This function deletes all existing breakpoints.
+# If you don't want that, use gdb_start_cmd.
+
 proc runto_main { } {
     global gdb_prompt
     global decimal
@@ -472,7 +478,6 @@ proc runto_main { } {
     return 1
 }
 
-
 ### Continue, and expect to hit a breakpoint.
 ### Report a pass or fail, depending on whether it seems to have
 ### worked.  Use NAME as part of the test name; each call to
@@ -3142,6 +3147,32 @@ proc setup_kfail_for_target { PR target 
     }
 }
 
+# Test programs for embedded (often "bare board") systems sometimes use a
+# "stub" either embedded in the test program itself or in the boot rom.
+# The job of the stub is to implement the remote protocol to communicate
+# with gdb and control the inferior.  To initiate the remote protocol
+# session with gdb the stub needs to be given control by the inferior.
+# They do this by calling a function that typically triggers a trap
+# from main that transfers control to the stub.
+# The purpose of this function, gdb_step_for_stub, is to step out of
+# that function ("breakpoint" in the example below) and back into main.
+#
+# Example:
+#
+# int
+# main ()
+# {
+# #ifdef usestubs
+#  set_debug_traps (); /* install trap handlers for stub */
+#  breakpoint (); /* trigger a trap to give the stub control */
+# #endif
+#  /* test program begins here */
+# }
+#
+# Note that one consequence of this design is that a breakpoint on "main"
+# does not Just Work (because if the target could stop there you still have
+# to step past the calls to set_debug_traps,breakpoint).
+
 proc gdb_step_for_stub { } {
     global gdb_prompt;
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [commit] add some comments to testsuite/lib/gdb.exp
  2011-12-03 18:08 [commit] add some comments to testsuite/lib/gdb.exp Doug Evans
@ 2011-12-03 18:39 ` Pedro Alves
  2011-12-03 18:55   ` Doug Evans
  0 siblings, 1 reply; 8+ messages in thread
From: Pedro Alves @ 2011-12-03 18:39 UTC (permalink / raw)
  To: gdb-patches; +Cc: Doug Evans

On Saturday 03 December 2011 18:07:50, Doug Evans wrote:

>  #
> -# runto_main -- ask gdb to run until we hit a breakpoint at main.
> -#              The case where the target uses stubs has to be handled
> -#              specially--if it uses stubs, assuming we hit
> -#              breakpoint() and just step out of the function.
> -#
> +# N.B. This function deletes all existing breakpoints.
> +# If you don't want that, use gdb_start_cmd.

"() use gdb_start_cmd.  Note that gdb_start_cmd doesn't work with
remote targets, so you will consequently need to skip your
test accordingly".


> +
>  proc runto_main { } {
>      global gdb_prompt
>      global decimal
> @@ -472,7 +478,6 @@ proc runto_main { } {
>      return 1
>  }
>  
> -
>  ### Continue, and expect to hit a breakpoint.
>  ### Report a pass or fail, depending on whether it seems to have
>  ### worked.  Use NAME as part of the test name; each call to
> @@ -3142,6 +3147,32 @@ proc setup_kfail_for_target { PR target 
>      }
>  }
>  
> +# Test programs for embedded (often "bare board") systems sometimes use a
> +# "stub" either embedded in the test program itself or in the boot rom.
> +# The job of the stub is to implement the remote protocol to communicate
> +# with gdb and control the inferior.  To initiate the remote protocol
> +# session with gdb the stub needs to be given control by the inferior.
> +# They do this by calling a function that typically triggers a trap
> +# from main that transfers control to the stub.
> +# The purpose of this function, gdb_step_for_stub, is to step out of
> +# that function ("breakpoint" in the example below) and back into main.
> +#
> +# Example:
> +#
> +# int
> +# main ()
> +# {
> +# #ifdef usestubs
> +#  set_debug_traps (); /* install trap handlers for stub */
> +#  breakpoint (); /* trigger a trap to give the stub control */
> +# #endif
> +#  /* test program begins here */
> +# }
> +#
> +# Note that one consequence of this design is that a breakpoint on "main"
> +# does not Just Work (because if the target could stop there you still have
> +# to step past the calls to set_debug_traps,breakpoint).
> +

I think your patch is fine.  Okay with me.

But I do wonder whether there is still anyone making use of this.
Can't we just zap all of the #ifdef usestubs bits?
There are zillions of tests that don't make have usestubs support
in their main.  It must be pretty broken?
All the stubs I've seen thus far that needed to do something magical,
did it transparently, before main is reached, e.g., with extra startup
glue, and board file magic, which IMO is the Right Way.

-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [commit] add some comments to testsuite/lib/gdb.exp
  2011-12-03 18:39 ` Pedro Alves
@ 2011-12-03 18:55   ` Doug Evans
  2011-12-03 19:40     ` Pedro Alves
  2011-12-04 13:16     ` [PATCH, docs RFA] Delete all use_stub support: gdb_step_for_stub, and calls to set_debug_traps etc. throughout (was: Re: [commit] add some comments to testsuite/lib/gdb.exp) Pedro Alves
  0 siblings, 2 replies; 8+ messages in thread
From: Doug Evans @ 2011-12-03 18:55 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On Sat, Dec 3, 2011 at 10:39 AM, Pedro Alves <pedro@codesourcery.com> wrote:
> But I do wonder whether there is still anyone making use of this.
> Can't we just zap all of the #ifdef usestubs bits?

I'll leave that to someone else.

> There are zillions of tests that don't make have usestubs support
> in their main.  It must be pretty broken?

Like I said, a bit of bitrot ...
[The usestubs way was inherently non-scalable and the bitrot will
always be inevitable.]

> All the stubs I've seen thus far that needed to do something magical,
> did it transparently, before main is reached, e.g., with extra startup
> glue, and board file magic, which IMO is the Right Way.

I think you'd be hard pressed to find someone who thought otherwise
these days ... no?
OTOH, I don't mind adding some comments to at least explain the
current code, even if the plan is to ultimately delete it.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [commit] add some comments to testsuite/lib/gdb.exp
  2011-12-03 18:55   ` Doug Evans
@ 2011-12-03 19:40     ` Pedro Alves
  2011-12-04 13:16     ` [PATCH, docs RFA] Delete all use_stub support: gdb_step_for_stub, and calls to set_debug_traps etc. throughout (was: Re: [commit] add some comments to testsuite/lib/gdb.exp) Pedro Alves
  1 sibling, 0 replies; 8+ messages in thread
From: Pedro Alves @ 2011-12-03 19:40 UTC (permalink / raw)
  To: Doug Evans; +Cc: gdb-patches

On Saturday 03 December 2011 18:55:06, Doug Evans wrote:

> OTOH, I don't mind adding some comments to at least explain the
> current code, even if the plan is to ultimately delete it.

As I said, I'm okay with your patch.

-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH, docs RFA] Delete all use_stub support: gdb_step_for_stub, and calls to set_debug_traps etc. throughout (was: Re: [commit] add some comments to testsuite/lib/gdb.exp)
  2011-12-03 18:55   ` Doug Evans
  2011-12-03 19:40     ` Pedro Alves
@ 2011-12-04 13:16     ` Pedro Alves
  2011-12-04 16:37       ` Eli Zaretskii
  2011-12-04 18:47       ` Doug Evans
  1 sibling, 2 replies; 8+ messages in thread
From: Pedro Alves @ 2011-12-04 13:16 UTC (permalink / raw)
  To: Doug Evans; +Cc: gdb-patches

On Saturday 03 December 2011 18:55:06, Doug Evans wrote:
> On Sat, Dec 3, 2011 at 10:39 AM, Pedro Alves <pedro@codesourcery.com> wrote:
> > But I do wonder whether there is still anyone making use of this.
> > Can't we just zap all of the #ifdef usestubs bits?
> 
> I'll leave that to someone else.

Like below.

Tested on x86_64-linux, native and local gdbserver.

> > There are zillions of tests that don't make have usestubs support
> > in their main.  It must be pretty broken?
> 
> Like I said, a bit of bitrot ...
> [The usestubs way was inherently non-scalable and the bitrot will
> always be inevitable.]
> 
> > All the stubs I've seen thus far that needed to do something magical,
> > did it transparently, before main is reached, e.g., with extra startup
> > glue, and board file magic, which IMO is the Right Way.
> 
> I think you'd be hard pressed to find someone who thought otherwise
> these days ... no?

gdb/doc/
2011-12-04  Pedro Alves  <pedro@codesourcery.com>

	* gdb.texinfo (Implementing a Remote Stub): Explain that you
	should transfer control to the stub in the startup code instead of
	in main.  Mention the need to get past the initial breakpoint.

gdb/testsuite/
2011-12-04  Pedro Alves  <pedro@codesourcery.com>

	* lib/gdb.exp (gdb_run_cmd, runto_main, gdb_compile)
	(clean_restart): Remove references to the gdb_stub target board
	variable.
	(gdb_step_for_stub): Delete.

	* gdb.base/annota1.exp: Remove all references to [target_info
	exists gdb_stub], gdb_step_for_stub and usestubs.
	* gdb.base/annota3.exp: Ditto.
	* gdb.base/async.exp: Ditto.
	* gdb.base/break.exp: Ditto.
	* gdb.base/code-expr.exp: Ditto.
	* gdb.base/commands.exp: Ditto.
	* gdb.base/completion.exp: Ditto.
	* gdb.base/condbreak.exp: Ditto.
	* gdb.base/consecutive.exp: Ditto.
	* gdb.base/cvexpr.exp: Ditto.
	* gdb.base/define.exp: Ditto.
	* gdb.base/display.exp: Ditto.
	* gdb.base/ena-dis-br.exp: Ditto.
	* gdb.base/environ.exp: Ditto.
	* gdb.base/gnu-ifunc.exp: Ditto.
	* gdb.base/maint.exp: Ditto.
	* gdb.base/pending.exp: Ditto.
	* gdb.base/sect-cmd.exp: Ditto.
	* gdb.base/sepdebug.exp: Ditto.
	* gdb.base/unload.exp: Ditto.
	* gdb.base/watchpoint-solib.exp: Ditto.
	* gdb.cp/annota2.exp: Ditto.
	* gdb.cp/annota3.exp: Ditto.
	* gdb.dwarf2/dw2-inline-param.exp: Ditto.
	* gdb.hp/gdb.compat/xdb1.exp: Ditto.
	* gdb.mi/mi-pending.exp: Ditto.
	* gdb.trace/circ.exp: Ditto.
	* gdb.cp/ovldbreak.exp: Ditto.  Adjust expected line numbers.
	* gdb.base/list.exp: Ditto.

	* gdb.base/all-types.c: Remove all calls to set_debug_traps and
	breakpoint function and all references to the usestubs macro.
	* gdb.base/exprs.c: Ditto.
	* gdb.base/freebpcmd.c: Ditto.
	* gdb.base/bitfields.c: Ditto.
	* gdb.base/bitfields2.c: Ditto.
	* gdb.base/break.c: Ditto.
	* gdb.base/call-sc.c: Ditto.
	* gdb.base/call-signals.c: Ditto.
	* gdb.base/callfuncs.c: Ditto.
	* gdb.base/charset.c: Ditto.
	* gdb.base/consecutive.c: Ditto.
	* gdb.base/constvars.c: Ditto.
	* gdb.base/funcargs.c: Ditto.
	* gdb.base/int-type.c: Ditto.
	* gdb.base/interrupt.c: Ditto.
	* gdb.base/langs0.c: Ditto.
	* gdb.base/list0.c: Ditto.
	* gdb.base/mips_pro.c: Ditto.
	* gdb.base/miscexprs.c: Ditto.
	* gdb.base/nodebug.c: Ditto.
	* gdb.base/opaque0.c: Ditto.
	* gdb.base/pointers.c: Ditto.
	* gdb.base/printcmds.c: Ditto.
	* gdb.base/ptype.c: Ditto.
	* gdb.base/recurse.c: Ditto.
	* gdb.base/reread1.c: Ditto.
	* gdb.base/reread2.c: Ditto.
	* gdb.base/restore.c: Ditto.
	* gdb.base/return.c: Ditto.
	* gdb.base/run.c: Ditto.
	* gdb.base/scope0.c: Ditto.
	* gdb.base/sepdebug.c: Ditto.
	* gdb.base/setshow.c: Ditto.
	* gdb.base/setvar.c: Ditto.
	* gdb.base/sigall.c: Ditto.
	* gdb.base/signals.c: Ditto.
	* gdb.base/structs.c: Ditto.
	* gdb.base/structs2.c: Ditto.
	* gdb.base/testenv.c: Ditto.
	* gdb.base/twice.c: Ditto.
	* gdb.base/unwindonsignal.c: Ditto.
	* gdb.base/watchpoint.c: Ditto.
	* gdb.base/watchpoints.c: Ditto.
	* gdb.base/whatis.c: Ditto.
	* gdb.cp/classes.cc: Ditto.
	* gdb.cp/cplusfuncs.cc: Ditto.
	* gdb.cp/derivation.cc: Ditto.
	* gdb.cp/formatted-ref.cc: Ditto.
	* gdb.cp/misc.cc: Ditto.
	* gdb.cp/overload.cc: Ditto.
	* gdb.cp/ovldbreak.cc: Ditto.
	* gdb.cp/ref-params.cc: Ditto.
	* gdb.cp/ref-types.cc: Ditto.
	* gdb.cp/templates.cc: Ditto.
	* gdb.cp/virtfunc.cc: Ditto.
	* gdb.hp/gdb.aCC/run.c: Ditto.
	* gdb.hp/gdb.base-hp/callfwmall.c: Ditto.
	* gdb.hp/gdb.compat/xdb0.c: Ditto.
	* gdb.reverse/consecutive-reverse.c: Ditto.
	* gdb.reverse/sigall-reverse.c: Ditto.
	* gdb.reverse/until-reverse.c: Ditto.
	* gdb.reverse/watch-reverse.c: Ditto.
	* gdb.trace/actions.c: Ditto.
	* gdb.trace/circ.c: Ditto.
	* gdb.trace/collection.c: Ditto.
---

 gdb/doc/gdb.texinfo                             |   15 ++-
 gdb/testsuite/gdb.base/all-types.c              |    4 -
 gdb/testsuite/gdb.base/annota1.exp              |    4 -
 gdb/testsuite/gdb.base/annota3.exp              |    4 -
 gdb/testsuite/gdb.base/async.exp                |    3 -
 gdb/testsuite/gdb.base/bitfields.c              |    4 -
 gdb/testsuite/gdb.base/bitfields2.c             |    5 -
 gdb/testsuite/gdb.base/break.c                  |    4 -
 gdb/testsuite/gdb.base/break.exp                |    9 --
 gdb/testsuite/gdb.base/call-sc.c                |    4 -
 gdb/testsuite/gdb.base/call-signals.c           |    5 -
 gdb/testsuite/gdb.base/callfuncs.c              |    4 -
 gdb/testsuite/gdb.base/charset.c                |    4 -
 gdb/testsuite/gdb.base/code-expr.exp            |    4 -
 gdb/testsuite/gdb.base/commands.exp             |    2 
 gdb/testsuite/gdb.base/completion.exp           |    2 
 gdb/testsuite/gdb.base/condbreak.exp            |    6 -
 gdb/testsuite/gdb.base/consecutive.c            |    4 -
 gdb/testsuite/gdb.base/consecutive.exp          |    4 -
 gdb/testsuite/gdb.base/constvars.c              |    4 -
 gdb/testsuite/gdb.base/cvexpr.exp               |    4 -
 gdb/testsuite/gdb.base/define.exp               |    2 
 gdb/testsuite/gdb.base/display.exp              |    3 -
 gdb/testsuite/gdb.base/ena-dis-br.exp           |    2 
 gdb/testsuite/gdb.base/environ.exp              |    2 
 gdb/testsuite/gdb.base/exprs.c                  |    4 -
 gdb/testsuite/gdb.base/freebpcmd.c              |    5 -
 gdb/testsuite/gdb.base/funcargs.c               |    4 -
 gdb/testsuite/gdb.base/gnu-ifunc.exp            |   25 ++---
 gdb/testsuite/gdb.base/int-type.c               |    5 -
 gdb/testsuite/gdb.base/interrupt.c              |    4 -
 gdb/testsuite/gdb.base/langs0.c                 |    4 -
 gdb/testsuite/gdb.base/list.exp                 |   16 +--
 gdb/testsuite/gdb.base/list0.c                  |    8 +
 gdb/testsuite/gdb.base/maint.exp                |    2 
 gdb/testsuite/gdb.base/mips_pro.c               |    4 -
 gdb/testsuite/gdb.base/miscexprs.c              |    5 -
 gdb/testsuite/gdb.base/nodebug.c                |    4 -
 gdb/testsuite/gdb.base/opaque0.c                |    4 -
 gdb/testsuite/gdb.base/pending.exp              |    3 -
 gdb/testsuite/gdb.base/pointers.c               |    4 -
 gdb/testsuite/gdb.base/printcmds.c              |    4 -
 gdb/testsuite/gdb.base/ptype.c                  |    4 -
 gdb/testsuite/gdb.base/recurse.c                |    4 -
 gdb/testsuite/gdb.base/reread1.c                |    4 -
 gdb/testsuite/gdb.base/reread2.c                |    4 -
 gdb/testsuite/gdb.base/restore.c                |    4 -
 gdb/testsuite/gdb.base/return.c                 |    4 -
 gdb/testsuite/gdb.base/run.c                    |    4 -
 gdb/testsuite/gdb.base/scope0.c                 |    4 -
 gdb/testsuite/gdb.base/sect-cmd.exp             |    2 
 gdb/testsuite/gdb.base/sepdebug.c               |    4 -
 gdb/testsuite/gdb.base/sepdebug.exp             |   16 ---
 gdb/testsuite/gdb.base/setshow.c                |    4 -
 gdb/testsuite/gdb.base/setvar.c                 |    4 -
 gdb/testsuite/gdb.base/sigall.c                 |    4 -
 gdb/testsuite/gdb.base/signals.c                |    4 -
 gdb/testsuite/gdb.base/structs.c                |    4 -
 gdb/testsuite/gdb.base/structs2.c               |    4 -
 gdb/testsuite/gdb.base/testenv.c                |    4 -
 gdb/testsuite/gdb.base/twice.c                  |    4 -
 gdb/testsuite/gdb.base/unload.exp               |    4 -
 gdb/testsuite/gdb.base/unwindonsignal.c         |    4 -
 gdb/testsuite/gdb.base/watchpoint-solib.exp     |    4 -
 gdb/testsuite/gdb.base/watchpoint.c             |    4 -
 gdb/testsuite/gdb.base/watchpoints.c            |    5 -
 gdb/testsuite/gdb.base/whatis.c                 |    4 -
 gdb/testsuite/gdb.cp/annota2.exp                |    4 -
 gdb/testsuite/gdb.cp/annota3.exp                |    4 -
 gdb/testsuite/gdb.cp/classes.cc                 |    4 -
 gdb/testsuite/gdb.cp/cplusfuncs.cc              |   11 --
 gdb/testsuite/gdb.cp/derivation.cc              |    6 -
 gdb/testsuite/gdb.cp/formatted-ref.cc           |    5 -
 gdb/testsuite/gdb.cp/misc.cc                    |    4 -
 gdb/testsuite/gdb.cp/overload.cc                |    5 -
 gdb/testsuite/gdb.cp/ovldbreak.cc               |    4 -
 gdb/testsuite/gdb.cp/ovldbreak.exp              |  123 ++++++++++++-----------
 gdb/testsuite/gdb.cp/ref-params.cc              |    5 -
 gdb/testsuite/gdb.cp/ref-types.cc               |    4 -
 gdb/testsuite/gdb.cp/templates.cc               |    5 -
 gdb/testsuite/gdb.cp/virtfunc.cc                |   10 --
 gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp   |    3 -
 gdb/testsuite/gdb.hp/gdb.aCC/run.c              |    4 -
 gdb/testsuite/gdb.hp/gdb.base-hp/callfwmall.c   |    4 -
 gdb/testsuite/gdb.hp/gdb.compat/xdb0.c          |    5 -
 gdb/testsuite/gdb.hp/gdb.compat/xdb1.exp        |    2 
 gdb/testsuite/gdb.mi/mi-pending.exp             |    4 -
 gdb/testsuite/gdb.reverse/consecutive-reverse.c |    4 -
 gdb/testsuite/gdb.reverse/sigall-reverse.c      |    5 -
 gdb/testsuite/gdb.reverse/until-reverse.c       |    4 -
 gdb/testsuite/gdb.reverse/watch-reverse.c       |    4 -
 gdb/testsuite/gdb.trace/actions.c               |    5 -
 gdb/testsuite/gdb.trace/circ.c                  |    8 -
 gdb/testsuite/gdb.trace/circ.exp                |    4 -
 gdb/testsuite/gdb.trace/collection.c            |    5 -
 gdb/testsuite/lib/gdb.exp                       |  118 ----------------------
 96 files changed, 102 insertions(+), 595 deletions(-)

diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index c6d58fb..90751cf 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -17537,8 +17537,8 @@ subroutines:
 @findex set_debug_traps
 @cindex remote serial stub, initialization
 This routine arranges for @code{handle_exception} to run when your
-program stops.  You must call this subroutine explicitly near the
-beginning of your program.
+program stops.  You must call this subroutine explicitly in your
+program's startup code.
 
 @item handle_exception
 @findex handle_exception
@@ -17684,13 +17684,22 @@ Make sure you have defined the supporting low-level routines
 @end display
 
 @item
-Insert these lines near the top of your program:
+Insert these lines in your program's startup code, before the main
+procedure is called:
 
 @smallexample
 set_debug_traps();
 breakpoint();
 @end smallexample
 
+On some machines, when a breakpoint trap is raised, the hardware
+automatically makes the PC point to the instruction after the
+breakpoint.  If your machine doesn't do that, you may need to adjust
+@code{handle_exception} to arrange for it to return to the instruction
+after the breakpoint on this first invocation, so that your program
+doesn't keep hitting the initial breakpoint instead of making
+progress.
+
 @item
 For the 680x0 stub only, you need to provide a variable called
 @code{exceptionHook}.  Normally you just use:
diff --git a/gdb/testsuite/gdb.base/all-types.c b/gdb/testsuite/gdb.base/all-types.c
index 2f3a31f..570fd43 100644
--- a/gdb/testsuite/gdb.base/all-types.c
+++ b/gdb/testsuite/gdb.base/all-types.c
@@ -28,10 +28,6 @@ double		v_double;
 int main ()
 {
     extern void dummy();
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
     dummy();
     return 0;
     
diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp
index 9ceeeac..787eb80 100644
--- a/gdb/testsuite/gdb.base/annota1.exp
+++ b/gdb/testsuite/gdb.base/annota1.exp
@@ -50,10 +50,6 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 #
 # the line at which break main will put the breakpoint
 #
diff --git a/gdb/testsuite/gdb.base/annota3.exp b/gdb/testsuite/gdb.base/annota3.exp
index 8ec18a9..7767b1d 100644
--- a/gdb/testsuite/gdb.base/annota3.exp
+++ b/gdb/testsuite/gdb.base/annota3.exp
@@ -50,10 +50,6 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 #
 # the line at which break main will put the breakpoint
 #
diff --git a/gdb/testsuite/gdb.base/async.exp b/gdb/testsuite/gdb.base/async.exp
index d894a08..b35926d 100644
--- a/gdb/testsuite/gdb.base/async.exp
+++ b/gdb/testsuite/gdb.base/async.exp
@@ -56,9 +56,6 @@ gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
 
 #
 # set it up at a breakpoint so we can play with it
diff --git a/gdb/testsuite/gdb.base/bitfields.c b/gdb/testsuite/gdb.base/bitfields.c
index 3b5e42c..ed1634c 100644
--- a/gdb/testsuite/gdb.base/bitfields.c
+++ b/gdb/testsuite/gdb.base/bitfields.c
@@ -78,10 +78,6 @@ int main ()
   /* For each member, set that member to 1, allow gdb to verify that the
      member (and only that member) is 1, and then reset it back to 0. */
 
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   flags.uc = 1;
   break1 ();
   flags.uc = 0;
diff --git a/gdb/testsuite/gdb.base/bitfields2.c b/gdb/testsuite/gdb.base/bitfields2.c
index 1958ef0..edb3b9f 100644
--- a/gdb/testsuite/gdb.base/bitfields2.c
+++ b/gdb/testsuite/gdb.base/bitfields2.c
@@ -162,10 +162,7 @@ void tester ()
 int main () 
 {
   int i;
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
+
   for (i = 0; i < 5; i += 1)
     tester ();
   return 0;
diff --git a/gdb/testsuite/gdb.base/break.c b/gdb/testsuite/gdb.base/break.c
index 3b9f6e2..d33ed15 100644
--- a/gdb/testsuite/gdb.base/break.c
+++ b/gdb/testsuite/gdb.base/break.c
@@ -86,10 +86,6 @@ int argc;
 char *argv[], **envp;
 #endif
 {
-#ifdef usestubs
-    set_debug_traps();  /* set breakpoint 5 here */
-    breakpoint();
-#endif
     if (argc == 12345) {  /* an unlikely value < 2^16, in case uninited */ /* set breakpoint 6 here */
 	fprintf (stderr, "usage:  factorial <number>\n");
 	return 1;
diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp
index 92fcc69..1e3d5eb 100644
--- a/gdb/testsuite/gdb.base/break.exp
+++ b/gdb/testsuite/gdb.base/break.exp
@@ -119,14 +119,7 @@ gdb_test "break multi_line_while_conditional" \
 set bp_location5 [gdb_get_line_number "set breakpoint 5 here"]
 set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
 
-#
-# check to see what breakpoints are set
-#
-if [target_info exists gdb_stub] {
-    set main_line $bp_location5
-} else {
-    set main_line $bp_location6
-}
+set main_line $bp_location6
 
 if {$hp_aCC_compiler} {
     set proto "\\(int\\)"
diff --git a/gdb/testsuite/gdb.base/call-sc.c b/gdb/testsuite/gdb.base/call-sc.c
index 951e101..dd2b8ea 100644
--- a/gdb/testsuite/gdb.base/call-sc.c
+++ b/gdb/testsuite/gdb.base/call-sc.c
@@ -58,10 +58,6 @@ zed ()
 
 int main()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   int i;
 
   Fun(foo);	
diff --git a/gdb/testsuite/gdb.base/call-signals.c b/gdb/testsuite/gdb.base/call-signals.c
index 23f0a31..d775853 100644
--- a/gdb/testsuite/gdb.base/call-signals.c
+++ b/gdb/testsuite/gdb.base/call-signals.c
@@ -58,11 +58,6 @@ null_hand_call ()
 int
 main ()
 {
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
-
 #ifdef SIG_SETMASK
   /* Ensure all the signals aren't blocked.
      The environment in which the testsuite is run may have blocked some
diff --git a/gdb/testsuite/gdb.base/callfuncs.c b/gdb/testsuite/gdb.base/callfuncs.c
index f764b82..58eaa77 100644
--- a/gdb/testsuite/gdb.base/callfuncs.c
+++ b/gdb/testsuite/gdb.base/callfuncs.c
@@ -646,10 +646,6 @@ struct struct_with_fnptr *function_struct_ptr = &function_struct;
 
 int main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   malloc(1);
   t_double_values(double_val1, double_val2);
   t_structs_c(struct_val1);
diff --git a/gdb/testsuite/gdb.base/charset.c b/gdb/testsuite/gdb.base/charset.c
index df56c45..57107c6 100644
--- a/gdb/testsuite/gdb.base/charset.c
+++ b/gdb/testsuite/gdb.base/charset.c
@@ -124,10 +124,6 @@ extern void malloc_stub (void);
 
 int main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
 
   malloc_stub ();
 
diff --git a/gdb/testsuite/gdb.base/code-expr.exp b/gdb/testsuite/gdb.base/code-expr.exp
index b5cddaa..a280fe4 100644
--- a/gdb/testsuite/gdb.base/code-expr.exp
+++ b/gdb/testsuite/gdb.base/code-expr.exp
@@ -41,10 +41,6 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 gdb_test_no_output "set print sevenbit-strings"
 gdb_test_no_output "set print address off"
 gdb_test_no_output "set width 0"
diff --git a/gdb/testsuite/gdb.base/commands.exp b/gdb/testsuite/gdb.base/commands.exp
index b4b14b5..3927e84 100644
--- a/gdb/testsuite/gdb.base/commands.exp
+++ b/gdb/testsuite/gdb.base/commands.exp
@@ -319,7 +319,7 @@ proc watchpoint_command_test {} {
 	    # scope.
 	    fail $test
 	}
- 	-re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the program has left the block in.*which its expression is valid.*run.c:(57|82).*$gdb_prompt $" {
+	-re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the program has left the block in.*which its expression is valid.*run.c:(53|77).*$gdb_prompt $" {
 	    pass $test
 	}
    }
diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp
index 030a912..5825139 100644
--- a/gdb/testsuite/gdb.base/completion.exp
+++ b/gdb/testsuite/gdb.base/completion.exp
@@ -51,8 +51,6 @@ if $tracelevel then {
         }
 
 
-global usestubs
-
 #
 # test running programs
 #
diff --git a/gdb/testsuite/gdb.base/condbreak.exp b/gdb/testsuite/gdb.base/condbreak.exp
index b8b38a4..1e3014c 100644
--- a/gdb/testsuite/gdb.base/condbreak.exp
+++ b/gdb/testsuite/gdb.base/condbreak.exp
@@ -22,8 +22,6 @@ if $tracelevel then {
 	strace $tracelevel
 	}
 
-global usestubs
-
 #
 # test running programs
 #
@@ -58,10 +56,6 @@ gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 set bp_location1  [gdb_get_line_number "set breakpoint 1 here"]
 set bp_location6  [gdb_get_line_number "set breakpoint 6 here"]
 set bp_location8  [gdb_get_line_number "set breakpoint 8 here" $srcfile1]
diff --git a/gdb/testsuite/gdb.base/consecutive.c b/gdb/testsuite/gdb.base/consecutive.c
index bfea429..7d0cea9 100644
--- a/gdb/testsuite/gdb.base/consecutive.c
+++ b/gdb/testsuite/gdb.base/consecutive.c
@@ -12,9 +12,5 @@ int foo ()
 
 main()
 {
-#ifdef usestubs
-    set_debug_traps ();
-    breakpoint ();
-#endif
   foo ();
 }
diff --git a/gdb/testsuite/gdb.base/consecutive.exp b/gdb/testsuite/gdb.base/consecutive.exp
index 34ac2dd..515b76a 100644
--- a/gdb/testsuite/gdb.base/consecutive.exp
+++ b/gdb/testsuite/gdb.base/consecutive.exp
@@ -43,10 +43,6 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 if ![runto_main] then {
     perror "couldn't run to breakpoint"
     continue
diff --git a/gdb/testsuite/gdb.base/constvars.c b/gdb/testsuite/gdb.base/constvars.c
index 289b8e7..4228822 100644
--- a/gdb/testsuite/gdb.base/constvars.c
+++ b/gdb/testsuite/gdb.base/constvars.c
@@ -191,10 +191,6 @@ main (void)
   const char           & radiation = laconic;
   volatile signed char & remuneration = lemonade;
   */
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
   marker1 ();
     
 
diff --git a/gdb/testsuite/gdb.base/cvexpr.exp b/gdb/testsuite/gdb.base/cvexpr.exp
index 34645dc..b9c9719 100644
--- a/gdb/testsuite/gdb.base/cvexpr.exp
+++ b/gdb/testsuite/gdb.base/cvexpr.exp
@@ -41,10 +41,6 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 gdb_test_no_output "set print sevenbit-strings"
 gdb_test_no_output "set print address off"
 gdb_test_no_output "set width 0"
diff --git a/gdb/testsuite/gdb.base/define.exp b/gdb/testsuite/gdb.base/define.exp
index 89519cb..414e9db 100644
--- a/gdb/testsuite/gdb.base/define.exp
+++ b/gdb/testsuite/gdb.base/define.exp
@@ -20,8 +20,6 @@ if $tracelevel then {
 	strace $tracelevel
 	}
 
-global usestubs
-
 
 #
 # test running programs
diff --git a/gdb/testsuite/gdb.base/display.exp b/gdb/testsuite/gdb.base/display.exp
index fcf8511..566326c 100644
--- a/gdb/testsuite/gdb.base/display.exp
+++ b/gdb/testsuite/gdb.base/display.exp
@@ -31,9 +31,6 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
     untested display.exp
     return -1
 }
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
 
 # Preserve the old timeout, and set a new one that should be
 # sufficient to avoid timing out during this test.
diff --git a/gdb/testsuite/gdb.base/ena-dis-br.exp b/gdb/testsuite/gdb.base/ena-dis-br.exp
index 46713b9..6461344 100644
--- a/gdb/testsuite/gdb.base/ena-dis-br.exp
+++ b/gdb/testsuite/gdb.base/ena-dis-br.exp
@@ -20,8 +20,6 @@ if $tracelevel then {
     strace $tracelevel
 }
 
-global usestubs
-
 #
 # test running programs
 #
diff --git a/gdb/testsuite/gdb.base/environ.exp b/gdb/testsuite/gdb.base/environ.exp
index 3160b17..f039712 100644
--- a/gdb/testsuite/gdb.base/environ.exp
+++ b/gdb/testsuite/gdb.base/environ.exp
@@ -18,8 +18,6 @@ if $tracelevel then {
 	strace $tracelevel
 	}
 
-global usestubs
-
 #
 # test running programs
 #
diff --git a/gdb/testsuite/gdb.base/exprs.c b/gdb/testsuite/gdb.base/exprs.c
index 34d2780..90c0f25 100644
--- a/gdb/testsuite/gdb.base/exprs.c
+++ b/gdb/testsuite/gdb.base/exprs.c
@@ -8,10 +8,6 @@ main (argc, argv, envp)
 #endif
 {
     extern void dummy();
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
     dummy();
     return 0;
     
diff --git a/gdb/testsuite/gdb.base/freebpcmd.c b/gdb/testsuite/gdb.base/freebpcmd.c
index 80b8d9e..7593afd 100644
--- a/gdb/testsuite/gdb.base/freebpcmd.c
+++ b/gdb/testsuite/gdb.base/freebpcmd.c
@@ -24,11 +24,6 @@ main (int argc, char **argv)
 {
   int i;
 
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
-
   for (i = 0; i < 100; i++)
     printf (">>> %d\n", i); /* euphonium */
 
diff --git a/gdb/testsuite/gdb.base/funcargs.c b/gdb/testsuite/gdb.base/funcargs.c
index 6d16b62..b34f3fb 100644
--- a/gdb/testsuite/gdb.base/funcargs.c
+++ b/gdb/testsuite/gdb.base/funcargs.c
@@ -837,10 +837,6 @@ int main ()
   void (*pointer_to_call0a) (char, short, int, long) = (void (*)(char, short, int, long))call0a;
   double (*pointer_to_call_with_trampolines) (double) = call_with_trampolines;
 
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   /* Test calling with basic integer types */
   call0a (c, s, i, l);
   call0b (s, i, l, c);
diff --git a/gdb/testsuite/gdb.base/gnu-ifunc.exp b/gdb/testsuite/gdb.base/gnu-ifunc.exp
index 4fcc3bf..2e95bee 100644
--- a/gdb/testsuite/gdb.base/gnu-ifunc.exp
+++ b/gdb/testsuite/gdb.base/gnu-ifunc.exp
@@ -127,20 +127,17 @@ gdb_test "info sym $expect_out(1,string)" "gnu_ifunc in section .*" "info sym <g
 # Test statically linked ifunc resolving during inferior start.
 # https://bugzilla.redhat.com/show_bug.cgi?id=624967
 
-if ![target_info exists gdb_stub] {
+# Compile $staticbinfile separately as it may exit on error (ld/12595).
 
-    # Compile $staticbinfile separately as it may exit on error (ld/12595).
-
-    if { [gdb_compile ${srcdir}/${subdir}/$libsrc $lib_o object {}] != ""
-	 || [gdb_compile "${srcdir}/${subdir}/$srcfile $lib_o" $staticbinfile executable {debug}] != "" } {
-	untested "Could not compile static executable $staticbinfile."
-	return -1
-    }
+if { [gdb_compile ${srcdir}/${subdir}/$libsrc $lib_o object {}] != ""
+     || [gdb_compile "${srcdir}/${subdir}/$srcfile $lib_o" $staticbinfile executable {debug}] != "" } {
+    untested "Could not compile static executable $staticbinfile."
+    return -1
+}
 
-    clean_restart $staticexecutable
+clean_restart $staticexecutable
 
-    gdb_breakpoint "gnu_ifunc"
-    gdb_breakpoint "main"
-    gdb_run_cmd
-    gdb_test "" "Breakpoint \[0-9\]*, main .*" "static gnu_ifunc"
-}
+gdb_breakpoint "gnu_ifunc"
+gdb_breakpoint "main"
+gdb_run_cmd
+gdb_test "" "Breakpoint \[0-9\]*, main .*" "static gnu_ifunc"
diff --git a/gdb/testsuite/gdb.base/int-type.c b/gdb/testsuite/gdb.base/int-type.c
index 548ca9c..da7eec0 100644
--- a/gdb/testsuite/gdb.base/int-type.c
+++ b/gdb/testsuite/gdb.base/int-type.c
@@ -9,11 +9,6 @@ int w;
 int main ()
 {
    
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
-
     x = 14;
     y = 3;
     z = 2;
diff --git a/gdb/testsuite/gdb.base/interrupt.c b/gdb/testsuite/gdb.base/interrupt.c
index 80b9060..d7bb271 100644
--- a/gdb/testsuite/gdb.base/interrupt.c
+++ b/gdb/testsuite/gdb.base/interrupt.c
@@ -17,10 +17,6 @@ main ()
 {
   char x;
   int nbytes;
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
 #ifdef SIGNALS
   signal (SIGINT, sigint_handler);
 #endif
diff --git a/gdb/testsuite/gdb.base/langs0.c b/gdb/testsuite/gdb.base/langs0.c
index 1477a32..cc6efdd 100644
--- a/gdb/testsuite/gdb.base/langs0.c
+++ b/gdb/testsuite/gdb.base/langs0.c
@@ -22,10 +22,6 @@ langs0__2do ()
 int
 main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   if (langs0__2do () == 5003)
     /* Success.  */
     return 0;
diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp
index 5b9fe15..78469df 100644
--- a/gdb/testsuite/gdb.base/list.exp
+++ b/gdb/testsuite/gdb.base/list.exp
@@ -98,7 +98,7 @@ proc test_listsize {} {
 	runto_main;
 	unsupported "list default lines around main";
     } else {
-	gdb_test "list" "(1\[ \t\]+#include \"list0.h\".*10\[ \t\]+x = 0;|2.*11\[ \t\]+foo .x\[+)\]+;)" "list default lines around main"
+	gdb_test "list" "(1\[ \t\]+#include \"list0.h\".*7\[ \t\]+x = 0;\r\n.*10\[ \t\]+foo .x\[+)\]+;)" "list default lines around main"
     }
 
     # Ensure we can limit printouts to one line
@@ -179,7 +179,7 @@ proc test_list_filename_and_number {} {
 
     send_gdb "list list0.c:1\n"
     gdb_expect {
-	-re "1\[ \t\]+#include \"list0.h\".*10\[ \t]+x = 0;\r\n$gdb_prompt $" {
+	-re "1\[ \t\]+#include \"list0.h\".*10\[ \t\]+foo .x\[+)\]+;\r\n$gdb_prompt $" {
 	    incr testcnt 
 	}
 	-re ".*$gdb_prompt $" { fail "list list0.c:1" ; gdb_suppress_tests }
@@ -223,7 +223,7 @@ proc test_list_function {} {
     # gcc appears to generate incorrect debugging information for code
     # in include files, which breaks this test.
     # SunPRO cc is the second case below, it's also correct.
-    gdb_test "list main" "(5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;|1\[ \t\]+#include .*10\[ \t\]+x = 0;)" "list function in source file 1"
+    gdb_test "list main" "(5\[ \t\]+int x;.*8\[ \t\]+foo \[(\]+.*\[)\]+;|1\[ \t\]+#include .*7\[ \t\]+x = 0;)" "list function in source file 1"
 
     # Ultrix gdb takes the second case below; it's also correct.
     # SunPRO cc is the third case.
@@ -335,14 +335,14 @@ proc test_list_backwards {} {
 
     send_gdb "list -\n"
     gdb_expect {
-	-re "8\[ \t\]+breakpoint\[(\]\[)\];.*17\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
+	-re "8\[ \t\]+foo \[(\]+.*\[)\]+;.*17\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
 	-re ".*$gdb_prompt $" { fail "list 8-17" ; gdb_suppress_tests }
 	timeout { fail "list 8-17 (timeout)" ; gdb_suppress_tests }
     }
 
     send_gdb "list -\n"
     gdb_expect {
-	-re "1\[ \t\]+#include .*7\[ \t\]+set_debug_traps\[(\]\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
+	-re "1\[ \t\]+#include .*7\[ \t\]+x = 0;\r\n$gdb_prompt $" { incr testcnt }
 	-re ".*$gdb_prompt $" { fail "list 1-7" ; gdb_suppress_tests }
 	timeout { fail "list 1-7 (timeout)" ; gdb_suppress_tests }
     }
@@ -387,7 +387,7 @@ proc test_list_filename_and_function {} {
     # SunPRO cc is the second case below, it's also correct.
     send_gdb "list list0.c:main\n"
     gdb_expect {
-	-re "1\[ \t\]+#include .*10\[ \t\]+x = 0;\r\n$gdb_prompt $" {
+	-re "1\[ \t\]+#include .*10\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
 	    incr testcnt
 	}
 	-re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
@@ -524,10 +524,6 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 gdb_test_no_output "set width 0"
 
 test_listsize
diff --git a/gdb/testsuite/gdb.base/list0.c b/gdb/testsuite/gdb.base/list0.c
index b50fdd4..85fc6b5 100644
--- a/gdb/testsuite/gdb.base/list0.c
+++ b/gdb/testsuite/gdb.base/list0.c
@@ -3,10 +3,7 @@
 int main ()
 {
     int x;
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
+
     x = 0;
     foo (x++);
     foo (x++);
@@ -33,6 +30,9 @@ int main ()
     foo (x++);
     foo (x++);
     foo (x++);
+    foo (x++);
+    foo (x++);
+    foo (x++);
     return 0;
 }
 
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index befcdba..2fc40f7 100644
--- a/gdb/testsuite/gdb.base/maint.exp
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -52,8 +52,6 @@ if $tracelevel then {
         strace $tracelevel
         }
 
-global usestubs
-
 set testfile "break"
 set srcfile ${testfile}.c
 set srcfile1 ${testfile}1.c
diff --git a/gdb/testsuite/gdb.base/mips_pro.c b/gdb/testsuite/gdb.base/mips_pro.c
index b659d82..c28f99e 100644
--- a/gdb/testsuite/gdb.base/mips_pro.c
+++ b/gdb/testsuite/gdb.base/mips_pro.c
@@ -49,9 +49,5 @@ main (argc, argv)
      char **argv;
 #endif
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   return top (-1) + top (1);
 }
diff --git a/gdb/testsuite/gdb.base/miscexprs.c b/gdb/testsuite/gdb.base/miscexprs.c
index fe88fb2..a9930c1 100644
--- a/gdb/testsuite/gdb.base/miscexprs.c
+++ b/gdb/testsuite/gdb.base/miscexprs.c
@@ -39,11 +39,6 @@ main ()
   sbig.s[90] = 255;
   lbig.l[333] = 999999999;
     
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
-
   marker1 ();
   return 0;
 }
diff --git a/gdb/testsuite/gdb.base/nodebug.c b/gdb/testsuite/gdb.base/nodebug.c
index 3e0a4ce..4857882 100644
--- a/gdb/testsuite/gdb.base/nodebug.c
+++ b/gdb/testsuite/gdb.base/nodebug.c
@@ -52,10 +52,6 @@ main (argc, argv)
      char **argv;
 #endif
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   return top (argc);
 }
 
diff --git a/gdb/testsuite/gdb.base/opaque0.c b/gdb/testsuite/gdb.base/opaque0.c
index 5ec4a2a..bf90eca 100644
--- a/gdb/testsuite/gdb.base/opaque0.c
+++ b/gdb/testsuite/gdb.base/opaque0.c
@@ -13,10 +13,6 @@ extern void putfoo (struct foo *foop);
 
 int main ()
 {
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
     foop = getfoo ();
     putfoo (foop);
     return 0;
diff --git a/gdb/testsuite/gdb.base/pending.exp b/gdb/testsuite/gdb.base/pending.exp
index d711e63..62297ce 100644
--- a/gdb/testsuite/gdb.base/pending.exp
+++ b/gdb/testsuite/gdb.base/pending.exp
@@ -85,9 +85,6 @@ gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 gdb_load_shlibs $lib_sl
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
 #
 # Test setting, querying, and modifying pending breakpoints
 #
diff --git a/gdb/testsuite/gdb.base/pointers.c b/gdb/testsuite/gdb.base/pointers.c
index 4ee5e78..96f2b52 100644
--- a/gdb/testsuite/gdb.base/pointers.c
+++ b/gdb/testsuite/gdb.base/pointers.c
@@ -91,10 +91,6 @@ int main ()
   void dummy();
   int more_code();
   
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   dummy();
 
   more_code ();
diff --git a/gdb/testsuite/gdb.base/printcmds.c b/gdb/testsuite/gdb.base/printcmds.c
index b3841ae..d37dfbd 100644
--- a/gdb/testsuite/gdb.base/printcmds.c
+++ b/gdb/testsuite/gdb.base/printcmds.c
@@ -122,10 +122,6 @@ struct some_struct
 
 int main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   malloc(1);
 
   /* Prevent AIX linker from removing variables.  */
diff --git a/gdb/testsuite/gdb.base/ptype.c b/gdb/testsuite/gdb.base/ptype.c
index b154ab4..4148da7 100644
--- a/gdb/testsuite/gdb.base/ptype.c
+++ b/gdb/testsuite/gdb.base/ptype.c
@@ -290,10 +290,6 @@ int main ()
      sure it is linked in to this program.  */
   v_char_pointer = (char *) malloc (1);
 
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   /* Some linkers (e.g. on AIX) remove unreferenced variables,
      so make sure to reference them. */
   primary = blue;
diff --git a/gdb/testsuite/gdb.base/recurse.c b/gdb/testsuite/gdb.base/recurse.c
index 7981778..cb7b022 100644
--- a/gdb/testsuite/gdb.base/recurse.c
+++ b/gdb/testsuite/gdb.base/recurse.c
@@ -22,10 +22,6 @@ recurse (a)
 
 int main()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   recurse (10);
   return 0;
 }
diff --git a/gdb/testsuite/gdb.base/reread1.c b/gdb/testsuite/gdb.base/reread1.c
index ae98010..5d1166a 100644
--- a/gdb/testsuite/gdb.base/reread1.c
+++ b/gdb/testsuite/gdb.base/reread1.c
@@ -16,10 +16,6 @@ void foo()
 
 int main()
 {
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
   foo();
   bar();
   return 0;
diff --git a/gdb/testsuite/gdb.base/reread2.c b/gdb/testsuite/gdb.base/reread2.c
index fd9f7b7..181616c 100644
--- a/gdb/testsuite/gdb.base/reread2.c
+++ b/gdb/testsuite/gdb.base/reread2.c
@@ -12,10 +12,6 @@ void foo()
 
 int main()
 {
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
   foo();
   return 0;
 }
diff --git a/gdb/testsuite/gdb.base/restore.c b/gdb/testsuite/gdb.base/restore.c
index 5160836..c9f246c 100644
--- a/gdb/testsuite/gdb.base/restore.c
+++ b/gdb/testsuite/gdb.base/restore.c
@@ -269,10 +269,6 @@ driver (void)
 int main ()
 {
   register int local;
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   driver ();
   printf("exiting\n");
   return 0;
diff --git a/gdb/testsuite/gdb.base/return.c b/gdb/testsuite/gdb.base/return.c
index d11a4b5..04b48d2 100644
--- a/gdb/testsuite/gdb.base/return.c
+++ b/gdb/testsuite/gdb.base/return.c
@@ -23,10 +23,6 @@ double tmp3;
 
 int main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   func1 ();
   printf("in main after func1\n");
   tmp2 = func2 ();
diff --git a/gdb/testsuite/gdb.base/run.c b/gdb/testsuite/gdb.base/run.c
index 25b8a4a..c1c3a1b 100644
--- a/gdb/testsuite/gdb.base/run.c
+++ b/gdb/testsuite/gdb.base/run.c
@@ -49,10 +49,6 @@ int argc;
 char *argv[], **envp;
 #endif
 {
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
 #ifdef FAKEARGV
     printf ("%d\n", factorial (1));
 #else    
diff --git a/gdb/testsuite/gdb.base/scope0.c b/gdb/testsuite/gdb.base/scope0.c
index 180a431..775f8dc 100644
--- a/gdb/testsuite/gdb.base/scope0.c
+++ b/gdb/testsuite/gdb.base/scope0.c
@@ -20,10 +20,6 @@ void marker4 ();
 
 int main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   init0 ();
   foo ();
   autovars (5, 6);
diff --git a/gdb/testsuite/gdb.base/sect-cmd.exp b/gdb/testsuite/gdb.base/sect-cmd.exp
index 5c51c1e..73590b1 100644
--- a/gdb/testsuite/gdb.base/sect-cmd.exp
+++ b/gdb/testsuite/gdb.base/sect-cmd.exp
@@ -18,8 +18,6 @@ if $tracelevel then {
 	strace $tracelevel
 	}
 
-global usestubs
-
 #
 # test running programs
 #
diff --git a/gdb/testsuite/gdb.base/sepdebug.c b/gdb/testsuite/gdb.base/sepdebug.c
index 83f6ba4..6d2bc96 100644
--- a/gdb/testsuite/gdb.base/sepdebug.c
+++ b/gdb/testsuite/gdb.base/sepdebug.c
@@ -84,10 +84,6 @@ int argc;
 char *argv[], **envp;
 #endif
 {
-#ifdef usestubs
-    set_debug_traps();  /* set breakpoint 5 here */
-    breakpoint();
-#endif
     if (argc == 12345) {  /* an unlikely value < 2^16, in case uninited */ /* set breakpoint 6 here */
 	fprintf (stderr, "usage:  factorial <number>\n");
 	return 1;
diff --git a/gdb/testsuite/gdb.base/sepdebug.exp b/gdb/testsuite/gdb.base/sepdebug.exp
index 1a9072d..f398707 100644
--- a/gdb/testsuite/gdb.base/sepdebug.exp
+++ b/gdb/testsuite/gdb.base/sepdebug.exp
@@ -64,9 +64,6 @@ if { $gdb_file_cmd_debug_info != "debug" } then {
     fail "No debug information found."
 }
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
 #
 # test simple breakpoint setting commands
 #
@@ -144,14 +141,7 @@ gdb_test "break multi_line_while_conditional" \
 set bp_location5 [gdb_get_line_number "set breakpoint 5 here"]
 set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
 
-#
-# check to see what breakpoints are set
-#
-if [target_info exists gdb_stub] {
-    set main_line $bp_location5
-} else {
-    set main_line $bp_location6
-}
+set main_line $bp_location6
 
 set bp_location7 [gdb_get_line_number "set breakpoint 7 here"]
 set bp_location8 [gdb_get_line_number "set breakpoint 8 here"]
@@ -672,10 +662,6 @@ proc test_different_dir {type test_different_dir xfail} {
 	"set separate debug location"
     gdb_load ${binfile}
 
-    if [target_info exists gdb_stub] {
-	gdb_step_for_stub;
-    }
-
     #
     # test break at function
     #
diff --git a/gdb/testsuite/gdb.base/setshow.c b/gdb/testsuite/gdb.base/setshow.c
index fbaba0f..a30ef82 100644
--- a/gdb/testsuite/gdb.base/setshow.c
+++ b/gdb/testsuite/gdb.base/setshow.c
@@ -14,10 +14,6 @@ main(argc, argv)
 #endif
 {
   int i = 1;
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
 
   if (argc <= 0 || argc > 8)
     return -1;
diff --git a/gdb/testsuite/gdb.base/setvar.c b/gdb/testsuite/gdb.base/setvar.c
index 969de0d..83509cd 100644
--- a/gdb/testsuite/gdb.base/setvar.c
+++ b/gdb/testsuite/gdb.base/setvar.c
@@ -10,10 +10,6 @@ main (argc, argv, envp)
 #endif
 {
     extern void dummy();
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
     dummy();
     return 0;
 }
diff --git a/gdb/testsuite/gdb.base/sigall.c b/gdb/testsuite/gdb.base/sigall.c
index 28ae192..92ebc6b 100644
--- a/gdb/testsuite/gdb.base/sigall.c
+++ b/gdb/testsuite/gdb.base/sigall.c
@@ -1577,10 +1577,6 @@ return 0;
 int
 main ()
 {
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
 
 #ifdef SIG_SETMASK
   /* Ensure all the signals aren't blocked.
diff --git a/gdb/testsuite/gdb.base/signals.c b/gdb/testsuite/gdb.base/signals.c
index f1ebcfc..d97719c 100644
--- a/gdb/testsuite/gdb.base/signals.c
+++ b/gdb/testsuite/gdb.base/signals.c
@@ -38,10 +38,6 @@ func2 ()
 int
 main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
 #ifdef SIGALRM
   signal (SIGALRM, handler);
 #endif
diff --git a/gdb/testsuite/gdb.base/structs.c b/gdb/testsuite/gdb.base/structs.c
index c26b86c..df4dfa9 100644
--- a/gdb/testsuite/gdb.base/structs.c
+++ b/gdb/testsuite/gdb.base/structs.c
@@ -401,10 +401,6 @@ static struct { char c; } chartest[256];
 
 int main()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   int i;
 
   for (i = 0; i < 256; i++)
diff --git a/gdb/testsuite/gdb.base/structs2.c b/gdb/testsuite/gdb.base/structs2.c
index f1eeab1..7c8be03 100644
--- a/gdb/testsuite/gdb.base/structs2.c
+++ b/gdb/testsuite/gdb.base/structs2.c
@@ -10,10 +10,6 @@ int bkpt;
 int
 main ()
 {
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
 
   bkpt = 0;
   param_reg (120, 130, 32000, 33000);
diff --git a/gdb/testsuite/gdb.base/testenv.c b/gdb/testsuite/gdb.base/testenv.c
index 83f7e9c..2e29a85 100755
--- a/gdb/testsuite/gdb.base/testenv.c
+++ b/gdb/testsuite/gdb.base/testenv.c
@@ -27,10 +27,6 @@ int main (int argc, char **argv, char **envp)
 
 {
     int i, j;
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
 
     j = 0;
     for (i = 0; envp[i]; i++)
diff --git a/gdb/testsuite/gdb.base/twice.c b/gdb/testsuite/gdb.base/twice.c
index 09eb2dd..a0182bb 100644
--- a/gdb/testsuite/gdb.base/twice.c
+++ b/gdb/testsuite/gdb.base/twice.c
@@ -11,10 +11,6 @@ int main ()
 
 {
     int y ;
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif    
     y = nothing () ;
     printf ("hello\n") ;
     return 0;
diff --git a/gdb/testsuite/gdb.base/unload.exp b/gdb/testsuite/gdb.base/unload.exp
index d33407b..0e6f6aa 100644
--- a/gdb/testsuite/gdb.base/unload.exp
+++ b/gdb/testsuite/gdb.base/unload.exp
@@ -69,10 +69,6 @@ gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 gdb_load_shlibs $lib_sl $lib_sl2
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 #
 # Test setting a breakpoint in a dynamically loaded library which is
 # manually loaded and unloaded
diff --git a/gdb/testsuite/gdb.base/unwindonsignal.c b/gdb/testsuite/gdb.base/unwindonsignal.c
index 98ac811..b8d1ff2 100644
--- a/gdb/testsuite/gdb.base/unwindonsignal.c
+++ b/gdb/testsuite/gdb.base/unwindonsignal.c
@@ -42,10 +42,6 @@ stop_here ()
 int
 main ()
 {
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
 
 #ifdef SIG_SETMASK
   /* Ensure all the signals aren't blocked.
diff --git a/gdb/testsuite/gdb.base/watchpoint-solib.exp b/gdb/testsuite/gdb.base/watchpoint-solib.exp
index 3e014db..d3baa08 100644
--- a/gdb/testsuite/gdb.base/watchpoint-solib.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-solib.exp
@@ -58,10 +58,6 @@ gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 gdb_load_shlibs $lib_sl
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 runto_main
 
 # Disable hardware watchpoints if necessary.
diff --git a/gdb/testsuite/gdb.base/watchpoint.c b/gdb/testsuite/gdb.base/watchpoint.c
index 9ef9253..e0929a9 100644
--- a/gdb/testsuite/gdb.base/watchpoint.c
+++ b/gdb/testsuite/gdb.base/watchpoint.c
@@ -139,10 +139,6 @@ func5 ()
 
 int main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   struct1.val = 1;
   struct2.val = 2;
   ptr1 = &struct1;
diff --git a/gdb/testsuite/gdb.base/watchpoints.c b/gdb/testsuite/gdb.base/watchpoints.c
index 36972e8..0826fad 100644
--- a/gdb/testsuite/gdb.base/watchpoints.c
+++ b/gdb/testsuite/gdb.base/watchpoints.c
@@ -30,11 +30,6 @@ int ival4 = -1;
 int 
 main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
-
   for (count = 0; count < 4; count++) {
     ival1 = count; ival2 = count;
     ival3 = count; ival4 = count;
diff --git a/gdb/testsuite/gdb.base/whatis.c b/gdb/testsuite/gdb.base/whatis.c
index 24ec080..c86f040 100644
--- a/gdb/testsuite/gdb.base/whatis.c
+++ b/gdb/testsuite/gdb.base/whatis.c
@@ -248,10 +248,6 @@ enum cars {chevy, ford, porsche} clunker;
 
 int main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   /* Some linkers (e.g. on AIX) remove unreferenced variables,
      so make sure to reference them. */
   v_char = 0;
diff --git a/gdb/testsuite/gdb.cp/annota2.exp b/gdb/testsuite/gdb.cp/annota2.exp
index 9aafaf8..1a8fe3e 100644
--- a/gdb/testsuite/gdb.cp/annota2.exp
+++ b/gdb/testsuite/gdb.cp/annota2.exp
@@ -51,10 +51,6 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 #
 # line number where we need to stop in main
 #
diff --git a/gdb/testsuite/gdb.cp/annota3.exp b/gdb/testsuite/gdb.cp/annota3.exp
index ce267de..1c42731 100644
--- a/gdb/testsuite/gdb.cp/annota3.exp
+++ b/gdb/testsuite/gdb.cp/annota3.exp
@@ -51,10 +51,6 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 #
 # line number where we need to stop in main
 #
diff --git a/gdb/testsuite/gdb.cp/classes.cc b/gdb/testsuite/gdb.cp/classes.cc
index a3037eb..d96374e 100644
--- a/gdb/testsuite/gdb.cp/classes.cc
+++ b/gdb/testsuite/gdb.cp/classes.cc
@@ -577,10 +577,6 @@ void use_methods ()
 int
 main()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   dummy();
   inheritance1 ();
   inheritance3 ();
diff --git a/gdb/testsuite/gdb.cp/cplusfuncs.cc b/gdb/testsuite/gdb.cp/cplusfuncs.cc
index 11dba06..021d7c1 100644
--- a/gdb/testsuite/gdb.cp/cplusfuncs.cc
+++ b/gdb/testsuite/gdb.cp/cplusfuncs.cc
@@ -58,18 +58,7 @@ public:
   const char *ccpfoo;
 };
 
-#ifdef usestubs
-extern "C" { 
-   void set_debug_traps();
-   void breakpoint();
-};
-#endif
-
 int main () {
-#ifdef usestubs
-   set_debug_traps();
-   breakpoint();
-#endif
    int z=3;
 }
 
diff --git a/gdb/testsuite/gdb.cp/derivation.cc b/gdb/testsuite/gdb.cp/derivation.cc
index f6d42e7..942fcd2 100644
--- a/gdb/testsuite/gdb.cp/derivation.cc
+++ b/gdb/testsuite/gdb.cp/derivation.cc
@@ -208,12 +208,6 @@ int main(void)
     F f_instance;
     G g_instance;
     
-    #ifdef usestubs
-       set_debug_traps();
-       breakpoint();
-    #endif
-    
-
     marker1(); // marker1-returns-here
     
     a_instance.a = 20; // marker1-returns-here
diff --git a/gdb/testsuite/gdb.cp/formatted-ref.cc b/gdb/testsuite/gdb.cp/formatted-ref.cc
index d7ea235..5fdfdb2 100644
--- a/gdb/testsuite/gdb.cp/formatted-ref.cc
+++ b/gdb/testsuite/gdb.cp/formatted-ref.cc
@@ -38,11 +38,6 @@ Enum1 e1 = Val11;
 int main(void) 
 {
 
-  #ifdef usestubs
-     set_debug_traps();
-     breakpoint();
-  #endif
-
   f1 (s1, e1, i1);
 
 }
diff --git a/gdb/testsuite/gdb.cp/misc.cc b/gdb/testsuite/gdb.cp/misc.cc
index 0b39938..d2e0eb0 100644
--- a/gdb/testsuite/gdb.cp/misc.cc
+++ b/gdb/testsuite/gdb.cp/misc.cc
@@ -569,10 +569,6 @@ void use_methods ()
 int
 main()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   dummy();
   inheritance1 ();
   inheritance3 ();
diff --git a/gdb/testsuite/gdb.cp/overload.cc b/gdb/testsuite/gdb.cp/overload.cc
index ba082d2..ba0678f 100644
--- a/gdb/testsuite/gdb.cp/overload.cc
+++ b/gdb/testsuite/gdb.cp/overload.cc
@@ -135,11 +135,6 @@ int main ()
     N::nsoverload(2);
     N::nsoverload(2, 3);
 
-    #ifdef usestubs
-       set_debug_traps();
-       breakpoint();
-    #endif
-
     overloadNamespace (1);
     overloadNamespace (dummyInstance);
     XXX::overloadNamespace ('a');
diff --git a/gdb/testsuite/gdb.cp/ovldbreak.cc b/gdb/testsuite/gdb.cp/ovldbreak.cc
index 7aa1f2f..832b0fa 100644
--- a/gdb/testsuite/gdb.cp/ovldbreak.cc
+++ b/gdb/testsuite/gdb.cp/ovldbreak.cc
@@ -89,10 +89,6 @@ int main ()
     foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
    
 
-    #ifdef usestubs
-       set_debug_traps();
-       breakpoint();
-    #endif
 
 
     marker1();
diff --git a/gdb/testsuite/gdb.cp/ovldbreak.exp b/gdb/testsuite/gdb.cp/ovldbreak.exp
index f5d4051..aa77389 100644
--- a/gdb/testsuite/gdb.cp/ovldbreak.exp
+++ b/gdb/testsuite/gdb.cp/ovldbreak.exp
@@ -130,18 +130,18 @@ proc set_bp_overloaded {name expectedmenu mychoice bpnumber linenumber} {
 
 set    menu_overload1arg "\\\[0\\\] cancel\r\n"
 append menu_overload1arg "\\\[1\\\] all\r\n"
-append menu_overload1arg "\\\[2\\\] foo::overload1arg\\(double\\) at.*$srcfile:121\r\n"
-append menu_overload1arg "\\\[3\\\] foo::overload1arg\\(float\\) at.*$srcfile:120\r\n"
-append menu_overload1arg "\\\[4\\\] foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:119\r\n"
-append menu_overload1arg "\\\[5\\\] foo::overload1arg\\(long( int)?\\) at.*$srcfile:118\r\n"
-append menu_overload1arg "\\\[6\\\] foo::overload1arg\\((unsigned int|unsigned)\\) at.*$srcfile:117\r\n"
-append menu_overload1arg "\\\[7\\\] foo::overload1arg\\(int\\) at.*$srcfile:116\r\n"
-append menu_overload1arg "\\\[8\\\] foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:115\r\n"
-append menu_overload1arg "\\\[9\\\] foo::overload1arg\\(short( int)?\\) at.*$srcfile:114\r\n"
-append menu_overload1arg "\\\[10\\\] foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r\n"
-append menu_overload1arg "\\\[11\\\] foo::overload1arg\\(signed char\\) at.*$srcfile:112\r\n"
-append menu_overload1arg "\\\[12\\\] foo::overload1arg\\(char\\) at.*$srcfile:111\r\n"
-append menu_overload1arg "\\\[13\\\] foo::overload1arg\\((void|)\\) at.*$srcfile:110\r\n"
+append menu_overload1arg "\\\[2\\\] foo::overload1arg\\(double\\) at.*$srcfile:117\r\n"
+append menu_overload1arg "\\\[3\\\] foo::overload1arg\\(float\\) at.*$srcfile:116\r\n"
+append menu_overload1arg "\\\[4\\\] foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:115\r\n"
+append menu_overload1arg "\\\[5\\\] foo::overload1arg\\(long( int)?\\) at.*$srcfile:114\r\n"
+append menu_overload1arg "\\\[6\\\] foo::overload1arg\\((unsigned int|unsigned)\\) at.*$srcfile:113\r\n"
+append menu_overload1arg "\\\[7\\\] foo::overload1arg\\(int\\) at.*$srcfile:112\r\n"
+append menu_overload1arg "\\\[8\\\] foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:111\r\n"
+append menu_overload1arg "\\\[9\\\] foo::overload1arg\\(short( int)?\\) at.*$srcfile:110\r\n"
+append menu_overload1arg "\\\[10\\\] foo::overload1arg\\(unsigned char\\) at.*$srcfile:109\r\n"
+append menu_overload1arg "\\\[11\\\] foo::overload1arg\\(signed char\\) at.*$srcfile:108\r\n"
+append menu_overload1arg "\\\[12\\\] foo::overload1arg\\(char\\) at.*$srcfile:107\r\n"
+append menu_overload1arg "\\\[13\\\] foo::overload1arg\\((void|)\\) at.*$srcfile:106\r\n"
 append menu_overload1arg "> $"
 
 # Set multiple-symbols to "ask", to allow us to test the use
@@ -150,18 +150,19 @@ gdb_test_no_output "set multiple-symbols ask"
 
 # Set breakpoints on foo::overload1arg, one by one.
 
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 12    2 111
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 11    3 112
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 10    4 113
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  9    5 114
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  8    6 115
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  7    7 116
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  6    8 117
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  5    9 118
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  4   10 119
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  3   11 120
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  2   12 121
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 13   13 110
+set line 107
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 12    2 107
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 11    3 108
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 10    4 109
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  9    5 110
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  8    6 111
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  7    7 112
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  6    8 113
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  5    9 114
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  4   10 115
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  3   11 116
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  2   12 117
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 13   13 106
 
 
 
@@ -171,18 +172,18 @@ gdb_test "info break" \
     "Num     Type\[\t \]+Disp Enb Address\[\t \]+What.*
 \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in main(\\((|void)\\))? at.*$srcfile:49\r
 \[\t \]+breakpoint already hit 1 time\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:111\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:112\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short( int)?\\) at.*$srcfile:114\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:115\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:116\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:117\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long( int)?\\) at.*$srcfile:118\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:119\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:120\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:121\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:110" \
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:107\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:108\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:109\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short( int)?\\) at.*$srcfile:110\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:111\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:112\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:113\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long( int)?\\) at.*$srcfile:114\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:115\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:116\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:117\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:106" \
     "breakpoint info (after setting one-by-one)"
 
 
@@ -229,18 +230,18 @@ gdb_test "info break" \
     "Num     Type\[\t \]+Disp Enb Address\[\t \]+What.*
 \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in main(\\((|void)\\))? at.*$srcfile:49\r
 \[\t \]+breakpoint already hit 1 time\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:111\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:112\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short( int)?\\) at.*$srcfile:114\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:115\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:116\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:117\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long( int)?\\) at.*$srcfile:118\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:119\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:120\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:121\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:110" \
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:107\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:108\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:109\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short( int)?\\) at.*$srcfile:110\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:111\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:112\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:113\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long( int)?\\) at.*$srcfile:114\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:115\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:116\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:117\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:106" \
     "breakpoint info (after cancel)"
 
 
@@ -279,7 +280,7 @@ gdb_expect {
         # Choose all.
         send_gdb "1\n"
         gdb_expect {
-            -re "Breakpoint $decimal at $hex: file.*$srcfile, line 121.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 120.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 119.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 118.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 117.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 116.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 115.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 114.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 113.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 112.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 111.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 110.\r\nwarning: Multiple breakpoints were set.\r\nUse the .delete. command to delete unwanted breakpoints.\r\n$gdb_prompt $" {
+            -re "Breakpoint $decimal at $hex: file.*$srcfile, line 117.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 116.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 115.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 114.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 113.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 112.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 111.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 110.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 109.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 108.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 107.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 106.\r\nwarning: Multiple breakpoints were set.\r\nUse the .delete. command to delete unwanted breakpoints.\r\n$gdb_prompt $" {
                 pass "set bp on overload1arg all"
             }
             -re ".*$gdb_prompt $" {
@@ -306,18 +307,18 @@ gdb_expect {
 
 gdb_test "info break" \
     "Num     Type\[\t \]+Disp Enb Address\[\t \]+What.*
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:121\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:120\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:119\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long( int)?\\) at.*$srcfile:118\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:117\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:116\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:115\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short( int)?\\) at.*$srcfile:114\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:112\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:111\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:110" \
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:117\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:116\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:115\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long( int)?\\) at.*$srcfile:114\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:113\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:112\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:111\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short( int)?\\) at.*$srcfile:110\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:109\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:108\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:107\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:106" \
     "breakpoint info (after setting on all)"
 
 
diff --git a/gdb/testsuite/gdb.cp/ref-params.cc b/gdb/testsuite/gdb.cp/ref-params.cc
index 4caa262..f2a5388 100644
--- a/gdb/testsuite/gdb.cp/ref-params.cc
+++ b/gdb/testsuite/gdb.cp/ref-params.cc
@@ -61,11 +61,6 @@ int main(void)
   Child Q(42);
   Child& QR = Q;
 
-  #ifdef usestubs
-     set_debug_traps();
-     breakpoint();
-  #endif
-
   /* Set breakpoint marker1 here.  */
 
   f2(Q);
diff --git a/gdb/testsuite/gdb.cp/ref-types.cc b/gdb/testsuite/gdb.cp/ref-types.cc
index 6a042f6..2b449d2 100644
--- a/gdb/testsuite/gdb.cp/ref-types.cc
+++ b/gdb/testsuite/gdb.cp/ref-types.cc
@@ -41,10 +41,6 @@ int main(void)
     as[2] = 2;
     as[3] = 3;
 
-   #ifdef usestubs
-       set_debug_traps();
-       breakpoint();
-    #endif
     marker1();
 
     main2();
diff --git a/gdb/testsuite/gdb.cp/templates.cc b/gdb/testsuite/gdb.cp/templates.cc
index b5e0643..49cf6b6 100644
--- a/gdb/testsuite/gdb.cp/templates.cc
+++ b/gdb/testsuite/gdb.cp/templates.cc
@@ -734,10 +734,7 @@ int main()
 {
     int i;
     long l, m, n;
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
+
     i = i + 1;
 
     // New tests added here
diff --git a/gdb/testsuite/gdb.cp/virtfunc.cc b/gdb/testsuite/gdb.cp/virtfunc.cc
index c6a67a8..6733054 100644
--- a/gdb/testsuite/gdb.cp/virtfunc.cc
+++ b/gdb/testsuite/gdb.cp/virtfunc.cc
@@ -182,19 +182,9 @@ void test_calls()
         TEST(pEe->D::vg(), 102);
 	printf("Did %d tests, of which %d failed.\n", all_count, failed_count);
 }
-#ifdef usestubs
-extern "C" {
-  void set_debug_traps();
-  void breakpoint();
-};
-#endif
 
 int main()
 {
-#ifdef usestubs
-   set_debug_traps();
-   breakpoint();
-#endif
     init();
 
     e.w = 7;
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp
index c356ab1..ffb2131 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp
@@ -49,9 +49,6 @@ if {$result != 0} {
 }
 
 gdb_load ${binfile}
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}    
 
 if ![runto "*${break_at}"] {
     return -1
diff --git a/gdb/testsuite/gdb.hp/gdb.aCC/run.c b/gdb/testsuite/gdb.hp/gdb.aCC/run.c
index 6bff81a..b41abab 100644
--- a/gdb/testsuite/gdb.hp/gdb.aCC/run.c
+++ b/gdb/testsuite/gdb.hp/gdb.aCC/run.c
@@ -42,10 +42,6 @@ int main (int argc, char *argv[], char **envp)
 char *argv[], **envp;*/
 {
     int factorial (int);
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
 #ifdef FAKEARGV
     printf ("%d\n", factorial (1));
 #else    
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/callfwmall.c b/gdb/testsuite/gdb.hp/gdb.base-hp/callfwmall.c
index 67edb8b..f22a248 100644
--- a/gdb/testsuite/gdb.hp/gdb.base-hp/callfwmall.c
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/callfwmall.c
@@ -180,10 +180,6 @@ int main()
 main ()
 #endif
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   t_structs_c(struct_val1);
   return 0;
   
diff --git a/gdb/testsuite/gdb.hp/gdb.compat/xdb0.c b/gdb/testsuite/gdb.hp/gdb.compat/xdb0.c
index fa5c76f..4cd29c3 100644
--- a/gdb/testsuite/gdb.hp/gdb.compat/xdb0.c
+++ b/gdb/testsuite/gdb.hp/gdb.compat/xdb0.c
@@ -3,10 +3,7 @@
 main ()
 {
     int x;
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
+
     x = 0;
     foo (x++);
     foo (x++);
diff --git a/gdb/testsuite/gdb.hp/gdb.compat/xdb1.exp b/gdb/testsuite/gdb.hp/gdb.compat/xdb1.exp
index ebec539..66bd0ff 100644
--- a/gdb/testsuite/gdb.hp/gdb.compat/xdb1.exp
+++ b/gdb/testsuite/gdb.hp/gdb.compat/xdb1.exp
@@ -22,8 +22,6 @@ if $tracelevel then {
 
 if { [skip_hp_tests] } then { continue }
 
-global usestubs
-
 #
 # test running programs
 #
diff --git a/gdb/testsuite/gdb.mi/mi-pending.exp b/gdb/testsuite/gdb.mi/mi-pending.exp
index 6693c24..9058bc6 100644
--- a/gdb/testsuite/gdb.mi/mi-pending.exp
+++ b/gdb/testsuite/gdb.mi/mi-pending.exp
@@ -56,10 +56,6 @@ mi_gdb_reinitialize_dir $srcdir/$subdir
 mi_gdb_load ${binfile}
 mi_load_shlibs $lib_sl
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 # Set pending breakpoint via MI
 mi_gdb_test "-break-insert -f pendfunc1" \
     ".*\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"<PENDING>\",pending=\"pendfunc1\",times=\"0\",original-location=\"pendfunc1\"\}"\
diff --git a/gdb/testsuite/gdb.reverse/consecutive-reverse.c b/gdb/testsuite/gdb.reverse/consecutive-reverse.c
index 8044b52..a3dd5c9 100644
--- a/gdb/testsuite/gdb.reverse/consecutive-reverse.c
+++ b/gdb/testsuite/gdb.reverse/consecutive-reverse.c
@@ -29,10 +29,6 @@ int foo ()
 
 main()
 {
-#ifdef usestubs
-    set_debug_traps ();
-    breakpoint ();
-#endif
   foo ();
 } /* end of main */
 
diff --git a/gdb/testsuite/gdb.reverse/sigall-reverse.c b/gdb/testsuite/gdb.reverse/sigall-reverse.c
index 494f833..a29a90e 100644
--- a/gdb/testsuite/gdb.reverse/sigall-reverse.c
+++ b/gdb/testsuite/gdb.reverse/sigall-reverse.c
@@ -1168,11 +1168,6 @@ return 0;
 int
 main ()
 {
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
-
 #ifdef SIG_SETMASK
   /* Ensure all the signals aren't blocked.
      The environment in which the testsuite is run may have blocked some
diff --git a/gdb/testsuite/gdb.reverse/until-reverse.c b/gdb/testsuite/gdb.reverse/until-reverse.c
index 52ec05f..b847197 100644
--- a/gdb/testsuite/gdb.reverse/until-reverse.c
+++ b/gdb/testsuite/gdb.reverse/until-reverse.c
@@ -78,10 +78,6 @@ int argc;
 char *argv[], **envp;
 #endif
 {
-#ifdef usestubs
-    set_debug_traps();  /* set breakpoint 5 here */
-    breakpoint();
-#endif
     if (argc == 12345) {  /* an unlikely value < 2^16, in case uninited */ /* set breakpoint 6 here */
 	fprintf (stderr, "usage:  factorial <number>\n");
 	return 1;
diff --git a/gdb/testsuite/gdb.reverse/watch-reverse.c b/gdb/testsuite/gdb.reverse/watch-reverse.c
index 201115c..e2531b9 100644
--- a/gdb/testsuite/gdb.reverse/watch-reverse.c
+++ b/gdb/testsuite/gdb.reverse/watch-reverse.c
@@ -139,10 +139,6 @@ func4 ()
 
 int main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   struct1.val = 1;
   struct2.val = 2;
   ptr1 = &struct1;
diff --git a/gdb/testsuite/gdb.trace/actions.c b/gdb/testsuite/gdb.trace/actions.c
index 270e1e1..04ae43f 100644
--- a/gdb/testsuite/gdb.trace/actions.c
+++ b/gdb/testsuite/gdb.trace/actions.c
@@ -119,11 +119,6 @@ main (argc, argv, envp)
   int i;
   unsigned long myparms[10];
 
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
-
   begin ();
   for (i = 0; i < sizeof (myparms) / sizeof (myparms[0]); i++)
     myparms[i] = i;
diff --git a/gdb/testsuite/gdb.trace/circ.c b/gdb/testsuite/gdb.trace/circ.c
index 98a2ce6..e83eb04 100644
--- a/gdb/testsuite/gdb.trace/circ.c
+++ b/gdb/testsuite/gdb.trace/circ.c
@@ -61,11 +61,6 @@ main (argc, argv, envp)
 {
   int i;
 
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
-
   begin ();
   for (i = 0; i < sizeof(testload) / sizeof(testload[0]); i++)
     testload[i] = i + 1;
@@ -83,8 +78,5 @@ main (argc, argv, envp)
 
   end ();
 
-#ifdef usestubs
-  breakpoint ();
-#endif
   return 0;
 }
diff --git a/gdb/testsuite/gdb.trace/circ.exp b/gdb/testsuite/gdb.trace/circ.exp
index f02c9d0..13dfdb0 100644
--- a/gdb/testsuite/gdb.trace/circ.exp
+++ b/gdb/testsuite/gdb.trace/circ.exp
@@ -192,10 +192,6 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load $binfile
  
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 gdb_test_no_output "set circular-trace-buffer on" \
     "set circular-trace-buffer on"
 
diff --git a/gdb/testsuite/gdb.trace/collection.c b/gdb/testsuite/gdb.trace/collection.c
index 5901baf..3eac221 100644
--- a/gdb/testsuite/gdb.trace/collection.c
+++ b/gdb/testsuite/gdb.trace/collection.c
@@ -225,11 +225,6 @@ main (argc, argv, envp)
   test_struct mystruct;
   int         myarray[4];
 
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
-
   begin ();
   /* Assign collectable values to global variables. */
   l0  = s0  = c0  = 0;     l1  = s1  = c1  = 1;
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 1823e00..261ed9f 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -268,13 +268,6 @@ proc gdb_run_cmd {args} {
 		}
 	    }
 	}
-	if [target_info exists gdb_stub] {
-	    gdb_expect 60 {
-		-re "$gdb_prompt $" {
-		    send_gdb "continue\n"
-		}
-	    }
-	}
 	return
     }
 
@@ -456,26 +449,12 @@ proc runto { function args } {
 }
 
 # Ask gdb to run until we hit a breakpoint at main.
-# The case where the target uses stubs has to be handled
-# specially--if it uses stubs, assuming we hit
-# breakpoint() and just step out of the function.
 #
 # N.B. This function deletes all existing breakpoints.
 # If you don't want that, use gdb_start_cmd.
 
 proc runto_main { } {
-    global gdb_prompt
-    global decimal
-
-    if ![target_info exists gdb_stub] {
-	return [runto main]
-    }			
-
-    delete_breakpoints
-
-    gdb_step_for_stub;
-
-    return 1
+    return [runto main]
 }
 
 ### Continue, and expect to hit a breakpoint.
@@ -2279,14 +2258,8 @@ proc gdb_compile {source dest type options} {
     }
     set options $new_options
 
-    if [target_info exists gdb_stub] {
-	set options2 { "additional_flags=-Dusestubs" }
-	lappend options "libs=[target_info gdb_stub]";
-	set options [concat $options2 $options]
-    }
     if [target_info exists is_vxworks] {
 	set options2 { "additional_flags=-Dvxworks" }
-	lappend options "libs=[target_info gdb_stub]";
 	set options [concat $options2 $options]
     }
     if [info exists GDB_TESTCASE_OPTIONS] {
@@ -3147,91 +3120,6 @@ proc setup_kfail_for_target { PR target } {
     }
 }
 
-# Test programs for embedded (often "bare board") systems sometimes use a
-# "stub" either embedded in the test program itself or in the boot rom.
-# The job of the stub is to implement the remote protocol to communicate
-# with gdb and control the inferior.  To initiate the remote protocol
-# session with gdb the stub needs to be given control by the inferior.
-# They do this by calling a function that typically triggers a trap
-# from main that transfers control to the stub.
-# The purpose of this function, gdb_step_for_stub, is to step out of
-# that function ("breakpoint" in the example below) and back into main.
-#
-# Example:
-#
-# int
-# main ()
-# {
-# #ifdef usestubs
-#  set_debug_traps (); /* install trap handlers for stub */
-#  breakpoint (); /* trigger a trap to give the stub control */
-# #endif
-#  /* test program begins here */
-# }
-#
-# Note that one consequence of this design is that a breakpoint on "main"
-# does not Just Work (because if the target could stop there you still have
-# to step past the calls to set_debug_traps,breakpoint).
-
-proc gdb_step_for_stub { } {
-    global gdb_prompt;
-
-    if ![target_info exists gdb,use_breakpoint_for_stub] {
-	if [target_info exists gdb_stub_step_command] {
-	    set command [target_info gdb_stub_step_command];
-	} else {
-	    set command "step";
-	}
-	send_gdb "${command}\n";
-	set tries 0;
-	gdb_expect 60 {
-	    -re "(main.* at |.*in .*start).*$gdb_prompt" {
-		return;
-	    }
-	    -re ".*$gdb_prompt" {
-		incr tries;
-		if { $tries == 5 } {
-		    fail "stepping out of breakpoint function";
-		    return;
-		}
-		send_gdb "${command}\n";
-		exp_continue;
-	    }
-	    default {
-		fail "stepping out of breakpoint function";
-		return;
-	    }
-	}
-    }
-    send_gdb "where\n";
-    gdb_expect {
-	-re "main\[^\r\n\]*at \(\[^:]+\):\(\[0-9\]+\)" {
-	    set file $expect_out(1,string);
-	    set linenum [expr $expect_out(2,string) + 1];
-	    set breakplace "${file}:${linenum}";
-	}
-	default {}
-    }
-    send_gdb "break ${breakplace}\n";
-    gdb_expect 60 {
-	-re "Breakpoint (\[0-9\]+) at.*$gdb_prompt" {
-	    set breakpoint $expect_out(1,string);
-	}
-	-re "Breakpoint (\[0-9\]+): file.*$gdb_prompt" {
-	    set breakpoint $expect_out(1,string);
-	}
-	default {}
-    }
-    send_gdb "continue\n";
-    gdb_expect 60 {
-	-re "Breakpoint ${breakpoint},.*$gdb_prompt" {
-	    gdb_test "delete $breakpoint" ".*" "";
-	    return;
-	}
-	default {}
-    }
-}
-
 # gdb_get_line_number TEXT [FILE]
 #
 # Search the source file FILE, and return the line number of the
@@ -3690,10 +3578,6 @@ proc clean_restart { executable } {
     gdb_start
     gdb_reinitialize_dir $srcdir/$subdir
     gdb_load ${binfile}
-
-    if [target_info exists gdb_stub] {
-        gdb_step_for_stub;
-    }    
 }
 
 # Prepares for testing, by calling build_executable, and then clean_restart.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH, docs RFA] Delete all use_stub support: gdb_step_for_stub, and calls to set_debug_traps etc. throughout (was: Re: [commit] add some comments to testsuite/lib/gdb.exp)
  2011-12-04 13:16     ` [PATCH, docs RFA] Delete all use_stub support: gdb_step_for_stub, and calls to set_debug_traps etc. throughout (was: Re: [commit] add some comments to testsuite/lib/gdb.exp) Pedro Alves
@ 2011-12-04 16:37       ` Eli Zaretskii
  2011-12-04 18:47       ` Doug Evans
  1 sibling, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2011-12-04 16:37 UTC (permalink / raw)
  To: Pedro Alves; +Cc: dje, gdb-patches

> From: Pedro Alves <pedro@codesourcery.com>
> Date: Sun, 4 Dec 2011 13:15:32 +0000
> Cc: gdb-patches@sourceware.org
> 
> gdb/doc/
> 2011-12-04  Pedro Alves  <pedro@codesourcery.com>
> 
> 	* gdb.texinfo (Implementing a Remote Stub): Explain that you
> 	should transfer control to the stub in the startup code instead of
> 	in main.  Mention the need to get past the initial breakpoint.

This part is OK.  Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH, docs RFA] Delete all use_stub support: gdb_step_for_stub, and calls to set_debug_traps etc. throughout (was: Re: [commit] add some comments to testsuite/lib/gdb.exp)
  2011-12-04 13:16     ` [PATCH, docs RFA] Delete all use_stub support: gdb_step_for_stub, and calls to set_debug_traps etc. throughout (was: Re: [commit] add some comments to testsuite/lib/gdb.exp) Pedro Alves
  2011-12-04 16:37       ` Eli Zaretskii
@ 2011-12-04 18:47       ` Doug Evans
  2011-12-13 18:01         ` Pedro Alves
  1 sibling, 1 reply; 8+ messages in thread
From: Doug Evans @ 2011-12-04 18:47 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On Sun, Dec 4, 2011 at 5:15 AM, Pedro Alves <pedro@codesourcery.com> wrote:
> On Saturday 03 December 2011 18:55:06, Doug Evans wrote:
>> On Sat, Dec 3, 2011 at 10:39 AM, Pedro Alves <pedro@codesourcery.com> wrote:
>> > But I do wonder whether there is still anyone making use of this.
>> > Can't we just zap all of the #ifdef usestubs bits?
>>
>> I'll leave that to someone else.
>
> Like below.
>
> Tested on x86_64-linux, native and local gdbserver.
>
>> > There are zillions of tests that don't make have usestubs support
>> > in their main.  It must be pretty broken?
>>
>> Like I said, a bit of bitrot ...
>> [The usestubs way was inherently non-scalable and the bitrot will
>> always be inevitable.]
>>
>> > All the stubs I've seen thus far that needed to do something magical,
>> > did it transparently, before main is reached, e.g., with extra startup
>> > glue, and board file magic, which IMO is the Right Way.
>>
>> I think you'd be hard pressed to find someone who thought otherwise
>> these days ... no?
>
> gdb/doc/
> 2011-12-04  Pedro Alves  <pedro@codesourcery.com>
>
>        * gdb.texinfo (Implementing a Remote Stub): Explain that you
>        should transfer control to the stub in the startup code instead of
>        in main.  Mention the need to get past the initial breakpoint.
>
> gdb/testsuite/
> 2011-12-04  Pedro Alves  <pedro@codesourcery.com>
>
>        * lib/gdb.exp (gdb_run_cmd, runto_main, gdb_compile)
>        (clean_restart): Remove references to the gdb_stub target board
>        variable.
>        (gdb_step_for_stub): Delete.
>
>        * gdb.base/annota1.exp: Remove all references to [target_info
>        exists gdb_stub], gdb_step_for_stub and usestubs.
>        * gdb.base/annota3.exp: Ditto.
>        * gdb.base/async.exp: Ditto.
>        * gdb.base/break.exp: Ditto.
>        * gdb.base/code-expr.exp: Ditto.
>        * gdb.base/commands.exp: Ditto.
>        * gdb.base/completion.exp: Ditto.
>        * gdb.base/condbreak.exp: Ditto.
>        * gdb.base/consecutive.exp: Ditto.
>        * gdb.base/cvexpr.exp: Ditto.
>        * gdb.base/define.exp: Ditto.
>        * gdb.base/display.exp: Ditto.
>        * gdb.base/ena-dis-br.exp: Ditto.
>        * gdb.base/environ.exp: Ditto.
>        * gdb.base/gnu-ifunc.exp: Ditto.
>        * gdb.base/maint.exp: Ditto.
>        * gdb.base/pending.exp: Ditto.
>        * gdb.base/sect-cmd.exp: Ditto.
>        * gdb.base/sepdebug.exp: Ditto.
>        * gdb.base/unload.exp: Ditto.
>        * gdb.base/watchpoint-solib.exp: Ditto.
>        * gdb.cp/annota2.exp: Ditto.
>        * gdb.cp/annota3.exp: Ditto.
>        * gdb.dwarf2/dw2-inline-param.exp: Ditto.
>        * gdb.hp/gdb.compat/xdb1.exp: Ditto.
>        * gdb.mi/mi-pending.exp: Ditto.
>        * gdb.trace/circ.exp: Ditto.
>        * gdb.cp/ovldbreak.exp: Ditto.  Adjust expected line numbers.
>        * gdb.base/list.exp: Ditto.
>
>        * gdb.base/all-types.c: Remove all calls to set_debug_traps and
>        breakpoint function and all references to the usestubs macro.
>        * gdb.base/exprs.c: Ditto.
>        * gdb.base/freebpcmd.c: Ditto.
>        * gdb.base/bitfields.c: Ditto.
>        * gdb.base/bitfields2.c: Ditto.
>        * gdb.base/break.c: Ditto.
>        * gdb.base/call-sc.c: Ditto.
>        * gdb.base/call-signals.c: Ditto.
>        * gdb.base/callfuncs.c: Ditto.
>        * gdb.base/charset.c: Ditto.
>        * gdb.base/consecutive.c: Ditto.
>        * gdb.base/constvars.c: Ditto.
>        * gdb.base/funcargs.c: Ditto.
>        * gdb.base/int-type.c: Ditto.
>        * gdb.base/interrupt.c: Ditto.
>        * gdb.base/langs0.c: Ditto.
>        * gdb.base/list0.c: Ditto.
>        * gdb.base/mips_pro.c: Ditto.
>        * gdb.base/miscexprs.c: Ditto.
>        * gdb.base/nodebug.c: Ditto.
>        * gdb.base/opaque0.c: Ditto.
>        * gdb.base/pointers.c: Ditto.
>        * gdb.base/printcmds.c: Ditto.
>        * gdb.base/ptype.c: Ditto.
>        * gdb.base/recurse.c: Ditto.
>        * gdb.base/reread1.c: Ditto.
>        * gdb.base/reread2.c: Ditto.
>        * gdb.base/restore.c: Ditto.
>        * gdb.base/return.c: Ditto.
>        * gdb.base/run.c: Ditto.
>        * gdb.base/scope0.c: Ditto.
>        * gdb.base/sepdebug.c: Ditto.
>        * gdb.base/setshow.c: Ditto.
>        * gdb.base/setvar.c: Ditto.
>        * gdb.base/sigall.c: Ditto.
>        * gdb.base/signals.c: Ditto.
>        * gdb.base/structs.c: Ditto.
>        * gdb.base/structs2.c: Ditto.
>        * gdb.base/testenv.c: Ditto.
>        * gdb.base/twice.c: Ditto.
>        * gdb.base/unwindonsignal.c: Ditto.
>        * gdb.base/watchpoint.c: Ditto.
>        * gdb.base/watchpoints.c: Ditto.
>        * gdb.base/whatis.c: Ditto.
>        * gdb.cp/classes.cc: Ditto.
>        * gdb.cp/cplusfuncs.cc: Ditto.
>        * gdb.cp/derivation.cc: Ditto.
>        * gdb.cp/formatted-ref.cc: Ditto.
>        * gdb.cp/misc.cc: Ditto.
>        * gdb.cp/overload.cc: Ditto.
>        * gdb.cp/ovldbreak.cc: Ditto.
>        * gdb.cp/ref-params.cc: Ditto.
>        * gdb.cp/ref-types.cc: Ditto.
>        * gdb.cp/templates.cc: Ditto.
>        * gdb.cp/virtfunc.cc: Ditto.
>        * gdb.hp/gdb.aCC/run.c: Ditto.
>        * gdb.hp/gdb.base-hp/callfwmall.c: Ditto.
>        * gdb.hp/gdb.compat/xdb0.c: Ditto.
>        * gdb.reverse/consecutive-reverse.c: Ditto.
>        * gdb.reverse/sigall-reverse.c: Ditto.
>        * gdb.reverse/until-reverse.c: Ditto.
>        * gdb.reverse/watch-reverse.c: Ditto.
>        * gdb.trace/actions.c: Ditto.
>        * gdb.trace/circ.c: Ditto.
>        * gdb.trace/collection.c: Ditto.

Right on cue. :-)

I think the right thing to do is include my name in the ChangeLog entry.
ref: http://sourceware.org/ml/gdb-patches/2011-12/msg00090.html

Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH, docs RFA] Delete all use_stub support: gdb_step_for_stub, and calls to set_debug_traps etc. throughout (was: Re: [commit] add some comments to testsuite/lib/gdb.exp)
  2011-12-04 18:47       ` Doug Evans
@ 2011-12-13 18:01         ` Pedro Alves
  0 siblings, 0 replies; 8+ messages in thread
From: Pedro Alves @ 2011-12-13 18:01 UTC (permalink / raw)
  To: Doug Evans; +Cc: gdb-patches

On Sunday 04 December 2011 16:35:27, Eli Zaretskii wrote:
> > gdb/doc/
> > 	* gdb.texinfo (Implementing a Remote Stub): Explain that you

> This part is OK.  Thanks.

Thanks.

On Sunday 04 December 2011 18:47:20, Doug Evans wrote:
> On Sun, Dec 4, 2011 at 5:15 AM, Pedro Alves <pedro@codesourcery.com> wrote:
> > On Saturday 03 December 2011 18:55:06, Doug Evans wrote:
> >> On Sat, Dec 3, 2011 at 10:39 AM, Pedro Alves <pedro@codesourcery.com> wrote:
> >> > But I do wonder whether there is still anyone making use of this.
> >> > Can't we just zap all of the #ifdef usestubs bits?
> >>
> >> I'll leave that to someone else.
> >
> > Like below.

> Right on cue. :-)
> 
> I think the right thing to do is include my name in the ChangeLog entry.
> ref: http://sourceware.org/ml/gdb-patches/2011-12/msg00090.html
> 
> Thanks.

Done and applied, as below.

I was waiting for Tom's linespecs patch to go in, since this had
conflicts with his work, and 7.4 branching, just in case.

gdb/doc/
2011-12-13  Pedro Alves  <pedro@codesourcery.com>

	* gdb.texinfo (Implementing a Remote Stub): Explain that you
	should transfer control to the stub in the startup code instead of
	in main.  Mention the need to get past the initial breakpoint.

gdb/testsuite/
2011-12-13  Pedro Alves  <pedro@codesourcery.com>
	    Doug Evans  <dje@google.com>

	* lib/gdb.exp (gdb_run_cmd, runto_main, gdb_compile)
	(clean_restart): Remove references to the gdb_stub target board
	variable.
	(gdb_step_for_stub): Delete.

	* gdb.base/annota1.exp: Remove all references to [target_info
	exists gdb_stub], gdb_step_for_stub and usestubs.
	* gdb.base/annota3.exp: Ditto.
	* gdb.base/async.exp: Ditto.
	* gdb.base/break.exp: Ditto.
	* gdb.base/code-expr.exp: Ditto.
	* gdb.base/commands.exp: Ditto.
	* gdb.base/completion.exp: Ditto.
	* gdb.base/condbreak.exp: Ditto.
	* gdb.base/consecutive.exp: Ditto.
	* gdb.base/cvexpr.exp: Ditto.
	* gdb.base/define.exp: Ditto.
	* gdb.base/display.exp: Ditto.
	* gdb.base/ena-dis-br.exp: Ditto.
	* gdb.base/environ.exp: Ditto.
	* gdb.base/gnu-ifunc.exp: Ditto.
	* gdb.base/maint.exp: Ditto.
	* gdb.base/pending.exp: Ditto.
	* gdb.base/sect-cmd.exp: Ditto.
	* gdb.base/sepdebug.exp: Ditto.
	* gdb.base/unload.exp: Ditto.
	* gdb.base/watchpoint-solib.exp: Ditto.
	* gdb.cp/annota2.exp: Ditto.
	* gdb.cp/annota3.exp: Ditto.
	* gdb.dwarf2/dw2-inline-param.exp: Ditto.
	* gdb.hp/gdb.compat/xdb1.exp: Ditto.
	* gdb.mi/mi-pending.exp: Ditto.
	* gdb.trace/circ.exp: Ditto.
	* gdb.cp/ovldbreak.exp: Ditto.  Adjust expected line numbers.
	* gdb.base/list.exp: Ditto.

	* gdb.base/all-types.c: Remove all calls to set_debug_traps and
	breakpoint function and all references to the usestubs macro.
	* gdb.base/exprs.c: Ditto.
	* gdb.base/freebpcmd.c: Ditto.
	* gdb.base/bitfields.c: Ditto.
	* gdb.base/bitfields2.c: Ditto.
	* gdb.base/break.c: Ditto.
	* gdb.base/call-sc.c: Ditto.
	* gdb.base/call-signals.c: Ditto.
	* gdb.base/callfuncs.c: Ditto.
	* gdb.base/charset.c: Ditto.
	* gdb.base/consecutive.c: Ditto.
	* gdb.base/constvars.c: Ditto.
	* gdb.base/funcargs.c: Ditto.
	* gdb.base/int-type.c: Ditto.
	* gdb.base/interrupt.c: Ditto.
	* gdb.base/langs0.c: Ditto.
	* gdb.base/list0.c: Ditto.
	* gdb.base/mips_pro.c: Ditto.
	* gdb.base/miscexprs.c: Ditto.
	* gdb.base/nodebug.c: Ditto.
	* gdb.base/opaque0.c: Ditto.
	* gdb.base/pointers.c: Ditto.
	* gdb.base/printcmds.c: Ditto.
	* gdb.base/ptype.c: Ditto.
	* gdb.base/recurse.c: Ditto.
	* gdb.base/reread1.c: Ditto.
	* gdb.base/reread2.c: Ditto.
	* gdb.base/restore.c: Ditto.
	* gdb.base/return.c: Ditto.
	* gdb.base/run.c: Ditto.
	* gdb.base/scope0.c: Ditto.
	* gdb.base/sepdebug.c: Ditto.
	* gdb.base/setshow.c: Ditto.
	* gdb.base/setvar.c: Ditto.
	* gdb.base/sigall.c: Ditto.
	* gdb.base/signals.c: Ditto.
	* gdb.base/structs.c: Ditto.
	* gdb.base/structs2.c: Ditto.
	* gdb.base/testenv.c: Ditto.
	* gdb.base/twice.c: Ditto.
	* gdb.base/unwindonsignal.c: Ditto.
	* gdb.base/watchpoint.c: Ditto.
	* gdb.base/watchpoints.c: Ditto.
	* gdb.base/whatis.c: Ditto.
	* gdb.cp/classes.cc: Ditto.
	* gdb.cp/cplusfuncs.cc: Ditto.
	* gdb.cp/derivation.cc: Ditto.
	* gdb.cp/formatted-ref.cc: Ditto.
	* gdb.cp/misc.cc: Ditto.
	* gdb.cp/overload.cc: Ditto.
	* gdb.cp/ovldbreak.cc: Ditto.
	* gdb.cp/ref-params.cc: Ditto.
	* gdb.cp/ref-types.cc: Ditto.
	* gdb.cp/templates.cc: Ditto.
	* gdb.cp/virtfunc.cc: Ditto.
	* gdb.hp/gdb.aCC/run.c: Ditto.
	* gdb.hp/gdb.base-hp/callfwmall.c: Ditto.
	* gdb.hp/gdb.compat/xdb0.c: Ditto.
	* gdb.reverse/consecutive-reverse.c: Ditto.
	* gdb.reverse/sigall-reverse.c: Ditto.
	* gdb.reverse/until-reverse.c: Ditto.
	* gdb.reverse/watch-reverse.c: Ditto.
	* gdb.trace/actions.c: Ditto.
	* gdb.trace/circ.c: Ditto.
	* gdb.trace/collection.c: Ditto.
---
 gdb/doc/gdb.texinfo                             |   15 ++-
 gdb/testsuite/gdb.base/all-types.c              |    4 -
 gdb/testsuite/gdb.base/annota1.exp              |    4 -
 gdb/testsuite/gdb.base/annota3.exp              |    4 -
 gdb/testsuite/gdb.base/async.exp                |    3 -
 gdb/testsuite/gdb.base/bitfields.c              |    4 -
 gdb/testsuite/gdb.base/bitfields2.c             |    5 -
 gdb/testsuite/gdb.base/break.c                  |    4 -
 gdb/testsuite/gdb.base/break.exp                |    9 --
 gdb/testsuite/gdb.base/call-sc.c                |    4 -
 gdb/testsuite/gdb.base/call-signals.c           |    5 -
 gdb/testsuite/gdb.base/callfuncs.c              |    4 -
 gdb/testsuite/gdb.base/charset.c                |    4 -
 gdb/testsuite/gdb.base/code-expr.exp            |    4 -
 gdb/testsuite/gdb.base/commands.exp             |    2 
 gdb/testsuite/gdb.base/completion.exp           |    2 
 gdb/testsuite/gdb.base/condbreak.exp            |    6 -
 gdb/testsuite/gdb.base/consecutive.c            |    4 -
 gdb/testsuite/gdb.base/consecutive.exp          |    4 -
 gdb/testsuite/gdb.base/constvars.c              |    4 -
 gdb/testsuite/gdb.base/cvexpr.exp               |    4 -
 gdb/testsuite/gdb.base/define.exp               |    2 
 gdb/testsuite/gdb.base/display.exp              |    3 -
 gdb/testsuite/gdb.base/ena-dis-br.exp           |    2 
 gdb/testsuite/gdb.base/environ.exp              |    2 
 gdb/testsuite/gdb.base/exprs.c                  |    4 -
 gdb/testsuite/gdb.base/freebpcmd.c              |    5 -
 gdb/testsuite/gdb.base/funcargs.c               |    4 -
 gdb/testsuite/gdb.base/gnu-ifunc.exp            |   25 ++---
 gdb/testsuite/gdb.base/int-type.c               |    5 -
 gdb/testsuite/gdb.base/interrupt.c              |    4 -
 gdb/testsuite/gdb.base/langs0.c                 |    4 -
 gdb/testsuite/gdb.base/list.exp                 |   16 +--
 gdb/testsuite/gdb.base/list0.c                  |    8 +-
 gdb/testsuite/gdb.base/maint.exp                |    2 
 gdb/testsuite/gdb.base/mips_pro.c               |    4 -
 gdb/testsuite/gdb.base/miscexprs.c              |    5 -
 gdb/testsuite/gdb.base/nodebug.c                |    4 -
 gdb/testsuite/gdb.base/opaque0.c                |    4 -
 gdb/testsuite/gdb.base/pending.exp              |    3 -
 gdb/testsuite/gdb.base/pointers.c               |    4 -
 gdb/testsuite/gdb.base/printcmds.c              |    4 -
 gdb/testsuite/gdb.base/ptype.c                  |    4 -
 gdb/testsuite/gdb.base/recurse.c                |    4 -
 gdb/testsuite/gdb.base/reread1.c                |    4 -
 gdb/testsuite/gdb.base/reread2.c                |    4 -
 gdb/testsuite/gdb.base/restore.c                |    4 -
 gdb/testsuite/gdb.base/return.c                 |    4 -
 gdb/testsuite/gdb.base/run.c                    |    4 -
 gdb/testsuite/gdb.base/scope0.c                 |    4 -
 gdb/testsuite/gdb.base/sect-cmd.exp             |    2 
 gdb/testsuite/gdb.base/sepdebug.c               |    4 -
 gdb/testsuite/gdb.base/sepdebug.exp             |   16 ---
 gdb/testsuite/gdb.base/setshow.c                |    4 -
 gdb/testsuite/gdb.base/setvar.c                 |    4 -
 gdb/testsuite/gdb.base/sigall.c                 |    4 -
 gdb/testsuite/gdb.base/signals.c                |    4 -
 gdb/testsuite/gdb.base/structs.c                |    4 -
 gdb/testsuite/gdb.base/structs2.c               |    4 -
 gdb/testsuite/gdb.base/testenv.c                |    4 -
 gdb/testsuite/gdb.base/twice.c                  |    4 -
 gdb/testsuite/gdb.base/unload.exp               |    4 -
 gdb/testsuite/gdb.base/unwindonsignal.c         |    4 -
 gdb/testsuite/gdb.base/watchpoint-solib.exp     |    4 -
 gdb/testsuite/gdb.base/watchpoint.c             |    4 -
 gdb/testsuite/gdb.base/watchpoints.c            |    5 -
 gdb/testsuite/gdb.base/whatis.c                 |    4 -
 gdb/testsuite/gdb.cp/annota2.exp                |    4 -
 gdb/testsuite/gdb.cp/annota3.exp                |    4 -
 gdb/testsuite/gdb.cp/classes.cc                 |    4 -
 gdb/testsuite/gdb.cp/cplusfuncs.cc              |   11 --
 gdb/testsuite/gdb.cp/derivation.cc              |    6 -
 gdb/testsuite/gdb.cp/formatted-ref.cc           |    5 -
 gdb/testsuite/gdb.cp/misc.cc                    |    4 -
 gdb/testsuite/gdb.cp/overload.cc                |    5 -
 gdb/testsuite/gdb.cp/ovldbreak.cc               |    4 -
 gdb/testsuite/gdb.cp/ovldbreak.exp              |   97 ++++++++++---------
 gdb/testsuite/gdb.cp/ref-params.cc              |    5 -
 gdb/testsuite/gdb.cp/ref-types.cc               |    4 -
 gdb/testsuite/gdb.cp/templates.cc               |    5 -
 gdb/testsuite/gdb.cp/virtfunc.cc                |   10 --
 gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp   |    3 -
 gdb/testsuite/gdb.hp/gdb.aCC/run.c              |    4 -
 gdb/testsuite/gdb.hp/gdb.base-hp/callfwmall.c   |    4 -
 gdb/testsuite/gdb.hp/gdb.compat/xdb0.c          |    5 -
 gdb/testsuite/gdb.hp/gdb.compat/xdb1.exp        |    2 
 gdb/testsuite/gdb.mi/mi-pending.exp             |    4 -
 gdb/testsuite/gdb.reverse/consecutive-reverse.c |    4 -
 gdb/testsuite/gdb.reverse/sigall-reverse.c      |    5 -
 gdb/testsuite/gdb.reverse/until-reverse.c       |    4 -
 gdb/testsuite/gdb.reverse/watch-reverse.c       |    4 -
 gdb/testsuite/gdb.trace/actions.c               |    5 -
 gdb/testsuite/gdb.trace/circ.c                  |    8 --
 gdb/testsuite/gdb.trace/circ.exp                |    4 -
 gdb/testsuite/gdb.trace/collection.c            |    5 -
 gdb/testsuite/lib/gdb.exp                       |  118 -----------------------
 96 files changed, 89 insertions(+), 582 deletions(-)

Index: src/gdb/doc/gdb.texinfo
===================================================================
--- src.orig/gdb/doc/gdb.texinfo	2011-12-06 19:52:25.944865308 +0000
+++ src/gdb/doc/gdb.texinfo	2011-12-13 17:07:57.742183729 +0000
@@ -17536,8 +17536,8 @@ subroutines:
 @findex set_debug_traps
 @cindex remote serial stub, initialization
 This routine arranges for @code{handle_exception} to run when your
-program stops.  You must call this subroutine explicitly near the
-beginning of your program.
+program stops.  You must call this subroutine explicitly in your
+program's startup code.
 
 @item handle_exception
 @findex handle_exception
@@ -17683,13 +17683,22 @@ Make sure you have defined the supportin
 @end display
 
 @item
-Insert these lines near the top of your program:
+Insert these lines in your program's startup code, before the main
+procedure is called:
 
 @smallexample
 set_debug_traps();
 breakpoint();
 @end smallexample
 
+On some machines, when a breakpoint trap is raised, the hardware
+automatically makes the PC point to the instruction after the
+breakpoint.  If your machine doesn't do that, you may need to adjust
+@code{handle_exception} to arrange for it to return to the instruction
+after the breakpoint on this first invocation, so that your program
+doesn't keep hitting the initial breakpoint instead of making
+progress.
+
 @item
 For the 680x0 stub only, you need to provide a variable called
 @code{exceptionHook}.  Normally you just use:
Index: src/gdb/testsuite/gdb.base/all-types.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/all-types.c	2011-01-13 10:48:04.228964002 +0000
+++ src/gdb/testsuite/gdb.base/all-types.c	2011-12-13 17:07:57.772183729 +0000
@@ -28,10 +28,6 @@ double		v_double;
 int main ()
 {
     extern void dummy();
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
     dummy();
     return 0;
     
Index: src/gdb/testsuite/gdb.base/annota1.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/annota1.exp	2011-10-06 17:31:58.078896570 +0100
+++ src/gdb/testsuite/gdb.base/annota1.exp	2011-12-13 17:07:57.792183729 +0000
@@ -50,10 +50,6 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 #
 # the line at which break main will put the breakpoint
 #
Index: src/gdb/testsuite/gdb.base/annota3.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/annota3.exp	2011-10-06 17:31:58.078896570 +0100
+++ src/gdb/testsuite/gdb.base/annota3.exp	2011-12-13 17:07:57.792183729 +0000
@@ -50,10 +50,6 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 #
 # the line at which break main will put the breakpoint
 #
Index: src/gdb/testsuite/gdb.base/async.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/async.exp	2011-01-13 15:07:59.296075004 +0000
+++ src/gdb/testsuite/gdb.base/async.exp	2011-12-13 17:07:57.802183729 +0000
@@ -56,9 +56,6 @@ gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
 
 #
 # set it up at a breakpoint so we can play with it
Index: src/gdb/testsuite/gdb.base/bitfields.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/bitfields.c	2011-01-13 10:48:04.448964002 +0000
+++ src/gdb/testsuite/gdb.base/bitfields.c	2011-12-13 17:07:57.812183729 +0000
@@ -78,10 +78,6 @@ int main ()
   /* For each member, set that member to 1, allow gdb to verify that the
      member (and only that member) is 1, and then reset it back to 0. */
 
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   flags.uc = 1;
   break1 ();
   flags.uc = 0;
Index: src/gdb/testsuite/gdb.base/bitfields2.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/bitfields2.c	2011-01-13 10:48:04.448964002 +0000
+++ src/gdb/testsuite/gdb.base/bitfields2.c	2011-12-13 17:07:57.822183729 +0000
@@ -162,10 +162,7 @@ void tester ()
 int main () 
 {
   int i;
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
+
   for (i = 0; i < 5; i += 1)
     tester ();
   return 0;
Index: src/gdb/testsuite/gdb.base/break.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/break.c	2011-01-13 15:07:59.566075000 +0000
+++ src/gdb/testsuite/gdb.base/break.c	2011-12-13 17:07:57.842183729 +0000
@@ -86,10 +86,6 @@ int argc;
 char *argv[], **envp;
 #endif
 {
-#ifdef usestubs
-    set_debug_traps();  /* set breakpoint 5 here */
-    breakpoint();
-#endif
     if (argc == 12345) {  /* an unlikely value < 2^16, in case uninited */ /* set breakpoint 6 here */
 	fprintf (stderr, "usage:  factorial <number>\n");
 	return 1;
Index: src/gdb/testsuite/gdb.base/break.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/break.exp	2011-12-06 19:52:35.714865306 +0000
+++ src/gdb/testsuite/gdb.base/break.exp	2011-12-13 17:07:57.852183729 +0000
@@ -119,14 +119,7 @@ gdb_test "break multi_line_while_conditi
 set bp_location5 [gdb_get_line_number "set breakpoint 5 here"]
 set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
 
-#
-# check to see what breakpoints are set
-#
-if [target_info exists gdb_stub] {
-    set main_line $bp_location5
-} else {
-    set main_line $bp_location6
-}
+set main_line $bp_location6
 
 if {$hp_aCC_compiler} {
     set proto "\\(int\\)"
Index: src/gdb/testsuite/gdb.base/call-sc.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/call-sc.c	2011-07-20 09:34:18.623654179 +0100
+++ src/gdb/testsuite/gdb.base/call-sc.c	2011-12-13 17:07:57.862183729 +0000
@@ -58,10 +58,6 @@ zed ()
 
 int main()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   int i;
 
   Fun(foo);	
Index: src/gdb/testsuite/gdb.base/call-signals.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/call-signals.c	2011-01-13 15:07:59.616075000 +0000
+++ src/gdb/testsuite/gdb.base/call-signals.c	2011-12-13 17:07:57.872183729 +0000
@@ -58,11 +58,6 @@ null_hand_call ()
 int
 main ()
 {
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
-
 #ifdef SIG_SETMASK
   /* Ensure all the signals aren't blocked.
      The environment in which the testsuite is run may have blocked some
Index: src/gdb/testsuite/gdb.base/callfuncs.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/callfuncs.c	2011-06-07 18:54:42.908164930 +0100
+++ src/gdb/testsuite/gdb.base/callfuncs.c	2011-12-13 17:07:57.882183729 +0000
@@ -646,10 +646,6 @@ struct struct_with_fnptr *function_struc
 
 int main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   malloc(1);
   t_double_values(double_val1, double_val2);
   t_structs_c(struct_val1);
Index: src/gdb/testsuite/gdb.base/charset.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/charset.c	2011-06-07 18:54:42.908164930 +0100
+++ src/gdb/testsuite/gdb.base/charset.c	2011-12-13 17:07:57.892183729 +0000
@@ -124,10 +124,6 @@ extern void malloc_stub (void);
 
 int main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
 
   malloc_stub ();
 
Index: src/gdb/testsuite/gdb.base/code-expr.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/code-expr.exp	2011-01-13 15:07:59.926075001 +0000
+++ src/gdb/testsuite/gdb.base/code-expr.exp	2011-12-13 17:07:57.902183729 +0000
@@ -41,10 +41,6 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 gdb_test_no_output "set print sevenbit-strings"
 gdb_test_no_output "set print address off"
 gdb_test_no_output "set width 0"
Index: src/gdb/testsuite/gdb.base/commands.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/commands.exp	2011-11-10 11:28:26.822197393 +0000
+++ src/gdb/testsuite/gdb.base/commands.exp	2011-12-13 17:07:57.932183729 +0000
@@ -319,7 +319,7 @@ proc watchpoint_command_test {} {
 	    # scope.
 	    fail $test
 	}
- 	-re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the program has left the block in.*which its expression is valid.*run.c:(57|82).*$gdb_prompt $" {
+	-re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the program has left the block in.*which its expression is valid.*run.c:(53|77).*$gdb_prompt $" {
 	    pass $test
 	}
    }
Index: src/gdb/testsuite/gdb.base/completion.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/completion.exp	2011-05-04 15:53:58.609463001 +0100
+++ src/gdb/testsuite/gdb.base/completion.exp	2011-12-13 17:07:57.942183729 +0000
@@ -51,8 +51,6 @@ if $tracelevel then {
         }
 
 
-global usestubs
-
 #
 # test running programs
 #
Index: src/gdb/testsuite/gdb.base/condbreak.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/condbreak.exp	2011-01-13 15:08:00.326075001 +0000
+++ src/gdb/testsuite/gdb.base/condbreak.exp	2011-12-13 17:07:57.952183729 +0000
@@ -22,8 +22,6 @@ if $tracelevel then {
 	strace $tracelevel
 	}
 
-global usestubs
-
 #
 # test running programs
 #
@@ -58,10 +56,6 @@ gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 set bp_location1  [gdb_get_line_number "set breakpoint 1 here"]
 set bp_location6  [gdb_get_line_number "set breakpoint 6 here"]
 set bp_location8  [gdb_get_line_number "set breakpoint 8 here" $srcfile1]
Index: src/gdb/testsuite/gdb.base/consecutive.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/consecutive.c	2011-01-13 10:48:04.838963998 +0000
+++ src/gdb/testsuite/gdb.base/consecutive.c	2011-12-13 17:07:57.962183729 +0000
@@ -12,9 +12,5 @@ int foo ()
 
 main()
 {
-#ifdef usestubs
-    set_debug_traps ();
-    breakpoint ();
-#endif
   foo ();
 }
Index: src/gdb/testsuite/gdb.base/consecutive.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/consecutive.exp	2011-01-13 15:08:00.336075002 +0000
+++ src/gdb/testsuite/gdb.base/consecutive.exp	2011-12-13 17:07:57.972183729 +0000
@@ -43,10 +43,6 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 if ![runto_main] then {
     perror "couldn't run to breakpoint"
     continue
Index: src/gdb/testsuite/gdb.base/constvars.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/constvars.c	2011-01-13 10:48:04.838963998 +0000
+++ src/gdb/testsuite/gdb.base/constvars.c	2011-12-13 17:07:57.982183729 +0000
@@ -191,10 +191,6 @@ main (void)
   const char           & radiation = laconic;
   volatile signed char & remuneration = lemonade;
   */
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
   marker1 ();
     
 
Index: src/gdb/testsuite/gdb.base/cvexpr.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/cvexpr.exp	2011-01-13 15:08:00.366075000 +0000
+++ src/gdb/testsuite/gdb.base/cvexpr.exp	2011-12-13 17:07:58.012183729 +0000
@@ -41,10 +41,6 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 gdb_test_no_output "set print sevenbit-strings"
 gdb_test_no_output "set print address off"
 gdb_test_no_output "set width 0"
Index: src/gdb/testsuite/gdb.base/define.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/define.exp	2011-01-13 15:08:00.386075002 +0000
+++ src/gdb/testsuite/gdb.base/define.exp	2011-12-13 17:07:58.022183729 +0000
@@ -20,8 +20,6 @@ if $tracelevel then {
 	strace $tracelevel
 	}
 
-global usestubs
-
 
 #
 # test running programs
Index: src/gdb/testsuite/gdb.base/display.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/display.exp	2011-12-05 14:09:28.284600734 +0000
+++ src/gdb/testsuite/gdb.base/display.exp	2011-12-13 17:07:58.052183729 +0000
@@ -31,9 +31,6 @@ if  { [gdb_compile "${srcdir}/${subdir}/
     untested display.exp
     return -1
 }
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
 
 # Preserve the old timeout, and set a new one that should be
 # sufficient to avoid timing out during this test.
Index: src/gdb/testsuite/gdb.base/ena-dis-br.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/ena-dis-br.exp	2011-02-24 12:17:15.998591998 +0000
+++ src/gdb/testsuite/gdb.base/ena-dis-br.exp	2011-12-13 17:07:58.062183729 +0000
@@ -20,8 +20,6 @@ if $tracelevel then {
     strace $tracelevel
 }
 
-global usestubs
-
 #
 # test running programs
 #
Index: src/gdb/testsuite/gdb.base/environ.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/environ.exp	2011-01-13 15:08:00.556074999 +0000
+++ src/gdb/testsuite/gdb.base/environ.exp	2011-12-13 17:07:58.092183729 +0000
@@ -18,8 +18,6 @@ if $tracelevel then {
 	strace $tracelevel
 	}
 
-global usestubs
-
 #
 # test running programs
 #
Index: src/gdb/testsuite/gdb.base/exprs.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/exprs.c	2011-10-14 09:41:32.097572909 +0100
+++ src/gdb/testsuite/gdb.base/exprs.c	2011-12-13 17:07:58.102183729 +0000
@@ -8,10 +8,6 @@ main (argc, argv, envp)
 #endif
 {
     extern void dummy();
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
     dummy();
     return 0;
     
Index: src/gdb/testsuite/gdb.base/freebpcmd.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/freebpcmd.c	2011-01-13 15:08:00.646075004 +0000
+++ src/gdb/testsuite/gdb.base/freebpcmd.c	2011-12-13 17:07:58.112183729 +0000
@@ -24,11 +24,6 @@ main (int argc, char **argv)
 {
   int i;
 
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
-
   for (i = 0; i < 100; i++)
     printf (">>> %d\n", i); /* euphonium */
 
Index: src/gdb/testsuite/gdb.base/funcargs.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/funcargs.c	2011-06-07 18:54:43.108164930 +0100
+++ src/gdb/testsuite/gdb.base/funcargs.c	2011-12-13 17:07:58.122183729 +0000
@@ -837,10 +837,6 @@ int main ()
   void (*pointer_to_call0a) (char, short, int, long) = (void (*)(char, short, int, long))call0a;
   double (*pointer_to_call_with_trampolines) (double) = call_with_trampolines;
 
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   /* Test calling with basic integer types */
   call0a (c, s, i, l);
   call0b (s, i, l, c);
Index: src/gdb/testsuite/gdb.base/gnu-ifunc.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/gnu-ifunc.exp	2011-05-04 15:19:31.819463002 +0100
+++ src/gdb/testsuite/gdb.base/gnu-ifunc.exp	2011-12-13 17:07:58.142183729 +0000
@@ -127,20 +127,17 @@ gdb_test "info sym $expect_out(1,string)
 # Test statically linked ifunc resolving during inferior start.
 # https://bugzilla.redhat.com/show_bug.cgi?id=624967
 
-if ![target_info exists gdb_stub] {
+# Compile $staticbinfile separately as it may exit on error (ld/12595).
 
-    # Compile $staticbinfile separately as it may exit on error (ld/12595).
-
-    if { [gdb_compile ${srcdir}/${subdir}/$libsrc $lib_o object {}] != ""
-	 || [gdb_compile "${srcdir}/${subdir}/$srcfile $lib_o" $staticbinfile executable {debug}] != "" } {
-	untested "Could not compile static executable $staticbinfile."
-	return -1
-    }
+if { [gdb_compile ${srcdir}/${subdir}/$libsrc $lib_o object {}] != ""
+     || [gdb_compile "${srcdir}/${subdir}/$srcfile $lib_o" $staticbinfile executable {debug}] != "" } {
+    untested "Could not compile static executable $staticbinfile."
+    return -1
+}
 
-    clean_restart $staticexecutable
+clean_restart $staticexecutable
 
-    gdb_breakpoint "gnu_ifunc"
-    gdb_breakpoint "main"
-    gdb_run_cmd
-    gdb_test "" "Breakpoint \[0-9\]*, main .*" "static gnu_ifunc"
-}
+gdb_breakpoint "gnu_ifunc"
+gdb_breakpoint "main"
+gdb_run_cmd
+gdb_test "" "Breakpoint \[0-9\]*, main .*" "static gnu_ifunc"
Index: src/gdb/testsuite/gdb.base/int-type.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/int-type.c	2011-01-13 10:48:05.818963998 +0000
+++ src/gdb/testsuite/gdb.base/int-type.c	2011-12-13 17:07:58.152183729 +0000
@@ -9,11 +9,6 @@ int w;
 int main ()
 {
    
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
-
     x = 14;
     y = 3;
     z = 2;
Index: src/gdb/testsuite/gdb.base/interrupt.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/interrupt.c	2011-01-13 10:48:05.818963998 +0000
+++ src/gdb/testsuite/gdb.base/interrupt.c	2011-12-13 17:07:58.162183729 +0000
@@ -17,10 +17,6 @@ main ()
 {
   char x;
   int nbytes;
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
 #ifdef SIGNALS
   signal (SIGINT, sigint_handler);
 #endif
Index: src/gdb/testsuite/gdb.base/langs0.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/langs0.c	2011-01-13 10:48:05.818963998 +0000
+++ src/gdb/testsuite/gdb.base/langs0.c	2011-12-13 17:07:58.172183729 +0000
@@ -22,10 +22,6 @@ langs0__2do ()
 int
 main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   if (langs0__2do () == 5003)
     /* Success.  */
     return 0;
Index: src/gdb/testsuite/gdb.base/list.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/list.exp	2011-12-06 19:52:35.714865306 +0000
+++ src/gdb/testsuite/gdb.base/list.exp	2011-12-13 17:07:58.182183729 +0000
@@ -98,7 +98,7 @@ proc test_listsize {} {
 	runto_main;
 	unsupported "list default lines around main";
     } else {
-	gdb_test "list" "(1\[ \t\]+#include \"list0.h\".*10\[ \t\]+x = 0;|2.*11\[ \t\]+foo .x\[+)\]+;)" "list default lines around main"
+	gdb_test "list" "(1\[ \t\]+#include \"list0.h\".*7\[ \t\]+x = 0;\r\n.*10\[ \t\]+foo .x\[+)\]+;)" "list default lines around main"
     }
 
     # Ensure we can limit printouts to one line
@@ -179,7 +179,7 @@ proc test_list_filename_and_number {} {
 
     send_gdb "list list0.c:1\n"
     gdb_expect {
-	-re "1\[ \t\]+#include \"list0.h\".*10\[ \t]+x = 0;\r\n$gdb_prompt $" {
+	-re "1\[ \t\]+#include \"list0.h\".*10\[ \t\]+foo .x\[+)\]+;\r\n$gdb_prompt $" {
 	    incr testcnt 
 	}
 	-re ".*$gdb_prompt $" { fail "list list0.c:1" ; gdb_suppress_tests }
@@ -223,7 +223,7 @@ proc test_list_function {} {
     # gcc appears to generate incorrect debugging information for code
     # in include files, which breaks this test.
     # SunPRO cc is the second case below, it's also correct.
-    gdb_test "list main" "(5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;|1\[ \t\]+#include .*10\[ \t\]+x = 0;)" "list function in source file 1"
+    gdb_test "list main" "(5\[ \t\]+int x;.*8\[ \t\]+foo \[(\]+.*\[)\]+;|1\[ \t\]+#include .*7\[ \t\]+x = 0;)" "list function in source file 1"
 
     # Ultrix gdb takes the second case below; it's also correct.
     # SunPRO cc is the third case.
@@ -335,14 +335,14 @@ proc test_list_backwards {} {
 
     send_gdb "list -\n"
     gdb_expect {
-	-re "8\[ \t\]+breakpoint\[(\]\[)\];.*17\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
+	-re "8\[ \t\]+foo \[(\]+.*\[)\]+;.*17\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
 	-re ".*$gdb_prompt $" { fail "list 8-17" ; gdb_suppress_tests }
 	timeout { fail "list 8-17 (timeout)" ; gdb_suppress_tests }
     }
 
     send_gdb "list -\n"
     gdb_expect {
-	-re "1\[ \t\]+#include .*7\[ \t\]+set_debug_traps\[(\]\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
+	-re "1\[ \t\]+#include .*7\[ \t\]+x = 0;\r\n$gdb_prompt $" { incr testcnt }
 	-re ".*$gdb_prompt $" { fail "list 1-7" ; gdb_suppress_tests }
 	timeout { fail "list 1-7 (timeout)" ; gdb_suppress_tests }
     }
@@ -387,7 +387,7 @@ proc test_list_filename_and_function {}
     # SunPRO cc is the second case below, it's also correct.
     send_gdb "list list0.c:main\n"
     gdb_expect {
-	-re "1\[ \t\]+#include .*10\[ \t\]+x = 0;\r\n$gdb_prompt $" {
+	-re "1\[ \t\]+#include .*10\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
 	    incr testcnt
 	}
 	-re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
@@ -524,10 +524,6 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 gdb_test_no_output "set width 0"
 
 test_listsize
Index: src/gdb/testsuite/gdb.base/list0.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/list0.c	2011-01-13 10:48:05.818963998 +0000
+++ src/gdb/testsuite/gdb.base/list0.c	2011-12-13 17:07:58.192183729 +0000
@@ -3,14 +3,14 @@
 int main ()
 {
     int x;
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
+
     x = 0;
     foo (x++);
     foo (x++);
     foo (x++);
+    foo (x++);
+    foo (x++);
+    foo (x++);
     foo (x++);
     foo (x++);
     foo (x++);
Index: src/gdb/testsuite/gdb.base/maint.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/maint.exp	2011-11-10 11:28:27.312197393 +0000
+++ src/gdb/testsuite/gdb.base/maint.exp	2011-12-13 17:07:58.202183729 +0000
@@ -52,8 +52,6 @@ if $tracelevel then {
         strace $tracelevel
         }
 
-global usestubs
-
 set testfile "break"
 set srcfile ${testfile}.c
 set srcfile1 ${testfile}1.c
Index: src/gdb/testsuite/gdb.base/mips_pro.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/mips_pro.c	2011-01-13 10:48:05.818963998 +0000
+++ src/gdb/testsuite/gdb.base/mips_pro.c	2011-12-13 17:07:58.212183729 +0000
@@ -49,9 +49,5 @@ main (argc, argv)
      char **argv;
 #endif
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   return top (-1) + top (1);
 }
Index: src/gdb/testsuite/gdb.base/miscexprs.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/miscexprs.c	2011-01-13 10:48:05.818963998 +0000
+++ src/gdb/testsuite/gdb.base/miscexprs.c	2011-12-13 17:07:58.232183729 +0000
@@ -39,11 +39,6 @@ main ()
   sbig.s[90] = 255;
   lbig.l[333] = 999999999;
     
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
-
   marker1 ();
   return 0;
 }
Index: src/gdb/testsuite/gdb.base/nodebug.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/nodebug.c	2011-01-13 10:48:05.888963998 +0000
+++ src/gdb/testsuite/gdb.base/nodebug.c	2011-12-13 17:07:58.242183729 +0000
@@ -52,10 +52,6 @@ main (argc, argv)
      char **argv;
 #endif
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   return top (argc);
 }
 
Index: src/gdb/testsuite/gdb.base/opaque0.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/opaque0.c	2011-01-13 10:48:05.888963998 +0000
+++ src/gdb/testsuite/gdb.base/opaque0.c	2011-12-13 17:07:58.262183729 +0000
@@ -13,10 +13,6 @@ extern void putfoo (struct foo *foop);
 
 int main ()
 {
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
     foop = getfoo ();
     putfoo (foop);
     return 0;
Index: src/gdb/testsuite/gdb.base/pending.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/pending.exp	2011-01-13 15:08:01.786075002 +0000
+++ src/gdb/testsuite/gdb.base/pending.exp	2011-12-13 17:07:58.272183729 +0000
@@ -85,9 +85,6 @@ gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 gdb_load_shlibs $lib_sl
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
 #
 # Test setting, querying, and modifying pending breakpoints
 #
Index: src/gdb/testsuite/gdb.base/pointers.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/pointers.c	2011-01-13 10:48:06.238963998 +0000
+++ src/gdb/testsuite/gdb.base/pointers.c	2011-12-13 17:07:58.282183729 +0000
@@ -91,10 +91,6 @@ int main ()
   void dummy();
   int more_code();
   
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   dummy();
 
   more_code ();
Index: src/gdb/testsuite/gdb.base/printcmds.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/printcmds.c	2011-02-01 15:27:47.524645004 +0000
+++ src/gdb/testsuite/gdb.base/printcmds.c	2011-12-13 17:07:58.292183729 +0000
@@ -122,10 +122,6 @@ struct some_struct
 
 int main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   malloc(1);
 
   /* Prevent AIX linker from removing variables.  */
Index: src/gdb/testsuite/gdb.base/ptype.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/ptype.c	2011-01-13 10:48:06.238963998 +0000
+++ src/gdb/testsuite/gdb.base/ptype.c	2011-12-13 17:07:58.302183729 +0000
@@ -290,10 +290,6 @@ int main ()
      sure it is linked in to this program.  */
   v_char_pointer = (char *) malloc (1);
 
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   /* Some linkers (e.g. on AIX) remove unreferenced variables,
      so make sure to reference them. */
   primary = blue;
Index: src/gdb/testsuite/gdb.base/recurse.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/recurse.c	2011-01-13 10:48:06.238963998 +0000
+++ src/gdb/testsuite/gdb.base/recurse.c	2011-12-13 17:07:58.312183729 +0000
@@ -22,10 +22,6 @@ recurse (a)
 
 int main()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   recurse (10);
   return 0;
 }
Index: src/gdb/testsuite/gdb.base/reread1.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/reread1.c	2011-01-13 10:48:06.488964006 +0000
+++ src/gdb/testsuite/gdb.base/reread1.c	2011-12-13 17:07:58.322183729 +0000
@@ -16,10 +16,6 @@ void foo()
 
 int main()
 {
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
   foo();
   bar();
   return 0;
Index: src/gdb/testsuite/gdb.base/reread2.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/reread2.c	2011-01-13 10:48:06.488964006 +0000
+++ src/gdb/testsuite/gdb.base/reread2.c	2011-12-13 17:07:58.332183729 +0000
@@ -12,10 +12,6 @@ void foo()
 
 int main()
 {
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
   foo();
   return 0;
 }
Index: src/gdb/testsuite/gdb.base/restore.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/restore.c	2011-01-13 10:48:06.488964006 +0000
+++ src/gdb/testsuite/gdb.base/restore.c	2011-12-13 17:07:58.342183729 +0000
@@ -269,10 +269,6 @@ driver (void)
 int main ()
 {
   register int local;
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   driver ();
   printf("exiting\n");
   return 0;
Index: src/gdb/testsuite/gdb.base/return.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/return.c	2011-01-13 10:48:06.498964011 +0000
+++ src/gdb/testsuite/gdb.base/return.c	2011-12-13 17:07:58.352183729 +0000
@@ -23,10 +23,6 @@ double tmp3;
 
 int main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   func1 ();
   printf("in main after func1\n");
   tmp2 = func2 ();
Index: src/gdb/testsuite/gdb.base/run.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/run.c	2011-01-13 10:48:06.498964011 +0000
+++ src/gdb/testsuite/gdb.base/run.c	2011-12-13 17:07:58.362183729 +0000
@@ -49,10 +49,6 @@ int argc;
 char *argv[], **envp;
 #endif
 {
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
 #ifdef FAKEARGV
     printf ("%d\n", factorial (1));
 #else    
Index: src/gdb/testsuite/gdb.base/scope0.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/scope0.c	2011-01-13 10:48:06.498964011 +0000
+++ src/gdb/testsuite/gdb.base/scope0.c	2011-12-13 17:07:58.372183729 +0000
@@ -20,10 +20,6 @@ void marker4 ();
 
 int main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   init0 ();
   foo ();
   autovars (5, 6);
Index: src/gdb/testsuite/gdb.base/sect-cmd.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/sect-cmd.exp	2011-01-13 15:08:02.266075000 +0000
+++ src/gdb/testsuite/gdb.base/sect-cmd.exp	2011-12-13 17:07:58.382183729 +0000
@@ -18,8 +18,6 @@ if $tracelevel then {
 	strace $tracelevel
 	}
 
-global usestubs
-
 #
 # test running programs
 #
Index: src/gdb/testsuite/gdb.base/sepdebug.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/sepdebug.c	2011-01-13 15:08:02.276075001 +0000
+++ src/gdb/testsuite/gdb.base/sepdebug.c	2011-12-13 17:07:58.392183729 +0000
@@ -84,10 +84,6 @@ int argc;
 char *argv[], **envp;
 #endif
 {
-#ifdef usestubs
-    set_debug_traps();  /* set breakpoint 5 here */
-    breakpoint();
-#endif
     if (argc == 12345) {  /* an unlikely value < 2^16, in case uninited */ /* set breakpoint 6 here */
 	fprintf (stderr, "usage:  factorial <number>\n");
 	return 1;
Index: src/gdb/testsuite/gdb.base/sepdebug.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/sepdebug.exp	2011-12-06 19:52:35.714865306 +0000
+++ src/gdb/testsuite/gdb.base/sepdebug.exp	2011-12-13 17:07:58.402183729 +0000
@@ -64,9 +64,6 @@ if { $gdb_file_cmd_debug_info != "debug"
     fail "No debug information found."
 }
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
 #
 # test simple breakpoint setting commands
 #
@@ -144,14 +141,7 @@ gdb_test "break multi_line_while_conditi
 set bp_location5 [gdb_get_line_number "set breakpoint 5 here"]
 set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
 
-#
-# check to see what breakpoints are set
-#
-if [target_info exists gdb_stub] {
-    set main_line $bp_location5
-} else {
-    set main_line $bp_location6
-}
+set main_line $bp_location6
 
 set bp_location7 [gdb_get_line_number "set breakpoint 7 here"]
 set bp_location8 [gdb_get_line_number "set breakpoint 8 here"]
@@ -673,10 +663,6 @@ proc test_different_dir {type test_diffe
 	"set separate debug location"
     gdb_load ${binfile}
 
-    if [target_info exists gdb_stub] {
-	gdb_step_for_stub;
-    }
-
     #
     # test break at function
     #
Index: src/gdb/testsuite/gdb.base/setshow.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/setshow.c	2011-01-13 10:48:06.498964011 +0000
+++ src/gdb/testsuite/gdb.base/setshow.c	2011-12-13 17:07:58.412183729 +0000
@@ -14,10 +14,6 @@ main(argc, argv)
 #endif
 {
   int i = 1;
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
 
   if (argc <= 0 || argc > 8)
     return -1;
Index: src/gdb/testsuite/gdb.base/setvar.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/setvar.c	2011-01-13 10:48:06.498964011 +0000
+++ src/gdb/testsuite/gdb.base/setvar.c	2011-12-13 17:07:58.422183729 +0000
@@ -10,10 +10,6 @@ main (argc, argv, envp)
 #endif
 {
     extern void dummy();
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
     dummy();
     return 0;
 }
Index: src/gdb/testsuite/gdb.base/sigall.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/sigall.c	2011-01-13 10:48:06.988963998 +0000
+++ src/gdb/testsuite/gdb.base/sigall.c	2011-12-13 17:07:58.432183729 +0000
@@ -1577,10 +1577,6 @@ return 0;
 int
 main ()
 {
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
 
 #ifdef SIG_SETMASK
   /* Ensure all the signals aren't blocked.
Index: src/gdb/testsuite/gdb.base/signals.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/signals.c	2011-01-13 10:48:06.988963998 +0000
+++ src/gdb/testsuite/gdb.base/signals.c	2011-12-13 17:07:58.442183729 +0000
@@ -38,10 +38,6 @@ func2 ()
 int
 main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
 #ifdef SIGALRM
   signal (SIGALRM, handler);
 #endif
Index: src/gdb/testsuite/gdb.base/structs.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/structs.c	2011-07-20 09:34:19.433654179 +0100
+++ src/gdb/testsuite/gdb.base/structs.c	2011-12-13 17:07:58.452183729 +0000
@@ -401,10 +401,6 @@ static struct { char c; } chartest[256];
 
 int main()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   int i;
 
   for (i = 0; i < 256; i++)
Index: src/gdb/testsuite/gdb.base/structs2.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/structs2.c	2011-01-13 10:48:07.128964011 +0000
+++ src/gdb/testsuite/gdb.base/structs2.c	2011-12-13 17:07:58.462183729 +0000
@@ -10,10 +10,6 @@ int bkpt;
 int
 main ()
 {
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
 
   bkpt = 0;
   param_reg (120, 130, 32000, 33000);
Index: src/gdb/testsuite/gdb.base/testenv.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/testenv.c	2011-10-05 15:23:37.000000000 +0100
+++ src/gdb/testsuite/gdb.base/testenv.c	2011-12-13 17:07:58.472183729 +0000
@@ -27,10 +27,6 @@ int main (int argc, char **argv, char **
 
 {
     int i, j;
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
 
     j = 0;
     for (i = 0; envp[i]; i++)
Index: src/gdb/testsuite/gdb.base/twice.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/twice.c	2011-01-13 10:48:07.128964011 +0000
+++ src/gdb/testsuite/gdb.base/twice.c	2011-12-13 17:07:58.482183729 +0000
@@ -11,10 +11,6 @@ int main ()
 
 {
     int y ;
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif    
     y = nothing () ;
     printf ("hello\n") ;
     return 0;
Index: src/gdb/testsuite/gdb.base/unload.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/unload.exp	2011-01-13 15:08:03.366075001 +0000
+++ src/gdb/testsuite/gdb.base/unload.exp	2011-12-13 17:07:58.492183729 +0000
@@ -69,10 +69,6 @@ gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 gdb_load_shlibs $lib_sl $lib_sl2
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 #
 # Test setting a breakpoint in a dynamically loaded library which is
 # manually loaded and unloaded
Index: src/gdb/testsuite/gdb.base/unwindonsignal.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/unwindonsignal.c	2011-01-13 15:08:03.386075004 +0000
+++ src/gdb/testsuite/gdb.base/unwindonsignal.c	2011-12-13 17:07:58.502183729 +0000
@@ -42,10 +42,6 @@ stop_here ()
 int
 main ()
 {
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
 
 #ifdef SIG_SETMASK
   /* Ensure all the signals aren't blocked.
Index: src/gdb/testsuite/gdb.base/watchpoint-solib.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/watchpoint-solib.exp	2011-01-13 15:08:03.556075000 +0000
+++ src/gdb/testsuite/gdb.base/watchpoint-solib.exp	2011-12-13 17:07:58.522183728 +0000
@@ -58,10 +58,6 @@ gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 gdb_load_shlibs $lib_sl
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 runto_main
 
 # Disable hardware watchpoints if necessary.
Index: src/gdb/testsuite/gdb.base/watchpoint.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/watchpoint.c	2011-12-13 16:02:27.742185086 +0000
+++ src/gdb/testsuite/gdb.base/watchpoint.c	2011-12-13 17:07:58.532183728 +0000
@@ -167,10 +167,6 @@ func7 (void)
 
 int main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   struct1.val = 1;
   struct2.val = 2;
   ptr1 = &struct1;
Index: src/gdb/testsuite/gdb.base/watchpoints.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/watchpoints.c	2011-01-13 15:08:03.586075004 +0000
+++ src/gdb/testsuite/gdb.base/watchpoints.c	2011-12-13 17:07:58.552183728 +0000
@@ -30,11 +30,6 @@ int ival4 = -1;
 int 
 main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
-
   for (count = 0; count < 4; count++) {
     ival1 = count; ival2 = count;
     ival3 = count; ival4 = count;
Index: src/gdb/testsuite/gdb.base/whatis.c
===================================================================
--- src.orig/gdb/testsuite/gdb.base/whatis.c	2011-01-13 15:08:03.646074999 +0000
+++ src/gdb/testsuite/gdb.base/whatis.c	2011-12-13 17:07:58.562183728 +0000
@@ -248,10 +248,6 @@ enum cars {chevy, ford, porsche} clunker
 
 int main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   /* Some linkers (e.g. on AIX) remove unreferenced variables,
      so make sure to reference them. */
   v_char = 0;
Index: src/gdb/testsuite/gdb.cp/annota2.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.cp/annota2.exp	2011-03-14 12:40:23.858353561 +0000
+++ src/gdb/testsuite/gdb.cp/annota2.exp	2011-12-13 17:07:58.582183728 +0000
@@ -51,10 +51,6 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 #
 # line number where we need to stop in main
 #
Index: src/gdb/testsuite/gdb.cp/annota3.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.cp/annota3.exp	2011-03-14 12:40:23.858353561 +0000
+++ src/gdb/testsuite/gdb.cp/annota3.exp	2011-12-13 17:07:58.602183727 +0000
@@ -51,10 +51,6 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 #
 # line number where we need to stop in main
 #
Index: src/gdb/testsuite/gdb.cp/classes.cc
===================================================================
--- src.orig/gdb/testsuite/gdb.cp/classes.cc	2011-01-13 15:08:04.166075001 +0000
+++ src/gdb/testsuite/gdb.cp/classes.cc	2011-12-13 17:07:58.612183726 +0000
@@ -577,10 +577,6 @@ void use_methods ()
 int
 main()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   dummy();
   inheritance1 ();
   inheritance3 ();
Index: src/gdb/testsuite/gdb.cp/cplusfuncs.cc
===================================================================
--- src.orig/gdb/testsuite/gdb.cp/cplusfuncs.cc	2011-01-13 10:48:08.168964000 +0000
+++ src/gdb/testsuite/gdb.cp/cplusfuncs.cc	2011-12-13 17:07:58.632183727 +0000
@@ -58,18 +58,7 @@ public:
   const char *ccpfoo;
 };
 
-#ifdef usestubs
-extern "C" { 
-   void set_debug_traps();
-   void breakpoint();
-};
-#endif
-
 int main () {
-#ifdef usestubs
-   set_debug_traps();
-   breakpoint();
-#endif
    int z=3;
 }
 
Index: src/gdb/testsuite/gdb.cp/derivation.cc
===================================================================
--- src.orig/gdb/testsuite/gdb.cp/derivation.cc	2011-01-13 10:48:08.168964000 +0000
+++ src/gdb/testsuite/gdb.cp/derivation.cc	2011-12-13 17:07:58.642183728 +0000
@@ -208,12 +208,6 @@ int main(void)
     F f_instance;
     G g_instance;
     
-    #ifdef usestubs
-       set_debug_traps();
-       breakpoint();
-    #endif
-    
-
     marker1(); // marker1-returns-here
     
     a_instance.a = 20; // marker1-returns-here
Index: src/gdb/testsuite/gdb.cp/formatted-ref.cc
===================================================================
--- src.orig/gdb/testsuite/gdb.cp/formatted-ref.cc	2011-01-13 15:08:04.686075004 +0000
+++ src/gdb/testsuite/gdb.cp/formatted-ref.cc	2011-12-13 17:07:58.652183729 +0000
@@ -38,11 +38,6 @@ Enum1 e1 = Val11;
 int main(void) 
 {
 
-  #ifdef usestubs
-     set_debug_traps();
-     breakpoint();
-  #endif
-
   f1 (s1, e1, i1);
 
 }
Index: src/gdb/testsuite/gdb.cp/misc.cc
===================================================================
--- src.orig/gdb/testsuite/gdb.cp/misc.cc	2011-01-13 15:08:05.276075002 +0000
+++ src/gdb/testsuite/gdb.cp/misc.cc	2011-12-13 17:07:58.662183729 +0000
@@ -569,10 +569,6 @@ void use_methods ()
 int
 main()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   dummy();
   inheritance1 ();
   inheritance3 ();
Index: src/gdb/testsuite/gdb.cp/overload.cc
===================================================================
--- src.orig/gdb/testsuite/gdb.cp/overload.cc	2011-03-01 16:00:22.482814002 +0000
+++ src/gdb/testsuite/gdb.cp/overload.cc	2011-12-13 17:07:58.672183729 +0000
@@ -135,11 +135,6 @@ int main ()
     N::nsoverload(2);
     N::nsoverload(2, 3);
 
-    #ifdef usestubs
-       set_debug_traps();
-       breakpoint();
-    #endif
-
     overloadNamespace (1);
     overloadNamespace (dummyInstance);
     XXX::overloadNamespace ('a');
Index: src/gdb/testsuite/gdb.cp/ovldbreak.cc
===================================================================
--- src.orig/gdb/testsuite/gdb.cp/ovldbreak.cc	2011-01-13 10:48:08.628963986 +0000
+++ src/gdb/testsuite/gdb.cp/ovldbreak.cc	2011-12-13 17:07:58.682183729 +0000
@@ -89,10 +89,6 @@ int main ()
     foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
    
 
-    #ifdef usestubs
-       set_debug_traps();
-       breakpoint();
-    #endif
 
 
     marker1();
Index: src/gdb/testsuite/gdb.cp/ovldbreak.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.cp/ovldbreak.exp	2011-12-06 19:52:36.044865305 +0000
+++ src/gdb/testsuite/gdb.cp/ovldbreak.exp	2011-12-13 17:19:11.352183495 +0000
@@ -150,18 +150,18 @@ gdb_test_no_output "set multiple-symbols
 
 # Set breakpoints on foo::overload1arg, one by one.
 
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 12    2 111
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 11    3 112
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 10    4 113
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  9    5 114
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  8    6 115
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  7    7 116
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  6    8 117
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  5    9 118
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  4   10 119
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  3   11 120
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  2   12 121
-set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 13   13 110
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 12    2 107
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 11    3 108
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 10    4 109
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  9    5 110
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  8    6 111
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  7    7 112
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  6    8 113
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  5    9 114
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  4   10 115
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  3   11 116
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg"  2   12 117
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 13   13 106
 
 
 
@@ -171,18 +171,18 @@ gdb_test "info break" \
     "Num     Type\[\t \]+Disp Enb Address\[\t \]+What.*
 \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in main(\\((|void)\\))? at.*$srcfile:49\r
 \[\t \]+breakpoint already hit 1 time\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:111\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:112\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short( int)?\\) at.*$srcfile:114\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:115\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:116\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:117\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long( int)?\\) at.*$srcfile:118\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:119\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:120\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:121\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:110" \
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:107\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:108\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:109\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short( int)?\\) at.*$srcfile:110\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:111\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:112\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:113\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long( int)?\\) at.*$srcfile:114\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:115\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:116\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:117\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:106" \
     "breakpoint info (after setting one-by-one)"
 
 
@@ -229,18 +229,18 @@ gdb_test "info break" \
     "Num     Type\[\t \]+Disp Enb Address\[\t \]+What.*
 \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in main(\\((|void)\\))? at.*$srcfile:49\r
 \[\t \]+breakpoint already hit 1 time\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:111\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:112\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short( int)?\\) at.*$srcfile:114\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:115\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:116\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:117\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long( int)?\\) at.*$srcfile:118\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:119\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:120\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:121\r
-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:110" \
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:107\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:108\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:109\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short( int)?\\) at.*$srcfile:110\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:111\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:112\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:113\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long( int)?\\) at.*$srcfile:114\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:115\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:116\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:117\r
+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:106" \
     "breakpoint info (after cancel)"
 
 
@@ -307,18 +307,18 @@ gdb_expect {
 gdb_test "info break" \
     "Num     Type\[\t \]+Disp Enb Address\[\t \]+What.*
 \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+<MULTIPLE>\[\t \]*\r
-\[0-9\]+.1\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:121\r
-\[0-9\]+.2\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:120\r
-\[0-9\]+.3\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:119\r
-\[0-9\]+.4\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long( int)?\\) at.*$srcfile:118\r
-\[0-9\]+.5\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:117\r
-\[0-9\]+.6\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:116\r
-\[0-9\]+.7\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:115\r
-\[0-9\]+.8\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short( int)?\\) at.*$srcfile:114\r
-\[0-9\]+.9\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r
-\[0-9\]+.10\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:112\r
-\[0-9\]+.11\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:111\r
-\[0-9\]+.12\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:110" \
+\[0-9\]+.1\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:117\r
+\[0-9\]+.2\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:116\r
+\[0-9\]+.3\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:115\r
+\[0-9\]+.4\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long( int)?\\) at.*$srcfile:114\r
+\[0-9\]+.5\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:113\r
+\[0-9\]+.6\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:112\r
+\[0-9\]+.7\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:111\r
+\[0-9\]+.8\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short( int)?\\) at.*$srcfile:110\r
+\[0-9\]+.9\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:109\r
+\[0-9\]+.10\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:108\r
+\[0-9\]+.11\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:107\r
+\[0-9\]+.12\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:106" \
     "breakpoint info (after setting on all)"
 
 
Index: src/gdb/testsuite/gdb.cp/ref-params.cc
===================================================================
--- src.orig/gdb/testsuite/gdb.cp/ref-params.cc	2011-01-13 15:08:05.366075001 +0000
+++ src/gdb/testsuite/gdb.cp/ref-params.cc	2011-12-13 17:07:58.702183728 +0000
@@ -61,11 +61,6 @@ int main(void)
   Child Q(42);
   Child& QR = Q;
 
-  #ifdef usestubs
-     set_debug_traps();
-     breakpoint();
-  #endif
-
   /* Set breakpoint marker1 here.  */
 
   f2(Q);
Index: src/gdb/testsuite/gdb.cp/ref-types.cc
===================================================================
--- src.orig/gdb/testsuite/gdb.cp/ref-types.cc	2011-01-13 15:08:05.376075002 +0000
+++ src/gdb/testsuite/gdb.cp/ref-types.cc	2011-12-13 17:07:58.712183727 +0000
@@ -41,10 +41,6 @@ int main(void)
     as[2] = 2;
     as[3] = 3;
 
-   #ifdef usestubs
-       set_debug_traps();
-       breakpoint();
-    #endif
     marker1();
 
     main2();
Index: src/gdb/testsuite/gdb.cp/templates.cc
===================================================================
--- src.orig/gdb/testsuite/gdb.cp/templates.cc	2011-01-13 10:48:08.958963995 +0000
+++ src/gdb/testsuite/gdb.cp/templates.cc	2011-12-13 17:07:58.722183726 +0000
@@ -734,10 +734,7 @@ int main()
 {
     int i;
     long l, m, n;
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
+
     i = i + 1;
 
     // New tests added here
Index: src/gdb/testsuite/gdb.cp/virtfunc.cc
===================================================================
--- src.orig/gdb/testsuite/gdb.cp/virtfunc.cc	2011-01-13 10:48:08.958963995 +0000
+++ src/gdb/testsuite/gdb.cp/virtfunc.cc	2011-12-13 17:07:58.732183726 +0000
@@ -182,19 +182,9 @@ void test_calls()
         TEST(pEe->D::vg(), 102);
 	printf("Did %d tests, of which %d failed.\n", all_count, failed_count);
 }
-#ifdef usestubs
-extern "C" {
-  void set_debug_traps();
-  void breakpoint();
-};
-#endif
 
 int main()
 {
-#ifdef usestubs
-   set_debug_traps();
-   breakpoint();
-#endif
     init();
 
     e.w = 7;
Index: src/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp	2011-02-01 15:27:47.544644993 +0000
+++ src/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp	2011-12-13 17:07:58.762183729 +0000
@@ -49,9 +49,6 @@ if {$result != 0} {
 }
 
 gdb_load ${binfile}
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}    
 
 if ![runto "*${break_at}"] {
     return -1
Index: src/gdb/testsuite/gdb.hp/gdb.aCC/run.c
===================================================================
--- src.orig/gdb/testsuite/gdb.hp/gdb.aCC/run.c	2011-01-13 10:48:10.148963998 +0000
+++ src/gdb/testsuite/gdb.hp/gdb.aCC/run.c	2011-12-13 17:07:58.772183729 +0000
@@ -42,10 +42,6 @@ int main (int argc, char *argv[], char *
 char *argv[], **envp;*/
 {
     int factorial (int);
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
 #ifdef FAKEARGV
     printf ("%d\n", factorial (1));
 #else    
Index: src/gdb/testsuite/gdb.hp/gdb.base-hp/callfwmall.c
===================================================================
--- src.orig/gdb/testsuite/gdb.hp/gdb.base-hp/callfwmall.c	2011-01-13 10:48:10.258963998 +0000
+++ src/gdb/testsuite/gdb.hp/gdb.base-hp/callfwmall.c	2011-12-13 17:07:58.792183729 +0000
@@ -180,10 +180,6 @@ int main()
 main ()
 #endif
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   t_structs_c(struct_val1);
   return 0;
   
Index: src/gdb/testsuite/gdb.hp/gdb.compat/xdb0.c
===================================================================
--- src.orig/gdb/testsuite/gdb.hp/gdb.compat/xdb0.c	2011-01-13 10:48:10.288963998 +0000
+++ src/gdb/testsuite/gdb.hp/gdb.compat/xdb0.c	2011-12-13 17:07:58.802183728 +0000
@@ -3,10 +3,7 @@
 main ()
 {
     int x;
-#ifdef usestubs
-    set_debug_traps();
-    breakpoint();
-#endif
+
     x = 0;
     foo (x++);
     foo (x++);
Index: src/gdb/testsuite/gdb.hp/gdb.compat/xdb1.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.hp/gdb.compat/xdb1.exp	2011-01-13 15:08:08.076075002 +0000
+++ src/gdb/testsuite/gdb.hp/gdb.compat/xdb1.exp	2011-12-13 17:07:58.812183728 +0000
@@ -22,8 +22,6 @@ if $tracelevel then {
 
 if { [skip_hp_tests] } then { continue }
 
-global usestubs
-
 #
 # test running programs
 #
Index: src/gdb/testsuite/gdb.mi/mi-pending.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.mi/mi-pending.exp	2011-01-13 15:08:08.156075000 +0000
+++ src/gdb/testsuite/gdb.mi/mi-pending.exp	2011-12-13 17:07:58.862183728 +0000
@@ -56,10 +56,6 @@ mi_gdb_reinitialize_dir $srcdir/$subdir
 mi_gdb_load ${binfile}
 mi_load_shlibs $lib_sl
 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 # Set pending breakpoint via MI
 mi_gdb_test "-break-insert -f pendfunc1" \
     ".*\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"<PENDING>\",pending=\"pendfunc1\",times=\"0\",original-location=\"pendfunc1\"\}"\
Index: src/gdb/testsuite/gdb.reverse/consecutive-reverse.c
===================================================================
--- src.orig/gdb/testsuite/gdb.reverse/consecutive-reverse.c	2011-01-13 15:08:10.096074999 +0000
+++ src/gdb/testsuite/gdb.reverse/consecutive-reverse.c	2011-12-13 17:07:58.862183728 +0000
@@ -29,10 +29,6 @@ int foo ()
 
 main()
 {
-#ifdef usestubs
-    set_debug_traps ();
-    breakpoint ();
-#endif
   foo ();
 } /* end of main */
 
Index: src/gdb/testsuite/gdb.reverse/sigall-reverse.c
===================================================================
--- src.orig/gdb/testsuite/gdb.reverse/sigall-reverse.c	2011-01-13 15:08:10.116075001 +0000
+++ src/gdb/testsuite/gdb.reverse/sigall-reverse.c	2011-12-13 17:07:58.872183729 +0000
@@ -1168,11 +1168,6 @@ return 0;
 int
 main ()
 {
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
-
 #ifdef SIG_SETMASK
   /* Ensure all the signals aren't blocked.
      The environment in which the testsuite is run may have blocked some
Index: src/gdb/testsuite/gdb.reverse/until-reverse.c
===================================================================
--- src.orig/gdb/testsuite/gdb.reverse/until-reverse.c	2011-01-13 15:08:10.666075001 +0000
+++ src/gdb/testsuite/gdb.reverse/until-reverse.c	2011-12-13 17:07:58.882183729 +0000
@@ -78,10 +78,6 @@ int argc;
 char *argv[], **envp;
 #endif
 {
-#ifdef usestubs
-    set_debug_traps();  /* set breakpoint 5 here */
-    breakpoint();
-#endif
     if (argc == 12345) {  /* an unlikely value < 2^16, in case uninited */ /* set breakpoint 6 here */
 	fprintf (stderr, "usage:  factorial <number>\n");
 	return 1;
Index: src/gdb/testsuite/gdb.reverse/watch-reverse.c
===================================================================
--- src.orig/gdb/testsuite/gdb.reverse/watch-reverse.c	2011-01-13 15:08:10.666075001 +0000
+++ src/gdb/testsuite/gdb.reverse/watch-reverse.c	2011-12-13 17:07:58.892183729 +0000
@@ -139,10 +139,6 @@ func4 ()
 
 int main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   struct1.val = 1;
   struct2.val = 2;
   ptr1 = &struct1;
Index: src/gdb/testsuite/gdb.trace/actions.c
===================================================================
--- src.orig/gdb/testsuite/gdb.trace/actions.c	2011-11-22 13:39:21.582391870 +0000
+++ src/gdb/testsuite/gdb.trace/actions.c	2011-12-13 17:07:58.902183728 +0000
@@ -119,11 +119,6 @@ main (argc, argv, envp)
   int i;
   unsigned long myparms[10];
 
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
-
   begin ();
   for (i = 0; i < sizeof (myparms) / sizeof (myparms[0]); i++)
     myparms[i] = i;
Index: src/gdb/testsuite/gdb.trace/circ.c
===================================================================
--- src.orig/gdb/testsuite/gdb.trace/circ.c	2011-01-13 10:48:12.908964001 +0000
+++ src/gdb/testsuite/gdb.trace/circ.c	2011-12-13 17:07:58.912183727 +0000
@@ -61,11 +61,6 @@ main (argc, argv, envp)
 {
   int i;
 
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
-
   begin ();
   for (i = 0; i < sizeof(testload) / sizeof(testload[0]); i++)
     testload[i] = i + 1;
@@ -83,8 +78,5 @@ main (argc, argv, envp)
 
   end ();
 
-#ifdef usestubs
-  breakpoint ();
-#endif
   return 0;
 }
Index: src/gdb/testsuite/gdb.trace/circ.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.trace/circ.exp	2011-01-13 15:08:11.426075002 +0000
+++ src/gdb/testsuite/gdb.trace/circ.exp	2011-12-13 17:07:58.922183727 +0000
@@ -192,10 +192,6 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load $binfile
  
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-
 gdb_test_no_output "set circular-trace-buffer on" \
     "set circular-trace-buffer on"
 
Index: src/gdb/testsuite/gdb.trace/collection.c
===================================================================
--- src.orig/gdb/testsuite/gdb.trace/collection.c	2011-11-10 11:28:27.782197393 +0000
+++ src/gdb/testsuite/gdb.trace/collection.c	2011-12-13 17:07:58.932183727 +0000
@@ -225,11 +225,6 @@ main (argc, argv, envp)
   test_struct mystruct;
   int         myarray[4];
 
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
-
   begin ();
   /* Assign collectable values to global variables. */
   l0  = s0  = c0  = 0;     l1  = s1  = c1  = 1;
Index: src/gdb/testsuite/lib/gdb.exp
===================================================================
--- src.orig/gdb/testsuite/lib/gdb.exp	2011-12-05 14:09:29.404600734 +0000
+++ src/gdb/testsuite/lib/gdb.exp	2011-12-13 17:07:58.952183727 +0000
@@ -268,13 +268,6 @@ proc gdb_run_cmd {args} {
 		}
 	    }
 	}
-	if [target_info exists gdb_stub] {
-	    gdb_expect 60 {
-		-re "$gdb_prompt $" {
-		    send_gdb "continue\n"
-		}
-	    }
-	}
 	return
     }
 
@@ -456,26 +449,12 @@ proc runto { function args } {
 }
 
 # Ask gdb to run until we hit a breakpoint at main.
-# The case where the target uses stubs has to be handled
-# specially--if it uses stubs, assuming we hit
-# breakpoint() and just step out of the function.
 #
 # N.B. This function deletes all existing breakpoints.
 # If you don't want that, use gdb_start_cmd.
 
 proc runto_main { } {
-    global gdb_prompt
-    global decimal
-
-    if ![target_info exists gdb_stub] {
-	return [runto main]
-    }			
-
-    delete_breakpoints
-
-    gdb_step_for_stub;
-
-    return 1
+    return [runto main]
 }
 
 ### Continue, and expect to hit a breakpoint.
@@ -2294,14 +2273,8 @@ proc gdb_compile {source dest type optio
     }
     set options $new_options
 
-    if [target_info exists gdb_stub] {
-	set options2 { "additional_flags=-Dusestubs" }
-	lappend options "libs=[target_info gdb_stub]";
-	set options [concat $options2 $options]
-    }
     if [target_info exists is_vxworks] {
 	set options2 { "additional_flags=-Dvxworks" }
-	lappend options "libs=[target_info gdb_stub]";
 	set options [concat $options2 $options]
     }
     if [info exists GDB_TESTCASE_OPTIONS] {
@@ -3166,91 +3139,6 @@ proc setup_kfail_for_target { PR target
     }
 }
 
-# Test programs for embedded (often "bare board") systems sometimes use a
-# "stub" either embedded in the test program itself or in the boot rom.
-# The job of the stub is to implement the remote protocol to communicate
-# with gdb and control the inferior.  To initiate the remote protocol
-# session with gdb the stub needs to be given control by the inferior.
-# They do this by calling a function that typically triggers a trap
-# from main that transfers control to the stub.
-# The purpose of this function, gdb_step_for_stub, is to step out of
-# that function ("breakpoint" in the example below) and back into main.
-#
-# Example:
-#
-# int
-# main ()
-# {
-# #ifdef usestubs
-#  set_debug_traps (); /* install trap handlers for stub */
-#  breakpoint (); /* trigger a trap to give the stub control */
-# #endif
-#  /* test program begins here */
-# }
-#
-# Note that one consequence of this design is that a breakpoint on "main"
-# does not Just Work (because if the target could stop there you still have
-# to step past the calls to set_debug_traps,breakpoint).
-
-proc gdb_step_for_stub { } {
-    global gdb_prompt;
-
-    if ![target_info exists gdb,use_breakpoint_for_stub] {
-	if [target_info exists gdb_stub_step_command] {
-	    set command [target_info gdb_stub_step_command];
-	} else {
-	    set command "step";
-	}
-	send_gdb "${command}\n";
-	set tries 0;
-	gdb_expect 60 {
-	    -re "(main.* at |.*in .*start).*$gdb_prompt" {
-		return;
-	    }
-	    -re ".*$gdb_prompt" {
-		incr tries;
-		if { $tries == 5 } {
-		    fail "stepping out of breakpoint function";
-		    return;
-		}
-		send_gdb "${command}\n";
-		exp_continue;
-	    }
-	    default {
-		fail "stepping out of breakpoint function";
-		return;
-	    }
-	}
-    }
-    send_gdb "where\n";
-    gdb_expect {
-	-re "main\[^\r\n\]*at \(\[^:]+\):\(\[0-9\]+\)" {
-	    set file $expect_out(1,string);
-	    set linenum [expr $expect_out(2,string) + 1];
-	    set breakplace "${file}:${linenum}";
-	}
-	default {}
-    }
-    send_gdb "break ${breakplace}\n";
-    gdb_expect 60 {
-	-re "Breakpoint (\[0-9\]+) at.*$gdb_prompt" {
-	    set breakpoint $expect_out(1,string);
-	}
-	-re "Breakpoint (\[0-9\]+): file.*$gdb_prompt" {
-	    set breakpoint $expect_out(1,string);
-	}
-	default {}
-    }
-    send_gdb "continue\n";
-    gdb_expect 60 {
-	-re "Breakpoint ${breakpoint},.*$gdb_prompt" {
-	    gdb_test "delete $breakpoint" ".*" "";
-	    return;
-	}
-	default {}
-    }
-}
-
 # gdb_get_line_number TEXT [FILE]
 #
 # Search the source file FILE, and return the line number of the
@@ -3709,10 +3597,6 @@ proc clean_restart { executable } {
     gdb_start
     gdb_reinitialize_dir $srcdir/$subdir
     gdb_load ${binfile}
-
-    if [target_info exists gdb_stub] {
-        gdb_step_for_stub;
-    }    
 }
 
 # Prepares for testing, by calling build_executable, and then clean_restart.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-12-13 17:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-03 18:08 [commit] add some comments to testsuite/lib/gdb.exp Doug Evans
2011-12-03 18:39 ` Pedro Alves
2011-12-03 18:55   ` Doug Evans
2011-12-03 19:40     ` Pedro Alves
2011-12-04 13:16     ` [PATCH, docs RFA] Delete all use_stub support: gdb_step_for_stub, and calls to set_debug_traps etc. throughout (was: Re: [commit] add some comments to testsuite/lib/gdb.exp) Pedro Alves
2011-12-04 16:37       ` Eli Zaretskii
2011-12-04 18:47       ` Doug Evans
2011-12-13 18:01         ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).