2013-01-01 06:33:28 +00:00
|
|
|
# Copyright 1997-2013 Free Software Foundation, Inc.
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
2007-08-23 18:14:19 +00:00
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
1999-04-16 01:35:26 +00:00
|
|
|
# (at your option) any later version.
|
2007-08-23 18:14:19 +00:00
|
|
|
#
|
1999-04-16 01:35:26 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2007-08-23 18:14:19 +00:00
|
|
|
#
|
1999-04-16 01:35:26 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
2007-08-23 18:14:19 +00:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
Fix for PR gdb/1543.
* gdb.base/sep.exp: `sep-proc.c' absolute line numbers replaced with
$LOCATION.
(location): New variable.
* config/cfdbug.exp, config/d10v.exp, config/dve.exp, config/i960.exp,
config/m32r.exp, config/mn10300-eval.exp, config/proelf.exp,
config/rom68k.exp, config/sh.exp, config/unix.exp, config/vr4300.exp,
config/vr5000.exp, config/vxworks.exp, gdb.arch/altivec-regs.exp,
gdb.arch/e500-abi.exp, gdb.arch/e500-regs.exp, gdb.asm/asm-source.exp,
gdb.base/a2-run.exp, gdb.base/advance.exp, gdb.base/all-bin.exp,
gdb.base/args.exp, gdb.base/arithmet.exp, gdb.base/assign.exp,
gdb.base/async.exp, gdb.base/auxv.exp, gdb.base/bigcore.c,
gdb.base/bigcore.exp, gdb.base/bitfields.exp, gdb.base/bitops.exp,
gdb.base/break.c, gdb.base/break.exp, gdb.base/break1.c,
gdb.base/call-ar-st.exp, gdb.base/call-rt-st.exp,
gdb.base/call-strs.exp, gdb.base/callfuncs.c, gdb.base/callfuncs.exp,
gdb.base/checkpoint.exp, gdb.base/chng-syms.exp,
gdb.base/code-expr.exp, gdb.base/commands.exp, gdb.base/completion.exp,
gdb.base/complex.exp, gdb.base/cond-expr.exp, gdb.base/condbreak.exp,
gdb.base/consecutive.exp, gdb.base/corefile.exp, gdb.base/cvexpr.c,
gdb.base/cvexpr.exp, gdb.base/dbx.exp, gdb.base/default.exp,
gdb.base/define.exp, gdb.base/del.c, gdb.base/detach.exp,
gdb.base/display.exp, gdb.base/dump.exp, gdb.base/echo.exp,
gdb.base/environ.exp, gdb.base/eval-skip.exp, gdb.base/exprs.exp,
gdb.base/fileio.exp, gdb.base/find.exp, gdb.base/finish.exp,
gdb.base/funcargs.exp, gdb.base/gcore-buffer-overflow.exp,
gdb.base/gcore.exp, gdb.base/gdb1555.exp, gdb.base/gdbvars.exp,
gdb.base/help.exp, gdb.base/huge.exp, gdb.base/info-proc.exp,
gdb.base/interrupt.exp, gdb.base/jump.exp, gdb.base/langs.exp,
gdb.base/lineinc.exp, gdb.base/list.exp, gdb.base/macscp.exp,
gdb.base/maint.exp, gdb.base/mips_pro.exp, gdb.base/miscexprs.exp,
gdb.base/nodebug.exp, gdb.base/nofield.c, gdb.base/opaque.exp,
gdb.base/overlays.exp, gdb.base/page.exp, gdb.base/pc-fp.exp,
gdb.base/pending.c, gdb.base/pendshr.c, gdb.base/pointers.exp,
gdb.base/psymtab.exp, gdb.base/ptype.exp, gdb.base/randomize.c,
gdb.base/readline.exp, gdb.base/recurse.exp, gdb.base/regs.exp,
gdb.base/relational.exp, gdb.base/relocate.exp, gdb.base/remote.exp,
gdb.base/reread.exp, gdb.base/return.exp, gdb.base/return2.exp,
gdb.base/scope.exp, gdb.base/sect-cmd.exp, gdb.base/sep-proc.c,
gdb.base/sep.c, gdb.base/sep.exp, gdb.base/sepdebug.c,
gdb.base/sepdebug.exp, gdb.base/setshow.exp, gdb.base/shlib-call.exp,
gdb.base/sigaltstack.c, gdb.base/so-indr-cl.exp, gdb.base/solib.exp,
gdb.base/source.exp, gdb.base/start.c, gdb.base/step-bt.c,
gdb.base/step-line.exp, gdb.base/structs.c, gdb.base/structs.exp,
gdb.base/structs2.exp, gdb.base/term.exp, gdb.base/twice.exp,
gdb.base/type-opaque.exp, gdb.base/until.exp,
gdb.base/value-double-free.c, gdb.base/varargs.exp,
gdb.base/watchpoint.exp, gdb.base/whatis-exp.exp, gdb.disasm/am33.exp,
gdb.disasm/h8300s.exp, gdb.disasm/hppa.exp, gdb.disasm/mn10300.exp,
gdb.disasm/sh3.exp, gdb.disasm/t01_mov.exp, gdb.disasm/t02_mova.exp,
gdb.disasm/t03_add.exp, gdb.disasm/t04_sub.exp, gdb.disasm/t05_cmp.exp,
gdb.disasm/t06_ari2.exp, gdb.disasm/t07_ari3.exp,
gdb.disasm/t08_or.exp, gdb.disasm/t09_xor.exp, gdb.disasm/t10_and.exp,
gdb.disasm/t11_logs.exp, gdb.disasm/t12_bit.exp,
gdb.disasm/t13_otr.exp, gdb.fortran/exprs.exp, gdb.fortran/types.exp,
gdb.hp/gdb.aCC/exception.exp, gdb.hp/gdb.aCC/optimize.exp,
gdb.hp/gdb.aCC/watch-cmd.exp, gdb.hp/gdb.base-hp/callfwmall.exp,
gdb.hp/gdb.base-hp/dollar.exp, gdb.hp/gdb.base-hp/hwwatchbus.exp,
gdb.hp/gdb.base-hp/pxdb.exp, gdb.hp/gdb.base-hp/reg-pa64.exp,
gdb.hp/gdb.base-hp/reg.exp, gdb.hp/gdb.base-hp/sized-enum.exp,
gdb.hp/gdb.base-hp/so-thresh.exp, gdb.hp/gdb.compat/xdb1.exp,
gdb.hp/gdb.compat/xdb2.exp, gdb.hp/gdb.compat/xdb3.exp,
gdb.java/jmisc.exp, gdb.java/jv-exp.exp, gdb.java/jv-print.exp,
gdb.mi/gdb669.exp, gdb.mi/gdb680.exp, gdb.mi/gdb701.exp,
gdb.mi/gdb792.exp, gdb.mi/mi-basics.exp, gdb.mi/mi-console.exp,
gdb.mi/mi-hack-cli.exp, gdb.mi/mi-pending.c, gdb.mi/mi-pendshr.c,
gdb.mi/mi-pthreads.exp, gdb.mi/mi-read-memory.exp, gdb.mi/mi-regs.exp,
gdb.mi/mi-syn-frame.exp, gdb.mi/mi-until.exp, gdb.mi/mi2-basics.exp,
gdb.mi/mi2-console.exp, gdb.mi/mi2-hack-cli.exp,
gdb.mi/mi2-pthreads.exp, gdb.mi/mi2-read-memory.exp,
gdb.mi/mi2-regs.exp, gdb.mi/mi2-syn-frame.exp, gdb.mi/mi2-until.exp,
gdb.pascal/types.exp, gdb.stabs/weird.exp,
gdb.threads/gcore-thread.exp, gdb.threads/manythreads.exp,
gdb.threads/print-threads.exp, gdb.threads/pthreads.exp,
gdb.threads/schedlock.exp, gdb.threads/step.exp, gdb.threads/step2.exp,
gdb.threads/switch-threads.exp, gdb.threads/thread-specific.exp,
gdb.threads/thread_check.exp, gdb.threads/thread_events.exp,
gdb.threads/tls-nodebug.exp, gdb.threads/tls-shared.exp,
gdb.threads/tls.exp, gdb.trace/actions.exp, gdb.trace/backtrace.exp,
gdb.trace/circ.exp, gdb.trace/collection.exp, gdb.trace/deltrace.exp,
gdb.trace/infotrace.exp, gdb.trace/limits.exp, gdb.trace/packetlen.exp,
gdb.trace/passc-dyn.exp, gdb.trace/passcount.exp, gdb.trace/report.exp,
gdb.trace/save-trace.exp, gdb.trace/tfind.exp, gdb.trace/tracecmd.exp,
gdb.trace/while-dyn.exp, gdb.trace/while-stepping.exp,
lib/mi-support.exp, lib/trace-support.exp: Remove reference
to bug-gdb@prep.ai.mit.edu .
2008-08-06 12:52:08 +00:00
|
|
|
#
|
1999-04-16 01:35:26 +00:00
|
|
|
# This file was written by Michael Snyder (msnyder@cygnus.com)
|
|
|
|
|
|
|
|
#
|
|
|
|
# test running programs
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2007-05-11 20:00:29 +00:00
|
|
|
set data_overlays 1
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
if [istarget "d10v-*-*"] then {
|
2013-06-07 17:31:09 +00:00
|
|
|
set linker_script "${srcdir}/${subdir}/d10v.ld"
|
1999-04-16 01:35:26 +00:00
|
|
|
} elseif [istarget "m32r-*-*"] then {
|
2013-06-07 17:31:09 +00:00
|
|
|
set linker_script "${srcdir}/${subdir}/m32r.ld"
|
2007-05-11 20:00:29 +00:00
|
|
|
} elseif [istarget "spu-*-*"] then {
|
2013-06-07 17:31:09 +00:00
|
|
|
set linker_script "${srcdir}/${subdir}/spu.ld"
|
2007-05-11 20:00:29 +00:00
|
|
|
set data_overlays 0
|
1999-04-16 01:35:26 +00:00
|
|
|
} else {
|
|
|
|
verbose "Skipping overlay test -- not implemented for this target."
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2004-10-08 01:01:42 +00:00
|
|
|
if [istarget "*-*-linux*"] then {
|
|
|
|
verbose "Skipping overlay test -- Linux doesn't support overlayed programs."
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
test suite update - gdb.base/[n-r]
Convert files gdb.base/[n-r]*.exp to use standard_output_file et al.
* gdb.base/nextoverexit.exp, gdb.base/nextoverexit.exp,
gdb.base/nodebug.exp, gdb.base/nofield.exp, gdb.base/nostdlib.exp,
gdb.base/opaque.exp, gdb.base/overlays.exp, gdb.base/pc-fp.exp,
gdb.base/pending.exp, gdb.base/permissions.exp,
gdb.base/pie-execl.exp, gdb.base/pointers.exp,
gdb.base/pr11022.exp, gdb.base/print-file-var.exp,
gdb.base/printcmds.exp, gdb.base/prologue.exp,
gdb.base/psymtab.exp, gdb.base/ptr-typedef.exp,
gdb.base/ptype.exp, gdb.base/randomize.exp,
gdb.base/readline-ask.exp, gdb.base/recpar.exp,
gdb.base/recurse.exp, gdb.base/relativedebug.exp,
gdb.base/relocate.exp, gdb.base/remote.exp, gdb.base/reread.exp,
gdb.base/return-nodebug.exp, gdb.base/return2.exp: Use
standard_testfile, standard_output_file, prepare_for_testing,
clean_restart.
2013-06-27 18:53:49 +00:00
|
|
|
standard_testfile overlays.c ovlymgr.c foo.c bar.c baz.c grbx.c
|
1999-04-16 01:35:26 +00:00
|
|
|
|
test suite update - gdb.base/[n-r]
Convert files gdb.base/[n-r]*.exp to use standard_output_file et al.
* gdb.base/nextoverexit.exp, gdb.base/nextoverexit.exp,
gdb.base/nodebug.exp, gdb.base/nofield.exp, gdb.base/nostdlib.exp,
gdb.base/opaque.exp, gdb.base/overlays.exp, gdb.base/pc-fp.exp,
gdb.base/pending.exp, gdb.base/permissions.exp,
gdb.base/pie-execl.exp, gdb.base/pointers.exp,
gdb.base/pr11022.exp, gdb.base/print-file-var.exp,
gdb.base/printcmds.exp, gdb.base/prologue.exp,
gdb.base/psymtab.exp, gdb.base/ptr-typedef.exp,
gdb.base/ptype.exp, gdb.base/randomize.exp,
gdb.base/readline-ask.exp, gdb.base/recpar.exp,
gdb.base/recurse.exp, gdb.base/relativedebug.exp,
gdb.base/relocate.exp, gdb.base/remote.exp, gdb.base/reread.exp,
gdb.base/return-nodebug.exp, gdb.base/return2.exp: Use
standard_testfile, standard_output_file, prepare_for_testing,
clean_restart.
2013-06-27 18:53:49 +00:00
|
|
|
if {[build_executable $testfile.exp $testfile \
|
|
|
|
[list $srcfile $srcfile2 $srcfile3 $srcfile4 $srcfile5 $srcfile6] \
|
|
|
|
{debug ldscript=-Wl,-T$linker_script}] == -1} {
|
2006-08-10 05:27:22 +00:00
|
|
|
untested overlays.exp
|
|
|
|
return -1
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
remote_exec build "mv ${testfile}.o foo.o bar.o baz.o grbx.o ovlymgr.o ${objdir}/${subdir}"
|
|
|
|
|
|
|
|
|
|
|
|
gdb_start
|
|
|
|
gdb_reinitialize_dir $srcdir/$subdir
|
|
|
|
gdb_load ${binfile}
|
|
|
|
|
|
|
|
#
|
|
|
|
# set it up at a breakpoint so we can play with the variable values
|
|
|
|
#
|
|
|
|
|
|
|
|
if ![runto_main] then {
|
2013-06-07 17:31:09 +00:00
|
|
|
gdb_suppress_tests
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# couple of convenience variables
|
2002-06-06 20:26:10 +00:00
|
|
|
set fptrcast [string_to_regexp "{int (int)}"]
|
1999-04-16 01:35:26 +00:00
|
|
|
set iptrcast [string_to_regexp "(int *)"]
|
2002-06-06 20:26:10 +00:00
|
|
|
set hexx "0x\[0-9abcdefABCDEF\]+"
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2010-06-01 21:29:21 +00:00
|
|
|
gdb_test_no_output "overlay manual"
|
1999-04-16 01:35:26 +00:00
|
|
|
gdb_test "overlay list" "No sections are mapped." "List with none mapped"
|
|
|
|
|
|
|
|
# capture the LMA addresses of [foo bar baz grbx foox barx bazx grbxx]
|
|
|
|
|
2002-06-06 20:26:10 +00:00
|
|
|
proc get_func_address { func func_sym msg } {
|
|
|
|
global gdb_prompt
|
|
|
|
global fptrcast
|
|
|
|
global hexx
|
|
|
|
|
|
|
|
set func_addr 0
|
|
|
|
send_gdb "print $func\n"
|
|
|
|
gdb_expect {
|
|
|
|
-re "\\$\[0-9\]+ = $fptrcast (${hexx}) <$func_sym>.*$gdb_prompt $" {
|
|
|
|
set func_addr $expect_out(1,string)
|
|
|
|
pass "get $msg"
|
|
|
|
}
|
|
|
|
-re ".*$gdb_prompt $" {
|
|
|
|
fail "get $msg"
|
|
|
|
}
|
|
|
|
default {
|
|
|
|
fail "get $msg (timeout)"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $func_addr
|
|
|
|
}
|
|
|
|
|
|
|
|
set foo_lma [get_func_address "foo" "\\*foo\\*" "foo load address"]
|
|
|
|
set bar_lma [get_func_address "bar" "\\*bar\\*" "bar load address"]
|
|
|
|
set baz_lma [get_func_address "baz" "\\*baz\\*" "baz load address"]
|
|
|
|
set grbx_lma [get_func_address "grbx" "\\*grbx\\*" "grbx load address"]
|
|
|
|
|
2007-05-11 20:00:29 +00:00
|
|
|
if $data_overlays then {
|
|
|
|
gdb_test "print \$foox_lma = &foox" \
|
1999-04-16 01:35:26 +00:00
|
|
|
".* $iptrcast 0x.*" "foox load addr"
|
2007-05-11 20:00:29 +00:00
|
|
|
gdb_test "print \$barx_lma = &barx" \
|
1999-04-16 01:35:26 +00:00
|
|
|
".* $iptrcast 0x.*" "barx load addr"
|
2007-05-11 20:00:29 +00:00
|
|
|
gdb_test "print \$bazx_lma = &bazx" \
|
1999-04-16 01:35:26 +00:00
|
|
|
".* $iptrcast 0x.*" "bazx load addr"
|
2007-05-11 20:00:29 +00:00
|
|
|
gdb_test "print \$grbxx_lma = &grbxx" \
|
1999-04-16 01:35:26 +00:00
|
|
|
".* $iptrcast 0x.*" "grbxx load addr"
|
2007-05-11 20:00:29 +00:00
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
# map each overlay successively, and
|
|
|
|
# capture the VMA addresses of [foo bar baz grbx foox barx bazx grbxx]
|
|
|
|
|
|
|
|
gdb_test "overlay map .ovly0" ""
|
|
|
|
gdb_test "overlay list" "Section .ovly0, loaded at.*, mapped at.*" "List ovly0"
|
2002-06-06 20:26:10 +00:00
|
|
|
set foo_vma [get_func_address "foo" "foo" "foo runtime address"]
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
gdb_test "overlay map .ovly1" ""
|
|
|
|
gdb_test "overlay list" "Section .ovly1, loaded at.*, mapped at.*" "List ovly1"
|
2002-06-06 20:26:10 +00:00
|
|
|
set bar_vma [get_func_address "bar" "bar" "bar runtime address"]
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
gdb_test "overlay map .ovly2" ""
|
|
|
|
gdb_test "overlay list" "Section .ovly2, loaded at.*, mapped at.*" "List ovly2"
|
2002-06-06 20:26:10 +00:00
|
|
|
set baz_vma [get_func_address "baz" "baz" "baz runtime address"]
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
gdb_test "overlay map .ovly3" ""
|
|
|
|
gdb_test "overlay list" "Section .ovly3, loaded at.*, mapped at.*" "List ovly3"
|
2002-06-06 20:26:10 +00:00
|
|
|
set grbx_vma [get_func_address "grbx" "grbx" "grbx runtime address"]
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2007-05-11 20:00:29 +00:00
|
|
|
if $data_overlays then {
|
|
|
|
gdb_test "overlay map .data00" ""
|
|
|
|
gdb_test "overlay list" "Section .data00, loaded .*, mapped .*" "List data00"
|
|
|
|
gdb_test "print \$foox_vma = &foox" \
|
1999-04-16 01:35:26 +00:00
|
|
|
".* $iptrcast 0x.*" "foox runtime addr"
|
|
|
|
|
2007-05-11 20:00:29 +00:00
|
|
|
gdb_test "overlay map .data01" ""
|
|
|
|
gdb_test "overlay list" "Section .data01, loaded .*, mapped .*" "List data01"
|
|
|
|
gdb_test "print \$barx_vma = &barx" \
|
1999-04-16 01:35:26 +00:00
|
|
|
".* $iptrcast 0x.*" "barx runtime addr"
|
|
|
|
|
2007-05-11 20:00:29 +00:00
|
|
|
gdb_test "overlay map .data02" ""
|
|
|
|
gdb_test "overlay list" "Section .data02, loaded .*, mapped .*" "List data02"
|
|
|
|
gdb_test "print \$bazx_vma = &bazx" \
|
1999-04-16 01:35:26 +00:00
|
|
|
".* $iptrcast 0x.*" "bazx runtime addr"
|
|
|
|
|
2007-05-11 20:00:29 +00:00
|
|
|
gdb_test "overlay map .data03" ""
|
|
|
|
gdb_test "overlay list" "Section .data03, loaded .*, mapped .*" "List data03"
|
|
|
|
gdb_test "print \$grbxx_vma = &grbxx" \
|
1999-04-16 01:35:26 +00:00
|
|
|
".* $iptrcast 0x.*" "grbxx runtime addr"
|
2007-05-11 20:00:29 +00:00
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
# Verify that LMA != VMA
|
|
|
|
|
2002-06-06 20:26:10 +00:00
|
|
|
gdb_test "print $foo_lma != $foo_vma" ".* = 1" "foo's LMA != VMA"
|
|
|
|
gdb_test "print $bar_lma != $bar_vma" ".* = 1" "bar's LMA != VMA"
|
|
|
|
gdb_test "print $baz_lma != $baz_vma" ".* = 1" "baz's LMA != VMA"
|
|
|
|
gdb_test "print $grbx_lma != $grbx_vma" ".* = 1" "grbx's LMA != VMA"
|
2007-05-11 20:00:29 +00:00
|
|
|
if $data_overlays then {
|
|
|
|
gdb_test "print \$foox_lma != \$foox_vma" ".* = 1" "foox's LMA != VMA"
|
|
|
|
gdb_test "print \$barx_lma != \$barx_vma" ".* = 1" "barx's LMA != VMA"
|
|
|
|
gdb_test "print \$bazx_lma != \$bazx_vma" ".* = 1" "bazx's LMA != VMA"
|
|
|
|
gdb_test "print \$grbxx_lma != \$grbxx_vma" ".* = 1" "grbxx's LMA != VMA"
|
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
# Verify that early-mapped overlays have been bumped out
|
|
|
|
# by later-mapped overlays layed over in the same VMA range.
|
|
|
|
|
|
|
|
send_gdb "overlay list\n"
|
|
|
|
gdb_expect {
|
|
|
|
-re ".*ovly0, " { fail ".ovly0 not unmapped by .ovly1" }
|
|
|
|
-re ".*ovly2, " { fail ".ovly2 not unmapped by .ovly3" }
|
|
|
|
-re ".*data00," { fail ".data00 not unmapped by .data01" }
|
|
|
|
-re ".*data02," { fail ".data02 not unmapped by .data03" }
|
|
|
|
-re ".*$gdb_prompt $" { pass "Automatic unmapping" }
|
|
|
|
timeout { fail "(timeout) Automatic unmapping" }
|
|
|
|
}
|
|
|
|
|
2002-04-13 00:21:40 +00:00
|
|
|
# Verify that both sec1 and sec2 can be loaded simultaneously.
|
|
|
|
proc simultaneous_pair { sec1 sec2 } {
|
|
|
|
global gdb_prompt
|
|
|
|
|
|
|
|
set pairname "$sec1 and $sec2 mapped simultaneously"
|
|
|
|
gdb_test "overlay map $sec1" "" "$pairname: map $sec1"
|
|
|
|
gdb_test "overlay map $sec2" "" "$pairname: map $sec2"
|
|
|
|
|
|
|
|
set seen_sec1 0
|
|
|
|
set seen_sec2 0
|
|
|
|
|
|
|
|
send_gdb "overlay list\n"
|
|
|
|
gdb_expect {
|
|
|
|
-re ".*[string_to_regexp $sec1], " { set seen_sec1 1; exp_continue }
|
|
|
|
-re ".*[string_to_regexp $sec2], " { set seen_sec2 1; exp_continue }
|
|
|
|
-re ".*$gdb_prompt $" {
|
|
|
|
if {$seen_sec1 && $seen_sec2} {
|
|
|
|
pass "$pairname"
|
|
|
|
} else {
|
|
|
|
fail "$pairname"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
timeout { fail "(timeout) $pairname" }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
simultaneous_pair .ovly0 .ovly2
|
|
|
|
simultaneous_pair .ovly0 .ovly3
|
|
|
|
simultaneous_pair .ovly1 .ovly2
|
|
|
|
simultaneous_pair .ovly1 .ovly3
|
|
|
|
|
2007-05-11 20:00:29 +00:00
|
|
|
if $data_overlays then {
|
|
|
|
simultaneous_pair .data00 .data02
|
|
|
|
simultaneous_pair .data00 .data03
|
|
|
|
simultaneous_pair .data01 .data02
|
|
|
|
simultaneous_pair .data01 .data03
|
|
|
|
}
|
2002-04-13 00:21:40 +00:00
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
# test automatic mode
|
|
|
|
|
2010-06-01 21:29:21 +00:00
|
|
|
gdb_test_no_output "overlay auto"
|
1999-04-16 01:35:26 +00:00
|
|
|
gdb_test "overlay list" "No sections are mapped." "List none mapped (auto)"
|
|
|
|
gdb_test "break foo" "Breakpoint .*at .*file .*foo.c.*" "break foo"
|
|
|
|
gdb_test "break bar" "Breakpoint .*at .*file .*bar.c.*" "break bar"
|
|
|
|
gdb_test "break baz" "Breakpoint .*at .*file .*baz.c.*" "break baz"
|
|
|
|
gdb_test "break grbx" "Breakpoint .*at .*file .*grbx.c.*" "break grbx"
|
|
|
|
|
|
|
|
send_gdb "continue\n"
|
|
|
|
gdb_expect {
|
|
|
|
-re "Breakpoint .* foo .x=1. at .*$gdb_prompt $" { pass "hit foo" }
|
|
|
|
-re ".*$gdb_prompt $" { fail "hit foo" }
|
|
|
|
timeout { fail "(timeout) hit foo" }
|
|
|
|
}
|
|
|
|
|
|
|
|
send_gdb "backtrace\n"
|
|
|
|
gdb_expect {
|
|
|
|
-re "#0 .*foo .*#1 .*main .*$gdb_prompt $" { pass "BT foo" }
|
|
|
|
-re ".*$gdb_prompt $" { fail "BT foo" }
|
|
|
|
timeout { fail "(timeout) BT foo" }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
send_gdb "continue\n"
|
|
|
|
gdb_expect {
|
|
|
|
-re "Breakpoint .* bar .x=1. at .*$gdb_prompt $" { pass "hit bar" }
|
|
|
|
-re ".*$gdb_prompt $" { fail "hit bar" }
|
|
|
|
timeout { fail "(timeout) hit bar" }
|
|
|
|
}
|
|
|
|
|
|
|
|
send_gdb "backtrace\n"
|
|
|
|
gdb_expect {
|
|
|
|
-re "#0 .*bar .*#1 .*main .*$gdb_prompt $" { pass "BT bar" }
|
|
|
|
-re ".*$gdb_prompt $" { fail "BT bar" }
|
|
|
|
timeout { fail "(timeout) BT bar" }
|
|
|
|
}
|
|
|
|
|
|
|
|
send_gdb "continue\n"
|
|
|
|
gdb_expect {
|
|
|
|
-re "Breakpoint .* baz .x=1. at .*$gdb_prompt $" { pass "hit baz" }
|
|
|
|
-re ".*$gdb_prompt $" { fail "hit baz" }
|
|
|
|
timeout { fail "(timeout) hit baz" }
|
|
|
|
}
|
|
|
|
|
|
|
|
send_gdb "backtrace\n"
|
|
|
|
gdb_expect {
|
|
|
|
-re "#0 .*baz .*#1 .*main .*$gdb_prompt $" { pass "BT baz" }
|
|
|
|
-re ".*$gdb_prompt $" { fail "BT baz" }
|
|
|
|
timeout { fail "(timeout) BT baz" }
|
|
|
|
}
|
|
|
|
|
|
|
|
send_gdb "continue\n"
|
|
|
|
gdb_expect {
|
|
|
|
-re "Breakpoint .* grbx .x=1. at .*$gdb_prompt $" { pass "hit grbx" }
|
|
|
|
-re ".*$gdb_prompt $" { fail "hit grbx" }
|
|
|
|
timeout { fail "(timeout) hit grbx" }
|
|
|
|
}
|
|
|
|
|
|
|
|
send_gdb "backtrace\n"
|
|
|
|
gdb_expect {
|
|
|
|
-re "#0 .*grbx .*#1 .*main .*$gdb_prompt $" { pass "BT grbx" }
|
|
|
|
-re ".*$gdb_prompt $" { fail "BT grbx" }
|
|
|
|
timeout { fail "(timeout) BT grbx" }
|
|
|
|
}
|
|
|
|
|