2016-01-01 04:33:14 +00:00
|
|
|
# Copyright 1998-2016 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/>.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
# This file was written by Michael Snyder (msnyder@cygnus.com)
|
|
|
|
|
2013-06-07 17:31:09 +00:00
|
|
|
load_lib "trace-support.exp"
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2013-07-31 00:36:22 +00:00
|
|
|
standard_testfile actions.c
|
|
|
|
set executable $testfile
|
|
|
|
set expfile $testfile.exp
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2013-07-31 00:36:22 +00:00
|
|
|
if [prepare_for_testing $expfile $executable $srcfile \
|
|
|
|
[list debug nowarnings]] {
|
|
|
|
untested "failed to prepare for trace tests"
|
|
|
|
return -1
|
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2013-07-31 00:36:22 +00:00
|
|
|
if ![runto_main] {
|
|
|
|
fail "Can't run to main to check for trace support"
|
* config/m68k-emc.exp, lib/emc-support.exp,
gdb.trace/gdb_c_test.c: Delete.
* 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: Remove special
casing for m68k-*-elf.
2009-11-05 20:06:03 +00:00
|
|
|
return -1
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if { ![gdb_target_supports_trace] } then {
|
2012-02-15 18:09:20 +00:00
|
|
|
unsupported "Current target does not support trace"
|
gdb/testsuite/
* config/monitor.exp (gdb_target_cmd): Remove semicolon after
'return'.
(gdb_target_monitor, gdb_load): Likewise.
* config/sid.exp (gdb_load): Likewise.
* config/slite.exp (gdb_load): Likewise.
* config/vx.exp (gdb_start, spawn_vxgdb): Likewise.
* gdb.ada/arrayidx.exp, gdb.ada/null_array.exp: Likewise.
* gdb.arch/mips-octeon-bbit.exp (single_step): Likewise.
(single_step_until): Likewise.
* gdb.arch/powerpc-d128-regs.exp: Likewise.
* gdb.arch/system-gcore.exp: Likewise.
* gdb.base/bigcore.exp (extract_heap): Likewise.
* gdb.base/break-on-linker-gcd-function.exp: Likewise.
* gdb.base/call-ar-st.exp: Likewise.
* gdb.base/call-rt-st.exp: Likewise.
* gdb.base/call-sc.exp, gdb.base/call-strs.exp: Likewise.
* gdb.base/callfuncs.exp, gdb.base/completion.exp: Likewise.
* gdb.base/condbreak.exp, gdb.base/constvars.exp: Likewise.
* gdb.base/corefile.exp: Likewise.
* gdb.base/dbx.exp (gdb_file_cmd): Likewise.
* gdb.base/exprs.exp, gdb.base/fileio.exp: Likewise.
* gdb.base/fixsection.exp: Likewise.
* gdb.base/funcargs.exp: Likewise.
* gdb.base/gcore-buffer-overflow.exp: Likewise.
* gdb.base/gcore-relro.exp: Likewise.
* gdb.base/gcore.exp, gdb.base/gdb11530.exp: Likewise.
* gdb.base/gdb11531.exp, gdb.base/gnu-ifunc.exp: Likewise.
* gdb.base/info-os.exp, gdb.base/info-proc.exp: Likewise.
* gdb.base/interp.exp, gdb.base/langs.exp:: Likewise.
* gdb.base/list.exp: Likewise.
(set_listsize): Likewise.
* gdb.base/logical.exp, gdb.base/mips_pro.exp: Likewise.
* gdb.base/miscexprs.exp, gdb.base/nodebug.exp: Likewise.
* gdb.base/opaque.exp, gdb.base/pointers.exp: Likewise.
* gdb.base/psymtab.exp, gdb.base/ptype.exp: Likewise.
* gdb.base/relational.exp, gdb.base/scope.exp: Likewise.
* gdb.base/setvar.exp: Likewise.
(test_set): Likewise.
* gdb.base/signals.exp, gdb.base/sizeof.exp: Likewise.
* gdb.base/solib-overlap.exp: Likewise.
* gdb.base/store.exp, gdb.base/structs.exp: Likewise.
* gdb.base/structs2.exp, gdb.base/volatile.exp: Likewise.
* gdb.base/watchpoint.exp (initialize): Likewise.
(test_simple_watchpoint): Likewise.
(test_disabling_watchpoints): Likewise.
(test_watchpoint_triggered_in_syscall): Likewise.
* gdb.base/whatis.exp, gdb.cp/ambiguous.exp: Likewise.
* gdb.cp/casts.exp, gdb.cp/ctti.exp: Likewise.
* gdb.cp/namespace.exp, gdb.cp/nsdecl.exp: Likewise.
* gdb.cp/psmang.exp, gdb.dwarf2/dw2-ranges.exp: Likewise.
* gdb.hp/gdb.aCC/optimize.exp: Likewise.
* gdb.hp/gdb.aCC/watch-cmd.exp: Likewise.
* gdb.hp/gdb.base-hp/callfwmall.exp: Likewise.
* gdb.hp/gdb.base-hp/pxdb.exp: Likewise.
* gdb.hp/gdb.compat/xdb1.exp: Likewise.
* gdb.hp/gdb.compat/xdb2.exp: Likewise.
* gdb.hp/gdb.compat/xdb3.exp: Likewise.
* gdb.hp/gdb.defects/bs14602.exp: Likewise.
* gdb.hp/gdb.defects/solib-d.exp: Likewise.
* gdb.mi/gdb792.exp: Likewise.
* gdb.mi/mi-inheritance-syntax-error.exp: Likewise.
* gdb.mi/mi-logging.exp, gdb.mi/mi-var-cp.exp : Likewise.
* gdb.mi/mi-var-rtti.exp, gdb.python/py-type.exp: Likewise.
* gdb.threads/gcore-thread.exp: Likewise.
(load_core): Likewise.
* gdb.threads/pthreads.exp (all_threads_running): Likewise.
(test_startup, check_control_c): Likewise.
* gdb.threads/sigstep-threads.exp: Likewise.
* gdb.threads/thread_check.exp: Likewise.
* gdb.trace/backtrace.exp, gdb.trace/change-loc.exp: Likewise.
* gdb.trace/circ.exp (run_trace_experiment): Likewise.
(set_a_tracepoint, trace_buffer_normal): Likewise.
(gdb_trace_circular_tests): Likewise.
* gdb.trace/collection.exp: Likewise.
* gdb.trace/disconnected-tracing.exp: Likewise.
* gdb.trace/infotrace.exp: Likewise.
* gdb.trace/mi-traceframe-changed.exp: Likewise.
* gdb.trace/mi-tracepoint-changed.exp: Likewise.
* gdb.trace/mi-tsv-changed.exp (test_create_delete_modify_tsv): Likewise.
* gdb.trace/packetlen.exp, gdb.trace/passc-dyn.exp: Likewise.
* gdb.trace/pending.exp, gdb.trace/report.exp: Likewise.
* gdb.trace/stap-trace.exp: Likewise.
* gdb.trace/status-stop.exp,gdb.trace/strace.exp: Likewise.
* gdb.trace/tfind.exp, gdb.trace/trace-break.exp: Likewise.
* gdb.trace/trace-buffer-size.exp: Likewise.
* gdb.trace/tspeed.exp, gdb.trace/tsv.exp: Likewise.
* gdb.trace/unavailable.exp: Likewise.
* gdb.trace/while-dyn.exp: Likewise.
* lib/fortran.exp (set_lang_fortran): Likewise.
* lib/gdb.exp (default_gdb_version, gdb_start_cmd): Likewise.
(gdb_breakpoint, gdb_reinitialize_dir): Likewise.
(default_gdb_start, get_compiler_info): Likewise.
(gdb_compile, gdb_compile_objc, gdb_reload, gdb_init): Likewise.
(get_debug_format, setup_xfail_format): Likewise.
(rerun_to_main, gdb_skip_float_test): Likewise.
(build_id_debug_filename_get, get_remotetimeout): Likewise.
* lib/java.exp (set_lang_java): Likewise.
* lib/mi-support.exp (default_mi_gdb_start): Likewise.
(mi_gdb_reinitialize_dir, mi_gdb_target_cmd): Likewise.
(mi_gdb_file_cmd, mi_gdb_test): Likewise.
(mi_run_cmd_full, mi_expect_interrupt): Likewise.
* lib/objc.exp (set_lang_objc): Likewise.
* lib/pascal.exp (set_lang_pascal): Likewise.
* lib/prompt.exp (default_prompt_gdb_start): Likewise.
* lib/trace-support.exp (gdb_trace_setactions, gdb_tfind_test): Likewise.
(gdb_readexpr, gdb_gettpnum, gdb_find_recursion_test_baseline): Likewise.
2013-03-14 13:34:06 +00:00
|
|
|
return 1
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# test backtraces in trace frames
|
|
|
|
#
|
|
|
|
|
|
|
|
set testline1 0
|
|
|
|
set testline2 0
|
|
|
|
set testline3 0
|
|
|
|
set testline4 0
|
|
|
|
set testline5 0
|
|
|
|
set testline6 0
|
|
|
|
|
|
|
|
set arg1 1
|
|
|
|
set arg2 2
|
|
|
|
set arg3 3
|
|
|
|
set arg4 4
|
|
|
|
set arg5 5
|
|
|
|
set arg6 6
|
|
|
|
|
2013-06-07 17:31:09 +00:00
|
|
|
set baseline [gdb_find_recursion_test_baseline $srcfile]
|
1999-04-16 01:35:26 +00:00
|
|
|
if { $baseline == -1 } {
|
|
|
|
fail "Could not find gdb_recursion_test function"
|
2013-06-07 17:31:09 +00:00
|
|
|
return
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
|
2010-06-02 19:41:11 +00:00
|
|
|
set return_me 0
|
|
|
|
|
|
|
|
gdb_test_multiple "list $baseline, +12" "all tests in this module will fail" {
|
1999-04-16 01:35:26 +00:00
|
|
|
-re "\[\r\n\](\[0-9\]+).*gdbtestline 1 " {
|
|
|
|
set testline1 $expect_out(1,string)
|
|
|
|
exp_continue
|
|
|
|
}
|
|
|
|
-re "\[\r\n\](\[0-9\]+).*gdbtestline 2 " {
|
|
|
|
set testline2 $expect_out(1,string)
|
|
|
|
exp_continue
|
|
|
|
}
|
|
|
|
-re "\[\r\n\](\[0-9\]+).*gdbtestline 3 " {
|
|
|
|
set testline3 $expect_out(1,string)
|
|
|
|
exp_continue
|
|
|
|
}
|
|
|
|
-re "\[\r\n\](\[0-9\]+).*gdbtestline 4 " {
|
|
|
|
set testline4 $expect_out(1,string)
|
|
|
|
exp_continue
|
|
|
|
}
|
|
|
|
-re "\[\r\n\](\[0-9\]+).*gdbtestline 5 " {
|
|
|
|
set testline5 $expect_out(1,string)
|
|
|
|
exp_continue
|
|
|
|
}
|
|
|
|
-re "\[\r\n\](\[0-9\]+).*gdbtestline 6 " {
|
|
|
|
set testline6 $expect_out(1,string)
|
|
|
|
exp_continue
|
|
|
|
}
|
|
|
|
-re ".*$gdb_prompt $" {
|
|
|
|
if { ($testline1 == 0) || ($testline2 == 0) || ($testline3 == 0) || ($testline4 == 0) || ($testline5 == 0) || ($testline6 == 0) } {
|
2006-08-10 05:27:22 +00:00
|
|
|
untested backtrace.exp
|
2010-06-02 19:41:11 +00:00
|
|
|
set return_me 1
|
1999-04-16 01:35:26 +00:00
|
|
|
all tests in this module will fail."
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default {
|
2006-08-10 05:27:22 +00:00
|
|
|
untested backtrace.exp
|
2010-06-02 19:41:11 +00:00
|
|
|
set return_me 1
|
1999-04-16 01:35:26 +00:00
|
|
|
all tests in this module will fail."
|
2010-06-02 19:41:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if { $return_me == 1 } then {
|
gdb/testsuite/
* config/monitor.exp (gdb_target_cmd): Remove semicolon after
'return'.
(gdb_target_monitor, gdb_load): Likewise.
* config/sid.exp (gdb_load): Likewise.
* config/slite.exp (gdb_load): Likewise.
* config/vx.exp (gdb_start, spawn_vxgdb): Likewise.
* gdb.ada/arrayidx.exp, gdb.ada/null_array.exp: Likewise.
* gdb.arch/mips-octeon-bbit.exp (single_step): Likewise.
(single_step_until): Likewise.
* gdb.arch/powerpc-d128-regs.exp: Likewise.
* gdb.arch/system-gcore.exp: Likewise.
* gdb.base/bigcore.exp (extract_heap): Likewise.
* gdb.base/break-on-linker-gcd-function.exp: Likewise.
* gdb.base/call-ar-st.exp: Likewise.
* gdb.base/call-rt-st.exp: Likewise.
* gdb.base/call-sc.exp, gdb.base/call-strs.exp: Likewise.
* gdb.base/callfuncs.exp, gdb.base/completion.exp: Likewise.
* gdb.base/condbreak.exp, gdb.base/constvars.exp: Likewise.
* gdb.base/corefile.exp: Likewise.
* gdb.base/dbx.exp (gdb_file_cmd): Likewise.
* gdb.base/exprs.exp, gdb.base/fileio.exp: Likewise.
* gdb.base/fixsection.exp: Likewise.
* gdb.base/funcargs.exp: Likewise.
* gdb.base/gcore-buffer-overflow.exp: Likewise.
* gdb.base/gcore-relro.exp: Likewise.
* gdb.base/gcore.exp, gdb.base/gdb11530.exp: Likewise.
* gdb.base/gdb11531.exp, gdb.base/gnu-ifunc.exp: Likewise.
* gdb.base/info-os.exp, gdb.base/info-proc.exp: Likewise.
* gdb.base/interp.exp, gdb.base/langs.exp:: Likewise.
* gdb.base/list.exp: Likewise.
(set_listsize): Likewise.
* gdb.base/logical.exp, gdb.base/mips_pro.exp: Likewise.
* gdb.base/miscexprs.exp, gdb.base/nodebug.exp: Likewise.
* gdb.base/opaque.exp, gdb.base/pointers.exp: Likewise.
* gdb.base/psymtab.exp, gdb.base/ptype.exp: Likewise.
* gdb.base/relational.exp, gdb.base/scope.exp: Likewise.
* gdb.base/setvar.exp: Likewise.
(test_set): Likewise.
* gdb.base/signals.exp, gdb.base/sizeof.exp: Likewise.
* gdb.base/solib-overlap.exp: Likewise.
* gdb.base/store.exp, gdb.base/structs.exp: Likewise.
* gdb.base/structs2.exp, gdb.base/volatile.exp: Likewise.
* gdb.base/watchpoint.exp (initialize): Likewise.
(test_simple_watchpoint): Likewise.
(test_disabling_watchpoints): Likewise.
(test_watchpoint_triggered_in_syscall): Likewise.
* gdb.base/whatis.exp, gdb.cp/ambiguous.exp: Likewise.
* gdb.cp/casts.exp, gdb.cp/ctti.exp: Likewise.
* gdb.cp/namespace.exp, gdb.cp/nsdecl.exp: Likewise.
* gdb.cp/psmang.exp, gdb.dwarf2/dw2-ranges.exp: Likewise.
* gdb.hp/gdb.aCC/optimize.exp: Likewise.
* gdb.hp/gdb.aCC/watch-cmd.exp: Likewise.
* gdb.hp/gdb.base-hp/callfwmall.exp: Likewise.
* gdb.hp/gdb.base-hp/pxdb.exp: Likewise.
* gdb.hp/gdb.compat/xdb1.exp: Likewise.
* gdb.hp/gdb.compat/xdb2.exp: Likewise.
* gdb.hp/gdb.compat/xdb3.exp: Likewise.
* gdb.hp/gdb.defects/bs14602.exp: Likewise.
* gdb.hp/gdb.defects/solib-d.exp: Likewise.
* gdb.mi/gdb792.exp: Likewise.
* gdb.mi/mi-inheritance-syntax-error.exp: Likewise.
* gdb.mi/mi-logging.exp, gdb.mi/mi-var-cp.exp : Likewise.
* gdb.mi/mi-var-rtti.exp, gdb.python/py-type.exp: Likewise.
* gdb.threads/gcore-thread.exp: Likewise.
(load_core): Likewise.
* gdb.threads/pthreads.exp (all_threads_running): Likewise.
(test_startup, check_control_c): Likewise.
* gdb.threads/sigstep-threads.exp: Likewise.
* gdb.threads/thread_check.exp: Likewise.
* gdb.trace/backtrace.exp, gdb.trace/change-loc.exp: Likewise.
* gdb.trace/circ.exp (run_trace_experiment): Likewise.
(set_a_tracepoint, trace_buffer_normal): Likewise.
(gdb_trace_circular_tests): Likewise.
* gdb.trace/collection.exp: Likewise.
* gdb.trace/disconnected-tracing.exp: Likewise.
* gdb.trace/infotrace.exp: Likewise.
* gdb.trace/mi-traceframe-changed.exp: Likewise.
* gdb.trace/mi-tracepoint-changed.exp: Likewise.
* gdb.trace/mi-tsv-changed.exp (test_create_delete_modify_tsv): Likewise.
* gdb.trace/packetlen.exp, gdb.trace/passc-dyn.exp: Likewise.
* gdb.trace/pending.exp, gdb.trace/report.exp: Likewise.
* gdb.trace/stap-trace.exp: Likewise.
* gdb.trace/status-stop.exp,gdb.trace/strace.exp: Likewise.
* gdb.trace/tfind.exp, gdb.trace/trace-break.exp: Likewise.
* gdb.trace/trace-buffer-size.exp: Likewise.
* gdb.trace/tspeed.exp, gdb.trace/tsv.exp: Likewise.
* gdb.trace/unavailable.exp: Likewise.
* gdb.trace/while-dyn.exp: Likewise.
* lib/fortran.exp (set_lang_fortran): Likewise.
* lib/gdb.exp (default_gdb_version, gdb_start_cmd): Likewise.
(gdb_breakpoint, gdb_reinitialize_dir): Likewise.
(default_gdb_start, get_compiler_info): Likewise.
(gdb_compile, gdb_compile_objc, gdb_reload, gdb_init): Likewise.
(get_debug_format, setup_xfail_format): Likewise.
(rerun_to_main, gdb_skip_float_test): Likewise.
(build_id_debug_filename_get, get_remotetimeout): Likewise.
* lib/java.exp (set_lang_java): Likewise.
* lib/mi-support.exp (default_mi_gdb_start): Likewise.
(mi_gdb_reinitialize_dir, mi_gdb_target_cmd): Likewise.
(mi_gdb_file_cmd, mi_gdb_test): Likewise.
(mi_run_cmd_full, mi_expect_interrupt): Likewise.
* lib/objc.exp (set_lang_objc): Likewise.
* lib/pascal.exp (set_lang_pascal): Likewise.
* lib/prompt.exp (default_prompt_gdb_start): Likewise.
* lib/trace-support.exp (gdb_trace_setactions, gdb_tfind_test): Likewise.
(gdb_readexpr, gdb_gettpnum, gdb_find_recursion_test_baseline): Likewise.
2013-03-14 13:34:06 +00:00
|
|
|
return -1
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Setup backtrace experiment. This will involve:
|
|
|
|
# 1) a tracepoint where nothing is collected
|
|
|
|
# 2) a tracepoint where only regs are collected
|
|
|
|
# 3) a tracepoint where regs, locals and args are collected
|
|
|
|
# 4) a tracepoint where regs plus some amount of stack are collected.
|
|
|
|
#
|
|
|
|
|
|
|
|
gdb_delete_tracepoints
|
|
|
|
set tdp2 [gdb_gettpnum $testline2]
|
|
|
|
set tdp3 [gdb_gettpnum $testline3]
|
|
|
|
set tdp4 [gdb_gettpnum $testline4]
|
|
|
|
set tdp5 [gdb_gettpnum $testline5]
|
|
|
|
set tdp6 [gdb_gettpnum $testline6]
|
|
|
|
if { $tdp2 <= 0 || $tdp3 <= 0 || \
|
|
|
|
$tdp4 <= 0 || $tdp5 <= 0 || $tdp6 <= 0 } then {
|
|
|
|
fail "setting tracepoints failed"
|
2013-06-07 17:31:09 +00:00
|
|
|
return
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#gdb_trace_setactions "setup TP to collect FP" \
|
|
|
|
# "$tdp2" \
|
|
|
|
# "collect \$fp" ""
|
|
|
|
#
|
|
|
|
|
|
|
|
gdb_trace_setactions "8.6: setup TP to collect regs" \
|
|
|
|
"$tdp3" \
|
|
|
|
"collect \$regs" "^$"
|
|
|
|
|
|
|
|
gdb_trace_setactions "8.6: setup TP to collect regs, args, and locals" \
|
|
|
|
"$tdp4" \
|
|
|
|
"collect \$regs, \$args, \$locs" "^$"
|
|
|
|
|
|
|
|
gdb_trace_setactions "8.6: setup TP to collect stack mem cast expr" \
|
2010-03-12 04:04:40 +00:00
|
|
|
"$tdp6" \
|
2015-11-10 08:52:29 +00:00
|
|
|
"collect \$$fpreg, \(\*\(void \*\*\) \(\$$spreg\)\) @ 64" "^$"
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2013-07-31 00:36:22 +00:00
|
|
|
gdb_test_no_output "tstart" ""
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2010-06-08 22:58:03 +00:00
|
|
|
gdb_test "break end" ".*" ""
|
* config/m68k-emc.exp, lib/emc-support.exp,
gdb.trace/gdb_c_test.c: Delete.
* 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: Remove special
casing for m68k-*-elf.
2009-11-05 20:06:03 +00:00
|
|
|
gdb_test "continue" \
|
|
|
|
"Continuing.*Breakpoint $decimal, end.*" \
|
|
|
|
"run trace experiment"
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2013-07-31 00:36:22 +00:00
|
|
|
gdb_test_no_output "tstop" ""
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
proc gdb_backtrace_tdp_1 { msg } {
|
|
|
|
global gdb_prompt
|
|
|
|
|
|
|
|
# We are in a trace frame at which we didn't collect anything
|
|
|
|
# except $PC. Therefore we expect to be able to identify stack
|
|
|
|
# frame #0, but that's about all. In particular we do not expect
|
|
|
|
# to be able to display the function's arguments or locals, and we
|
|
|
|
# do not expect to be able to identify the caller of this function.
|
|
|
|
|
2010-06-02 19:41:11 +00:00
|
|
|
gdb_test "backtrace" \
|
|
|
|
"#0\[\t \]+gdb_recursion_test.*depth=.*" \
|
|
|
|
"$msg"
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
proc gdb_backtrace_tdp_2 { msg } {
|
|
|
|
global gdb_prompt
|
|
|
|
|
|
|
|
# We are in a trace frame at which we collected only the registers
|
|
|
|
# Therefore we expect to be able to identify stack frame #0, but
|
|
|
|
# we don't expect to be able to display its args unles they are
|
|
|
|
# passed in registers (which isn't the case for m68k), and we
|
|
|
|
# don't expect to be able to identify the caller's stack frame.
|
|
|
|
|
2010-06-02 19:41:11 +00:00
|
|
|
gdb_test "backtrace" \
|
|
|
|
"#0\[\t \]+gdb_recursion_test.*depth=.*" \
|
|
|
|
"$msg"
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
proc gdb_backtrace_tdp_3 { msg } {
|
|
|
|
global gdb_prompt
|
|
|
|
|
|
|
|
# We are in a trace frame at which we collected all registers, all
|
|
|
|
# arguments and all locals. This means that the display of
|
|
|
|
# stack frame #0 should be complete (including argument values).
|
|
|
|
|
2010-06-02 19:41:11 +00:00
|
|
|
gdb_test_multiple "backtrace" "$msg" {
|
1999-04-16 01:35:26 +00:00
|
|
|
-re "#0\[\t \]+gdb_recursion_test.*depth=\[0-9\]+.*q1=\[0-9\]+.*q2=\[0-9\]+.*q3=\[0-9\]+.*q4=\[0-9\]+.*q5=\[0-9\]+.*q6=\[0-9\]+.*$gdb_prompt $" {
|
|
|
|
pass "$msg"
|
|
|
|
}
|
|
|
|
-re "#0\[\t \]+gdb_recursion_test.*depth=Cannot access.*$gdb_prompt $" {
|
|
|
|
fail "$msg (failed to collect arguments)"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-31 00:38:40 +00:00
|
|
|
proc gdb_backtrace_tdp_4 { msg depth traceframe } {
|
1999-04-16 01:35:26 +00:00
|
|
|
global gdb_prompt
|
|
|
|
|
2013-07-31 00:38:40 +00:00
|
|
|
with_test_prefix "traceframe $traceframe" {
|
|
|
|
# We are in a trace frame at which we collected all registers,
|
|
|
|
# plus a sizeable hunk of stack memory. This should enable us to
|
|
|
|
# display at least several stack frames worth of backtrace. We'll
|
|
|
|
# assume that if we can't display at least "depth" levels (with
|
|
|
|
# args), it counts as an error.
|
|
|
|
|
|
|
|
gdb_test_multiple "backtrace" "$msg" {
|
|
|
|
-re "#$depth\[\t \].*gdb_recursion_test.*depth=\[0-9\]+.*q1=\[0-9\]+.*q2=\[0-9\]+.*q3=\[0-9\]+.*q4=\[0-9\]+.*q5=\[0-9\]+.*q6=\[0-9\]+.*$gdb_prompt $" {
|
|
|
|
pass "$msg"
|
|
|
|
}
|
|
|
|
-re "#$depth\[\t \].*gdb_recursion_test.*depth=.*$gdb_prompt $" {
|
|
|
|
fail "$msg (args missing from #$depth stack frame)"
|
|
|
|
}
|
|
|
|
-re "#\[0-9\]+\[\t \].*gdb_recursion_test.*depth=.*$gdb_prompt $" {
|
|
|
|
fail "$msg (fewer than $depth stack frames found)"
|
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
2013-07-31 00:44:42 +00:00
|
|
|
|
|
|
|
set output_string0 ""
|
|
|
|
# Match the output of command 'tdump' and save it in
|
|
|
|
# $output_string0.
|
|
|
|
set test "tdump on frame 0"
|
|
|
|
gdb_test_multiple "tdump" $test {
|
|
|
|
-re "tdump\[\r\n\]+(.*)\[\r\n\]+$gdb_prompt $" {
|
|
|
|
set output_string0 $expect_out(1,string)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gdb_test "up" ".*" ""
|
|
|
|
|
|
|
|
# Test that command 'tdump' still works properly when the
|
|
|
|
# selected frame is not the current frame, and save the output
|
|
|
|
# in $output_string1.
|
|
|
|
set test "tdump on frame 1"
|
|
|
|
set output_string1 ""
|
|
|
|
gdb_test_multiple "tdump" $test {
|
|
|
|
-re "tdump\[\r\n\]+(.*)\[\r\n\]+$gdb_prompt $" {
|
|
|
|
set output_string1 $expect_out(1,string)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Output of 'tdump' on frame 0 and frame 1 should be
|
|
|
|
# identical.
|
2014-07-14 18:55:31 +00:00
|
|
|
gdb_assert ![string compare $output_string0 $output_string1] \
|
|
|
|
"tdump output"
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# begin backtrace test
|
|
|
|
#
|
|
|
|
|
|
|
|
set timeout 60
|
|
|
|
|
|
|
|
gdb_tfind_test "init: make sure not debugging any trace frame" "none" "-1"
|
|
|
|
|
|
|
|
gdb_tfind_test "8.6: find start frame" "start" "0"
|
|
|
|
gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
|
|
|
|
"TDP $tdp2:" ""
|
|
|
|
gdb_backtrace_tdp_1 "8.6: Backtrace, depth == 1, collect nothing"
|
|
|
|
|
|
|
|
gdb_tfind_test "8.6: find frame 1" "1" "1"
|
|
|
|
gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
|
|
|
|
"TDP $tdp3:" ""
|
|
|
|
gdb_backtrace_tdp_2 "8.6: Backtrace, depth == 1, collect regs"
|
|
|
|
|
|
|
|
gdb_tfind_test "8.6: find frame 2" "2" "2"
|
|
|
|
gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
|
|
|
|
"TDP $tdp4:" ""
|
|
|
|
gdb_backtrace_tdp_3 "8.6: Backtrace, depth == 1, collect args and locals"
|
|
|
|
|
|
|
|
|
|
|
|
gdb_tfind_test "8.6: find frame 4" "4" "4"
|
|
|
|
gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
|
|
|
|
"TDP $tdp6:" ""
|
2013-07-31 00:38:40 +00:00
|
|
|
gdb_backtrace_tdp_4 "8.6: Backtrace, depth == 1, collect stack mem expr" "0" 4
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
gdb_tfind_test "8.6: find frame 5" "5" "5"
|
|
|
|
gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
|
|
|
|
"TDP $tdp2:" ""
|
|
|
|
gdb_backtrace_tdp_1 "8.6: Backtrace, depth == 2, collect nothing"
|
|
|
|
|
|
|
|
gdb_tfind_test "8.6: find frame 6" "6" "6"
|
|
|
|
gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
|
|
|
|
"TDP $tdp3:" ""
|
|
|
|
gdb_backtrace_tdp_2 "8.6: Backtrace, depth == 2, collect regs"
|
|
|
|
|
|
|
|
gdb_tfind_test "8.6: find frame 7" "7" "7"
|
|
|
|
gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
|
|
|
|
"TDP $tdp4:" ""
|
|
|
|
gdb_backtrace_tdp_3 "8.6: Backtrace, depth == 2, collect args and locals"
|
|
|
|
|
|
|
|
|
|
|
|
gdb_tfind_test "8.6: find frame 9" "9" "9"
|
|
|
|
gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
|
|
|
|
"TDP $tdp6:" ""
|
2013-07-31 00:38:40 +00:00
|
|
|
gdb_backtrace_tdp_4 "8.6: Backtrace, depth == 1, collect stack mem expr" "0" 9
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
gdb_tfind_test "8.6: find frame 10" "10" "10"
|
|
|
|
gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
|
|
|
|
"TDP $tdp2:" ""
|
|
|
|
gdb_backtrace_tdp_1 "8.6: Backtrace, depth == 3, collect nothing"
|
|
|
|
|
|
|
|
gdb_tfind_test "8.6: find frame 11" "11" "11"
|
|
|
|
gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
|
|
|
|
"TDP $tdp3:" ""
|
|
|
|
gdb_backtrace_tdp_2 "8.6: Backtrace, depth == 3, collect regs"
|
|
|
|
|
|
|
|
gdb_tfind_test "8.6: find frame 12" "12" "12"
|
|
|
|
gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
|
|
|
|
"TDP $tdp4:" ""
|
|
|
|
gdb_backtrace_tdp_3 "8.6: Backtrace, depth == 3, collect args and locals"
|
|
|
|
|
|
|
|
|
|
|
|
gdb_tfind_test "8.6: find frame 14" "14" "14"
|
|
|
|
gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
|
|
|
|
"TDP $tdp6:" ""
|
2013-07-31 00:38:40 +00:00
|
|
|
gdb_backtrace_tdp_4 "8.6: Backtrace, depth == 1, collect stack mem expr" "0" 14
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
gdb_tfind_test "8.6: find frame 15" "15" "15"
|
|
|
|
gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
|
|
|
|
"TDP $tdp2:" ""
|
|
|
|
gdb_backtrace_tdp_1 "8.6: Backtrace, depth == 4, collect nothing"
|
|
|
|
|
|
|
|
gdb_tfind_test "8.6: find frame 16" "16" "16"
|
|
|
|
gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
|
|
|
|
"TDP $tdp3:" ""
|
|
|
|
gdb_backtrace_tdp_2 "8.6: Backtrace, depth == 4, collect regs"
|
|
|
|
|
|
|
|
gdb_tfind_test "8.6: find frame 17" "17" "17"
|
|
|
|
gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
|
|
|
|
"TDP $tdp4:" ""
|
|
|
|
gdb_backtrace_tdp_3 "8.6: Backtrace, depth == 4, collect args and locals"
|
|
|
|
|
|
|
|
|
|
|
|
gdb_tfind_test "8.6: find frame 19" "19" "19"
|
|
|
|
gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
|
|
|
|
"TDP $tdp6:" ""
|
2013-07-31 00:38:40 +00:00
|
|
|
gdb_backtrace_tdp_4 "8.6: Backtrace, depth == 1, collect stack mem expr" "0" 19
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
gdb_test "printf \"x \%d x\\n\", depth == 3" \
|
|
|
|
"x 0 x" \
|
|
|
|
"1.13: trace in recursion: depth not equal to 3"
|
|
|
|
|
|
|
|
# Finished!
|
2010-06-08 22:58:03 +00:00
|
|
|
gdb_test "tfind none" ".*" ""
|