This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix problem with scope.exp test, skipping past init0 call


On 2/13/06, Jim Blandy <jimb@red-bean.com> wrote:
> Actually, having seen other's responses here, I'm inclined to say that
> the proper fix is to simply drop the code in scope.exp for getting
> from the opening brace to the first line.  Setting a breakpoint on
> main simply shouldn't leave you on the opening brace, and that test
> suite logic has always been papering over a bug.
>
> If prologues contain calls to __main, then the prologue analyzers
> should skip them.

My penance; scope.exp still has no failures on x86_64-unknown-linux-gnu.

gdb/testsuite/ChangeLog:
2006-02-13  Jim Blandy  <jimb@redhat.com>

	* gdb.base/scope.exp (test_at_main): Remove logic to handle the
	case where it takes two "next" commands to skip past the init
	call.

Index: gdb/testsuite/gdb.base/scope.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/scope.exp,v
retrieving revision 1.10
diff -c -p -r1.10 scope.exp
*** gdb/testsuite/gdb.base/scope.exp	13 Feb 2006 10:41:26 -0000	1.10
--- gdb/testsuite/gdb.base/scope.exp	13 Feb 2006 17:52:39 -0000
*************** proc test_at_main {} {
*** 61,82 ****
      global subdir
      global hp_cc_compiler

!     # skip past init.  There may be a call to __main at the start of
!     # main, so the first next may only get us to the init0 call.
!     gdb_test_multiple "next" "next over init0() in main" {
! 	-re "$decimal.*foo \\(\\).*$gdb_prompt $" {
! 	    pass "next over init0() in main"
! 	}
! 	-re "$decimal.*init0 \\(\\).*$gdb_prompt $" {
! 	    send_gdb "next\n"
! 	    exp_continue
! 	}
! 	-re ".*$gdb_prompt $" {
! 	    fail "next over init0() in main"
! 	    gdb_suppress_tests
! 	}
!     }
!

      # Print scope0.c::filelocal, which is 1

--- 61,72 ----
      global subdir
      global hp_cc_compiler

!     # skip past init0.
!     # This used to do an extra "next" if the first one didn't get us
!     # over the call to init0, to handle calls to __main in the
!     # prologue, etc.  But if a breakpoint at main doesn't leave us on
!     # the first line of real code in the function, that's a GDB bug.
!     gdb_test "next" "$decimal.*foo \\(\\);" "next over init0() in main"

      # Print scope0.c::filelocal, which is 1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]