This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] tweak for gdb.asm/asm-source.exp
- To: Michael Snyder <msnyder at cygnus dot com>
- Subject: Re: [RFA] tweak for gdb.asm/asm-source.exp
- From: Fernando Nasser <fnasser at redhat dot com>
- Date: Wed, 07 Nov 2001 15:53:07 -0500
- CC: gdb-patches at sources dot redhat dot com, cagney at redhat dot com
- Organization: Red Hat Canada
- References: <200111072041.fA7KfFH20266@reddwarf.cygnus.com>
Michael Snyder wrote:
>
> This accounts for backtraces in which 'main' was called from 'start'.
>
Michael,
If you just make the additional part of the pattern (the one you've
added)
optional, you can still use gdb_test, which is much preferable.
Can you do that?
Thanks,
Fernando
> 2001-11-07 Michael Snyder <msnyder@redhat.com>
>
> * gdb.asm/asm-source.exp (bt ALL in foo2): Accept a backtrace that
> includes a stack frame for "start".
>
> Index: asm-source.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.asm/asm-source.exp,v
> retrieving revision 1.3
> diff -c -3 -p -r1.3 asm-source.exp
> *** asm-source.exp 2001/03/06 08:21:49 1.3
> --- asm-source.exp 2001/11/07 20:39:48
> *************** gdb_test "f" ".*asmsrc2\[.\]s:8.*" "f in
> *** 93,100 ****
> # `next' one insn (or macro) to set up our stackframe (for the following bt).
> gdb_test "n" "12\[ \]*.*foo3" "n in foo2"
>
> ! # See if a simple `bt' prints the right source files and doesn't fall off the stack.
> ! gdb_test "bt 10" "\#0.*foo2.*asmsrc2\[.\]s:12.*\#1.*main.*asmsrc1\[.\]s:33" "bt ALL in foo2"
>
> # See if a capped `bt' prints the right source files.
> gdb_test "bt 2" "\#0.*foo2.*asmsrc2\[.\]s:12.*\#1.*main.*asmsrc1\[.\]s:33.*" "bt 2 in foo2"
> --- 93,114 ----
> # `next' one insn (or macro) to set up our stackframe (for the following bt).
> gdb_test "n" "12\[ \]*.*foo3" "n in foo2"
>
> ! # See if a simple `bt' prints the right source files and
> ! # doesn't fall off the stack.
> !
> ! send_gdb "bt 10\n"
> ! gdb_expect {
> ! -re "\#0.*foo2.*asmsrc2\[.\]s:12.*\#1.*main.*asmsrc1\[.\]s:33\[\r\n\]+$gdb_prompt $" {
> ! # Only two stack frames (no "start" function)
> ! pass "bt ALL in foo2"
> ! }
> ! -re "\#0.*foo2.*asmsrc2\[.\]s:12.*\#1.*main.*asmsrc1\[.\]s:33.*#2.*start\[^\r\n\]*\[\r\n\]+$gdb_prompt $" {
> ! pass "bt ALL in foo2 (with start function)"
> ! }
> ! -re ".*$gdb_prompt $" {
> ! fail "bt ALL in foo2"
> ! }
> ! }
>
> # See if a capped `bt' prints the right source files.
> gdb_test "bt 2" "\#0.*foo2.*asmsrc2\[.\]s:12.*\#1.*main.*asmsrc1\[.\]s:33.*" "bt 2 in foo2"
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9