From: Nathan Sidwell <nathan@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: ad more ending-run cases
Date: Mon, 27 Nov 2006 14:51:00 -0000 [thread overview]
Message-ID: <456AFBB6.2070405@codesourcery.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 595 bytes --]
This patch does several things to ending-run.exp
1) flattens the separate expect scripts dealing with whether an extra step over
a '}' was necessary. Several regexps were duplicated, and whether the step is
necessary is an artifact of the compiler's debug data.
2) adds a case for ARM RVDS toolchains
3) adds a case for m68k (and probably other embedded systems), where various
forms of a 'start' function are used.
ok?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
[-- Attachment #2: ending-run.patch --]
[-- Type: text/x-patch, Size: 6490 bytes --]
2006-11-27 Nathan Sidwell <nathan@codesourcery.com>
Paul Brook <paul@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* gdb.base/ending-run.exp: Flatten expect script stepping out of
main to remove duplication. Add start function of the form
'_*start[1-9]*'. Add RVDS start function.
Index: testsuite/gdb.base/ending-run.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/ending-run.exp,v
retrieving revision 1.24
diff -c -3 -p -r1.24 ending-run.exp
*** testsuite/gdb.base/ending-run.exp 10 Aug 2006 05:27:20 -0000 1.24
--- testsuite/gdb.base/ending-run.exp 27 Nov 2006 14:19:39 -0000
*************** set old_timeout $timeout
*** 153,242 ****
set timeout 50
set program_exited 0
send_gdb "next\n"
gdb_expect {
-re "33.*$gdb_prompt $" {
# sometimes we stop at the closing brace, if so, do another next
! send_gdb "next\n"
! gdb_expect {
! -re ".*Unable to find return pc for this frame.*$gdb_prompt $" {
! fail "step out of main (Old bug came back!)"
! gdb_test "n" ".*" ""
! }
! -re ".*in.*start.*$gdb_prompt $" {
! pass "step out of main"
! }
! -re ".*in.*bsp_trap.*$gdb_prompt $" {
! pass "step out of main"
! }
! -re ".*in.*init.*$gdb_prompt $" {
! # This is what happens on sparc64-elf ultra.
! pass "step out of main"
! }
! -re ".*in.*dll_crt0_1.*$gdb_prompt $" {
! # This is what happens on Cygwin.
! pass "step out of main"
! }
! -re ".*Program exited normally.*$gdb_prompt $" {
! # This is what happens on Linux i86 (and I would expect others)
! set program_exited 1
! pass "step out of main"
! }
! -re ".*in .nope ().*$gdb_prompt $" {
! # This is what happens on Solaris currently -sts 1999-08-25
! pass "step out of main (on Solaris)"
! }
! -re ".*in _int_reset ().*$gdb_prompt $" {
! # This is what happens on Sanyo XStormy16
! pass "step out of main"
! }
! -re ".*init ().*$gdb_prompt $" {
! # This is what happens on many Mips targets
! pass "step out of main"
! }
! -re ".*in ..change.mode ().*$gdb_prompt $" {
! # This is what happens on ARM in thumb mode -fn 2000-02-01
! pass "step out of main (on ARM thumb)"
! }
! -re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $" {
! pass "step out of main"
! }
! -re ".*in __wrap__?main ().*$gdb_prompt $" {
! pass "step out of main (status wrapper)"
! }
! -re "__setup_argv_for_main (.*).*$gdb_prompt $" {
! # On sh, another wrapper function (start_l) exists, so
! # another `next' is necessary.
! gdb_test "next" ".*in start_l ().*" "step out of main (on sh)"
! }
! -re ".*$gdb_prompt $" { fail "step out of main (at end 2)" }
! timeout {
! fail "step out of main (hang or timeout on step at end 2)"
! }
}
}
-re ".*Unable to find return pc for this frame.*$gdb_prompt $" {
! fail "Old bug came back!"
! gdb_test "n" ".*" ""
}
-re ".*in.*start.*$gdb_prompt $" {
! pass "step out of main"
}
! -re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $" {
! pass "step out of main (2)"
}
-re ".*Program exited normally.*$gdb_prompt $" {
# This is what happens on Linux i86 (and I would expect others)
set program_exited 1
pass "step out of main"
}
-re ".*in.*currently asm.*$gdb_prompt $" {
! pass "step out of main (into assembler)"
}
-re ".*Program received signal SIGTRAP.*$gdb_prompt $" {
! pass "Cygmon stopped in ending trap."
}
! -re ".*$gdb_prompt $" { fail "step out of main (at end 1)" }
! timeout { fail "step out of main (hang or timeout on step at end 1)" }
}
# When we're talking to a program running on a real stand-alone board,
--- 153,235 ----
set timeout 50
set program_exited 0
send_gdb "next\n"
+ set nexted 0
gdb_expect {
-re "33.*$gdb_prompt $" {
# sometimes we stop at the closing brace, if so, do another next
! if { $nexted } {
! fail "step out of main"
! } else {
! set nexted 1
! send_gdb "next\n"
! exp_continue
}
}
-re ".*Unable to find return pc for this frame.*$gdb_prompt $" {
! fail "step out of main"
! gdb_test "n" ".*" ""
}
-re ".*in.*start.*$gdb_prompt $" {
! pass "step out of main"
}
! -re ".*in.*bsp_trap.*$gdb_prompt $" {
! pass "step out of main"
! }
! -re ".*in.*init.*$gdb_prompt $" {
! # This is what happens on sparc64-elf ultra.
! pass "step out of main"
! }
! -re ".*in.*dll_crt0_1.*$gdb_prompt $" {
! # This is what happens on Cygwin.
! pass "step out of main"
}
-re ".*Program exited normally.*$gdb_prompt $" {
# This is what happens on Linux i86 (and I would expect others)
set program_exited 1
pass "step out of main"
}
+ -re ".*in .nope ().*$gdb_prompt $" {
+ # This is what happens on Solaris currently -sts 1999-08-25
+ pass "step out of main"
+ }
+ -re ".*in _int_reset ().*$gdb_prompt $" {
+ # This is what happens on Sanyo XStormy16
+ pass "step out of main"
+ }
+ -re ".*init ().*$gdb_prompt $" {
+ # This is what happens on many Mips targets
+ pass "step out of main"
+ }
+ -re ".*in ..change.mode ().*$gdb_prompt $" {
+ # This is what happens on ARM in thumb mode -fn 2000-02-01
+ pass "step out of main"
+ }
+ -re ".*__rt_entry ().*$gdb_prompt $" {
+ # This is what happens on the ARM RVDS runtime
+ pass "step out of main"
+ }
+ -re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $" {
+ pass "step out of main"
+ }
+ -re ".*in __wrap__?main ().*$gdb_prompt $" {
+ pass "step out of main"
+ }
+ -re "__setup_argv_for_main (.*).*$gdb_prompt $" {
+ # On sh, another wrapper function (start_l) exists, so
+ # another `next' is necessary.
+ gdb_test "next" ".*in start_l ().*" "step out of main"
+ }
-re ".*in.*currently asm.*$gdb_prompt $" {
! pass "step out of main"
! }
! -re "_*start\[0-9\]* \\(\[^)\]*\\).*$gdb_prompt $" {
! pass "step out of main"
}
-re ".*Program received signal SIGTRAP.*$gdb_prompt $" {
! pass "step out of main"
}
! -re ".*$gdb_prompt $" { fail "step out of main" }
! timeout { fail "step out of main" }
}
# When we're talking to a program running on a real stand-alone board,
next reply other threads:[~2006-11-27 14:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-27 14:51 Nathan Sidwell [this message]
2006-11-27 15:05 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=456AFBB6.2070405@codesourcery.com \
--to=nathan@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox