2004-02-26 17:23:23 +00:00
|
|
|
# This testcase is part of GDB, the GNU debugger.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2013-01-01 06:33:28 +00:00
|
|
|
# Copyright 1988-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/>.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
# Please email any bugs, comments, and/or additions to this file to:
|
2004-02-26 17:23:23 +00:00
|
|
|
# bug-gdb@gnu.org
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
# This file was written by Rob Savoye. (rob@cygnus.com)
|
|
|
|
|
|
|
|
#
|
|
|
|
# test running programs
|
|
|
|
#
|
|
|
|
|
test suite update - gdb.base/s*
Convert files gdb.base/s*.exp to use standard_output_file et al.
* gdb.base/save-bp.exp, gdb.base/savedregs.exp,
gdb.base/scope.exp, gdb.base/sep.exp, gdb.base/sepsymtab.exp,
gdb.base/set-lang-auto.exp, gdb.base/setshow.exp,
gdb.base/setvar.exp, gdb.base/shlib-call.exp,
gdb.base/shreloc.exp, gdb.base/sigall.exp,
gdb.base/sigaltstack.exp, gdb.base/sigbpt.exp,
gdb.base/sigchld.exp, gdb.base/siginfo-addr.exp,
gdb.base/siginfo-infcall.exp, gdb.base/siginfo-obj.exp,
gdb.base/siginfo.exp, gdb.base/signals.exp, gdb.base/signest.exp,
gdb.base/signull.exp, gdb.base/sigrepeat.exp,
gdb.base/sigstep.exp, gdb.base/sizeof.exp,
gdb.base/skip-solib.exp, gdb.base/so-impl-ld.exp,
gdb.base/solib-display.exp, gdb.base/solib-nodir.exp,
gdb.base/solib-overlap.exp, gdb.base/solib-symbol.exp,
gdb.base/solib-weak.exp, gdb.base/source.exp,
gdb.base/stack-checking.exp, gdb.base/stale-infcall.exp,
gdb.base/stap-probe.exp, gdb.base/start.exp,
gdb.base/step-break.exp, gdb.base/step-bt.exp,
gdb.base/step-line.exp, gdb.base/step-resume-infcall.exp,
gdb.base/step-test.exp, gdb.base/structs.exp,
gdb.base/structs2.exp, gdb.base/structs3.exp,
gdb.base/symbol-without-target_section.exp: Use standard_testfile,
standard_output_file, prepare_for_testing, clean_restart.
2013-06-27 18:58:28 +00:00
|
|
|
standard_testfile
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
# Create and source the file that provides information about the compiler
|
|
|
|
# used to compile the test case.
|
2012-06-21 20:46:25 +00:00
|
|
|
if [get_compiler_info] {
|
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 suite update - gdb.base/s*
Convert files gdb.base/s*.exp to use standard_output_file et al.
* gdb.base/save-bp.exp, gdb.base/savedregs.exp,
gdb.base/scope.exp, gdb.base/sep.exp, gdb.base/sepsymtab.exp,
gdb.base/set-lang-auto.exp, gdb.base/setshow.exp,
gdb.base/setvar.exp, gdb.base/shlib-call.exp,
gdb.base/shreloc.exp, gdb.base/sigall.exp,
gdb.base/sigaltstack.exp, gdb.base/sigbpt.exp,
gdb.base/sigchld.exp, gdb.base/siginfo-addr.exp,
gdb.base/siginfo-infcall.exp, gdb.base/siginfo-obj.exp,
gdb.base/siginfo.exp, gdb.base/signals.exp, gdb.base/signest.exp,
gdb.base/signull.exp, gdb.base/sigrepeat.exp,
gdb.base/sigstep.exp, gdb.base/sizeof.exp,
gdb.base/skip-solib.exp, gdb.base/so-impl-ld.exp,
gdb.base/solib-display.exp, gdb.base/solib-nodir.exp,
gdb.base/solib-overlap.exp, gdb.base/solib-symbol.exp,
gdb.base/solib-weak.exp, gdb.base/source.exp,
gdb.base/stack-checking.exp, gdb.base/stale-infcall.exp,
gdb.base/stap-probe.exp, gdb.base/start.exp,
gdb.base/step-break.exp, gdb.base/step-bt.exp,
gdb.base/step-line.exp, gdb.base/step-resume-infcall.exp,
gdb.base/step-test.exp, gdb.base/structs.exp,
gdb.base/structs2.exp, gdb.base/structs3.exp,
gdb.base/symbol-without-target_section.exp: Use standard_testfile,
standard_output_file, prepare_for_testing, clean_restart.
2013-06-27 18:58:28 +00:00
|
|
|
if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
|
|
|
|
untested $testfile.exp
|
|
|
|
return -1
|
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# set it up at a breakpoint so we canplay with the variable values
|
|
|
|
#
|
2010-05-27 23:44:51 +00:00
|
|
|
gdb_test_no_output "set print sevenbit-strings"
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
if ![runto_main] then {
|
|
|
|
perror "couldn't run to breakpoint"
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
|
|
|
# Determine expected output for unsigned long variables,
|
|
|
|
# the output varies with sizeof (unsigned long).
|
|
|
|
|
2010-05-27 23:44:51 +00:00
|
|
|
gdb_test_multiple "print sizeof (unsigned long)" "sizeof ulong" {
|
|
|
|
-re ".\[0-9\]* = 4.*$gdb_prompt $" {
|
|
|
|
set ulong_minus_1 4294967295
|
|
|
|
set ulong_minus_456 4294966840
|
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
-re ".\[0-9\]* = 8.*$gdb_prompt $" {
|
|
|
|
set ulong_minus_1 18446744073709551615
|
|
|
|
set ulong_minus_456 18446744073709551160
|
|
|
|
}
|
2010-05-27 23:44:51 +00:00
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
proc test_set { args } {
|
|
|
|
global gdb_prompt
|
|
|
|
|
2013-06-07 17:31:09 +00:00
|
|
|
set length [expr [llength $args] - 1]
|
|
|
|
set message "[lindex $args $length]"
|
|
|
|
set final [expr $length - 2]
|
|
|
|
set count 1
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
# Set up the variables.
|
2012-07-19 20:00:59 +00:00
|
|
|
for {set x 0} {$x < $length} {incr x} {
|
1999-04-16 01:35:26 +00:00
|
|
|
if { "[lindex $args $x]" != "" } {
|
2013-06-07 17:31:09 +00:00
|
|
|
set arg [lindex $args $x]
|
1999-04-16 01:35:26 +00:00
|
|
|
if { ($x == $final) || ([string first ".*" [lindex $args [expr $x + 1]]] >= 0) } {
|
2013-06-07 17:31:09 +00:00
|
|
|
set match [lindex $args [expr $x + 1]]
|
1999-04-16 01:35:26 +00:00
|
|
|
if { $count == 1 } {
|
|
|
|
set mess "$message"
|
|
|
|
} else {
|
2013-06-07 17:31:09 +00:00
|
|
|
set mess "$message (#$count)"
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
2013-06-07 17:31:09 +00:00
|
|
|
incr count
|
|
|
|
incr x
|
1999-04-16 01:35:26 +00:00
|
|
|
} else {
|
2013-06-07 17:31:09 +00:00
|
|
|
set mess ""
|
1999-04-16 01:35:26 +00:00
|
|
|
set match ""
|
|
|
|
}
|
|
|
|
verbose "doing $arg $match"
|
|
|
|
if [gdb_test "$arg" "$match" "$mess"] {
|
2013-06-07 17:31:09 +00:00
|
|
|
fail "$message -- $match"
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
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 0
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# test "set variable" for type "char"
|
|
|
|
#
|
|
|
|
# Because bare char types can be either signed or unsigned, we just test the
|
|
|
|
# range of values that are common to both (0-127).
|
|
|
|
#
|
|
|
|
|
2009-07-07 21:33:50 +00:00
|
|
|
test_set "set variable v_char=0" "print v_char" ".\[0-9\]* = 0 \'.000\'" "set variable char=0"
|
|
|
|
test_set "set variable v_char=1" "print v_char" ".\[0-9\]* = 1 \'.001\'" "set variable char=1"
|
2004-02-26 17:23:23 +00:00
|
|
|
test_set "set variable v_char=7" "print v_char" ".\[0-9\]* = 7 \'.a\'" "set variable char=7 (Bel)"
|
1999-04-16 01:35:26 +00:00
|
|
|
test_set "set variable v_char=32" "print v_char" ".\[0-9\]* = 32 \' \'" "set variable char=32 (SPC)"
|
|
|
|
test_set "set variable v_char=65" "print v_char" ".\[0-9\]* = 65 \'A\'" "set variable char=65 ('A')"
|
|
|
|
test_set "set variable v_char=97" "print v_char" ".\[0-9\]* = 97 \'a\'" "set variable char=97 ('a')"
|
|
|
|
test_set "set variable v_char=126" "print v_char" ".\[0-9\]* = 126 \'~\'" "set variable char=126 ('~')"
|
|
|
|
test_set "set variable v_char=127" "print v_char" ".\[0-9\]* = 127 \'.177\'" "set variable char=127 (8-bit)"
|
|
|
|
#
|
|
|
|
# test "set variable" for type "signed char"
|
|
|
|
#
|
2009-07-07 21:33:50 +00:00
|
|
|
test_set "set variable v_char=0" "print v_signed_char" ".\[0-9\]* = 0 \'.000\'" "set variable signed char=0"
|
|
|
|
test_set "set variable v_signed_char=1" "print v_signed_char" ".\[0-9\]* = 1 \'.001\'" "set variable signed char=1"
|
2004-02-26 17:23:23 +00:00
|
|
|
test_set "set variable v_signed_char=7" "print v_signed_char" ".\[0-9\]* = 7 \'.a\'" "set variable signed char=7 (Bel)"
|
1999-04-16 01:35:26 +00:00
|
|
|
test_set "set variable v_signed_char=32" "print v_signed_char" ".\[0-9\]* = 32 \' \'" "set variable signed char=32 (SPC)"
|
|
|
|
test_set "set variable v_signed_char=65" "print v_signed_char" ".\[0-9\]* = 65 \'A\'" "set variable signed char=65 ('A')"
|
|
|
|
test_set "set variable v_signed_char=97" "print v_signed_char" ".\[0-9\]* = 97 \'a\'" "set variable signed char=97 ('a')"
|
|
|
|
test_set "set variable v_signed_char=126" "print v_signed_char" ".\[0-9\]* = 126 \'~\'" "set variable signed char=126 ('~')"
|
|
|
|
test_set "set variable v_signed_char=127" "print v_signed_char" ".\[0-9\]* = 127 \'.177\'" "set variable signed char=127 (8-bit)"
|
2010-06-01 21:29:21 +00:00
|
|
|
gdb_test_no_output "set variable v_signed_char=-1"
|
1999-04-16 01:35:26 +00:00
|
|
|
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix4*" }
|
|
|
|
gdb_test "print v_signed_char" ".\[0-9\]* = -1 \'.377\'" \
|
|
|
|
"set variable signed char=-1 (-1)"
|
2010-06-01 21:29:21 +00:00
|
|
|
gdb_test_no_output "set variable v_signed_char=0xFF"
|
1999-04-16 01:35:26 +00:00
|
|
|
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix4*" }
|
|
|
|
gdb_test "print v_signed_char" ".\[0-9\]* = -1 \'.377\'" \
|
|
|
|
"set variable signed char=0xFF (0xFF)"
|
|
|
|
#
|
|
|
|
# test "set variable" for type "unsigned char"
|
|
|
|
#
|
2009-07-07 21:33:50 +00:00
|
|
|
test_set "set variable v_unsigned_char=0" "print v_unsigned_char" ".\[0-9\]* = 0 \'.000\'" "set variable unsigned char=0"
|
|
|
|
test_set "set variable v_unsigned_char=1" "print v_unsigned_char" ".\[0-9\]* = 1 \'.001\'" "set variable unsigned char=1"
|
2004-02-26 17:23:23 +00:00
|
|
|
test_set "set variable v_unsigned_char=7" "print v_unsigned_char" ".\[0-9\]* = 7 \'.a\'" "set variable unsigned char=7 (Bel)"
|
1999-04-16 01:35:26 +00:00
|
|
|
test_set "set variable v_unsigned_char=32" "print v_unsigned_char" ".\[0-9\]* = 32 \' \'" "set variable unsigned char=32 (SPC)"
|
|
|
|
test_set "set variable v_unsigned_char=65" "print v_unsigned_char" ".\[0-9\]* = 65 \'A\'" "set variable unsigned char=65 ('A')"
|
|
|
|
test_set "set variable v_unsigned_char=97" "print v_unsigned_char" ".\[0-9\]* = 97 \'a\'" "set variable unsigned char=97 ('a')"
|
|
|
|
test_set "set variable v_unsigned_char=126" "print v_unsigned_char" ".\[0-9\]* = 126 \'~\'" "set variable unsigned char=126 ('~')"
|
|
|
|
test_set "set variable v_unsigned_char=~0" "print v_unsigned_char" ".\[0-9\]* = 255 \'.377\'" "set variable unsigned char=255 (8-bit)"
|
|
|
|
#
|
|
|
|
# test "set variable" for type "short"
|
|
|
|
#
|
|
|
|
test_set "set variable v_short=0" "print v_short" ".\[0-9\]* = 0" "set variable short=0"
|
|
|
|
test_set "set variable v_short=1" "print v_short" ".\[0-9\]* = 1" "set variable short=1"
|
|
|
|
test_set "set variable v_short=-1" "print v_short" ".\[0-9\]* = -1" "set variable short=-1 (minus)"
|
|
|
|
#
|
|
|
|
# test "set variable" for type "signed short"
|
|
|
|
#
|
|
|
|
test_set "set variable v_signed_short=0" "print v_signed_short" ".\[0-9\]* = 0" "set variable signed short=0"
|
|
|
|
test_set "set variable v_signed_short=1" "print v_signed_short" ".\[0-9\]* = 1" "set variable signed short=1"
|
|
|
|
test_set "set variable v_signed_short=-1" "print v_signed_short" ".\[0-9\]* = -1" "set variable signed short=-1 (minus)"
|
|
|
|
#
|
|
|
|
# test "set variable" for type "unsigned short"
|
|
|
|
#
|
|
|
|
test_set "set variable v_unsigned_short=0" "print v_unsigned_short" ".\[0-9\]* = 0" "set variable unsigned short=0"
|
|
|
|
test_set "set variable v_unsigned_short=1" "print v_unsigned_short" ".\[0-9\]* = 1" "set variable unsigned short=1"
|
|
|
|
test_set "set variable v_unsigned_short=~0" "print v_unsigned_short" ".\[0-9\]* = 65535" "set variable unsigned short=~0 (minus)"
|
|
|
|
#
|
|
|
|
# test "set variable" for type "int"
|
|
|
|
#
|
|
|
|
test_set "set variable v_int=0" "print v_int" ".\[0-9\]* = 0" "set variable int=0"
|
|
|
|
test_set "set variable v_int=1" "print v_int" ".\[0-9\]* = 1" "set variable int=1"
|
|
|
|
test_set "set variable v_int=-1" "print v_int" ".\[0-9\]* = -1" "set variable int=-1 (minus)"
|
|
|
|
#
|
|
|
|
# test "set variable" for type "signed int"
|
|
|
|
#
|
|
|
|
test_set "set variable v_signed_int=0" "print v_signed_int" ".\[0-9\]* = 0" "set variable signed int=0"
|
|
|
|
test_set "set variable v_signed_int=1" "print v_signed_int" ".\[0-9\]* = 1" "set variable signed int=1"
|
|
|
|
test_set "set variable v_signed_int=-1" "print v_signed_int" ".\[0-9\]* = -1" "set variable signed int=-1 (minus)"
|
|
|
|
#
|
|
|
|
# test "set variable" for type "unsigned int"
|
|
|
|
#
|
|
|
|
test_set "set variable v_unsigned_int=0" "print v_unsigned_int" ".\[0-9\]* = 0" "set variable unsigned int=0"
|
|
|
|
test_set "set variable v_unsigned_int=1" "print v_unsigned_int" ".\[0-9\]* = 1" "set variable unsigned int=1"
|
|
|
|
test_set "set variable v_unsigned_int=~0" "print v_unsigned_int" ".\[0-9\]* = (4294967295|65535)" "set variable unsigned int=~0 (minus)"
|
|
|
|
#test_set ".\[0-9\]* = 65535" "set variable unsigned int=~0 (minus)"
|
|
|
|
#
|
|
|
|
# test "set variable" for type "long"
|
|
|
|
#
|
|
|
|
test_set "set variable v_long=0" "print v_long" ".\[0-9\]* = 0" "set variable long=0"
|
|
|
|
test_set "set variable v_long=1" "print v_long" ".\[0-9\]* = 1" "set variable long=1"
|
|
|
|
test_set "set variable v_long=-1" "print v_long" ".\[0-9\]* = -1" "set variable long=-1 (minus)"
|
|
|
|
#
|
|
|
|
# test "set variable" for type "signed long"
|
|
|
|
#
|
|
|
|
test_set "set variable v_signed_long=0" "print v_signed_long" ".\[0-9\]* = 0" "set variable signed long=0"
|
|
|
|
test_set "set variable v_signed_long=1" "print v_signed_long" ".\[0-9\]* = 1" "set variable signed long=1"
|
|
|
|
test_set "set variable v_signed_long=-1" "print v_signed_long" ".\[0-9\]* = -1" "set variable signed long=-1 (minus)"
|
|
|
|
#
|
|
|
|
# test "set variable" for type "unsigned long"
|
|
|
|
#
|
|
|
|
test_set "set variable v_unsigned_long=0" "print v_unsigned_long" ".\[0-9\]* = 0" "set variable unsigned long=0"
|
|
|
|
test_set "set variable v_unsigned_long=1" "print v_unsigned_long" ".\[0-9\]* = 1" "set variable unsigned long=1"
|
|
|
|
test_set "set variable v_unsigned_long=~0" "print v_unsigned_long" ".\[0-9\]* = $ulong_minus_1" "set variable unsigned long=~0 (minus)"
|
|
|
|
#
|
|
|
|
# test "set variable" for type "float"
|
|
|
|
#
|
|
|
|
test_set "set variable v_float=0.0" "print v_float" ".\[0-9\]* = 0" "set variable float=0"
|
|
|
|
test_set "set variable v_float=1.0" "print v_float" ".\[0-9\]* = 1" "set variable float=1"
|
|
|
|
test_set "set variable v_float=-1.0" "print v_float" ".\[0-9\]* = -1" "set variable float=-1 (minus)"
|
|
|
|
#
|
|
|
|
# test "set variable" for type "double"
|
|
|
|
#
|
|
|
|
test_set "set variable v_double=0.0" "print v_double" ".\[0-9\]* = 0" "set variable double=0"
|
|
|
|
test_set "set variable v_double=1.0" "print v_double" ".\[0-9\]* = 1" "set variable double=1"
|
|
|
|
test_set "set variable v_double=-1.0" "print v_double" ".*.\[0-9\]* = -1" "set variable double=-1 (minus)"
|
|
|
|
#
|
|
|
|
# test "set variable" for "char array[2]"
|
|
|
|
#
|
|
|
|
test_set "set variable v_char_array\[0\]='h'" "set variable v_char_array\[1\]='i'" "print v_char_array" ".*.\[0-9\]* =.*\"hi\"" "set variable char array=\"hi\" (string)"
|
|
|
|
#
|
|
|
|
# test "set variable" for "signed char array[2]"
|
|
|
|
#
|
2007-09-05 00:51:49 +00:00
|
|
|
test_set "set variable v_signed_char_array\[0\]='h'" "set variable v_signed_char_array\[1\]='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\"hi\"" "set variable signed char array=\"hi\" (string)"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for "unsigned char array[2]"
|
|
|
|
#
|
2007-09-05 00:51:49 +00:00
|
|
|
test_set "set variable v_unsigned_char_array\[0\]='h'" "set variable v_unsigned_char_array\[1\]='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\"hi\"" "set variable unsigned char array=\"hi\" (string)"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for "short array[2]"
|
|
|
|
#
|
2000-12-20 16:29:27 +00:00
|
|
|
test_set "set variable v_short_array\[0\]=123" "set variable v_short_array\[1\]=-456" "print v_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable short array"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for "signed short array[2]"
|
|
|
|
#
|
2000-12-20 16:29:27 +00:00
|
|
|
test_set "set variable v_signed_short_array\[0\]=123" "set variable v_signed_short_array\[1\]=-456" "print v_signed_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable signed short array"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for "unsigned short array[2]"
|
|
|
|
#
|
2000-12-20 16:29:27 +00:00
|
|
|
test_set "set variable v_unsigned_short_array\[0\]=123" "set variable v_unsigned_short_array\[1\]=-456" "print v_unsigned_short_array" ".*.\[0-9\]* =.*\\{123,.*65080\\}" "set variable unsigned short array"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for "int array[2]"
|
|
|
|
#
|
2000-12-20 16:29:27 +00:00
|
|
|
test_set "set variable v_int_array\[0\]=123" "set variable v_int_array\[1\]=-456" "print v_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable int array"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for "signed int array[2]"
|
|
|
|
#
|
2000-12-20 16:29:27 +00:00
|
|
|
test_set "set variable v_signed_int_array\[0\]=123" "set variable v_signed_int_array\[1\]=-456" "print v_signed_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable signed int array"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for "unsigned int array[2]"
|
|
|
|
#
|
2000-12-20 16:29:27 +00:00
|
|
|
test_set "set variable v_unsigned_int_array\[0\]=123" "set variable v_unsigned_int_array\[1\]=-456" "print v_unsigned_int_array" ".*.\[0-9\]* =.*\\{123,.*(4294966840|65080)\\}" "set variable unsigned int array"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for "long array[2]"
|
|
|
|
#
|
2000-12-20 16:29:27 +00:00
|
|
|
test_set "set variable v_long_array\[0\]=123" "set variable v_long_array\[1\]=-456" "print v_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable long array"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for "signed long array[2]"
|
|
|
|
#
|
2000-12-20 16:29:27 +00:00
|
|
|
test_set "set variable v_signed_long_array\[0\]=123" "set variable v_signed_long_array\[1\]=-456" "print v_signed_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable signed long array"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for "unsigned long array[2]"
|
|
|
|
#
|
2000-12-20 16:29:27 +00:00
|
|
|
test_set "set variable v_unsigned_long_array\[0\]=123" "set variable v_unsigned_long_array\[1\]=-456" "print v_unsigned_long_array" ".*.\[0-9\]* =.*\\{123,.*$ulong_minus_456\\}" "set variable unsigned long array"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for "float array[2]"
|
|
|
|
#
|
2000-12-20 16:29:27 +00:00
|
|
|
test_set "set variable v_float_array\[0\]=123.0" "set variable v_float_array\[1\]=-456.0" "print v_float_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable float array"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for "double array[2]"
|
|
|
|
#
|
2000-12-20 16:29:27 +00:00
|
|
|
test_set "set variable v_double_array\[0\]=123.0" "set variable v_double_array\[1\]=-456.0" "print v_double_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable double array"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for type "char *"
|
|
|
|
#
|
|
|
|
test_set "set v_char_pointer=v_char_array" "set variable *(v_char_pointer)='h'" "set variable *(v_char_pointer+1)='i'" "print v_char_array" ".*.\[0-9\]* =.*\"hi\"" "print *(v_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'" "set variable char pointer=\"hi\" (string)"
|
|
|
|
#
|
|
|
|
# test "set variable" for type "signed char *"
|
|
|
|
#
|
2007-09-05 00:51:49 +00:00
|
|
|
test_set "set v_signed_char_pointer=v_signed_char_array" "set variable *(v_signed_char_pointer)='h'" "set variable *(v_signed_char_pointer+1)='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\"hi\"" "print *(v_signed_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'" "set variable signed char pointer=\"hi\" (string)"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for type "unsigned char *"
|
|
|
|
#
|
2007-09-05 00:51:49 +00:00
|
|
|
test_set "set v_unsigned_char_pointer=v_unsigned_char_array" "set variable *(v_unsigned_char_pointer)='h'" "set variable *(v_unsigned_char_pointer+1)='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\"hi\"" "print *(v_unsigned_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'" "set variable unsigned char pointer=\"hi\" (string)"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for type "short *"
|
|
|
|
#
|
2000-12-20 16:29:27 +00:00
|
|
|
test_set "set v_short_pointer=v_short_array" "set variable *(v_short_pointer)=123" "set variable *(v_short_pointer+1)=-456" "print v_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_short_pointer+1)" ".*.\[0-9\]* = -456" "set variable short pointer"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for type "signed short *"
|
|
|
|
#
|
2010-06-01 21:29:21 +00:00
|
|
|
gdb_test_no_output "set v_signed_short_pointer=v_signed_short_array"
|
|
|
|
gdb_test_no_output "set variable *(v_signed_short_pointer)=123"
|
|
|
|
gdb_test_no_output "set variable *(v_signed_short_pointer+1)=-456"
|
2001-10-29 16:24:35 +00:00
|
|
|
gdb_test "print v_signed_short_array" ".\[0-9\]* =.*\\{123,.*-456\\}" \
|
1999-04-16 01:35:26 +00:00
|
|
|
"set variable signed short pointer"
|
|
|
|
gdb_test "print *(v_signed_short_pointer+1)" ".\[0-9\]*.*=.*-456"
|
|
|
|
#
|
|
|
|
# test "set variable" for type "unsigned short *"
|
|
|
|
#
|
2010-06-01 21:29:21 +00:00
|
|
|
gdb_test_no_output "set v_unsigned_short_pointer=v_unsigned_short_array"
|
|
|
|
gdb_test_no_output "set variable *(v_unsigned_short_pointer)=123"
|
|
|
|
gdb_test_no_output "set variable *(v_unsigned_short_pointer+1)=-456"
|
2001-10-29 16:24:35 +00:00
|
|
|
gdb_test "print v_unsigned_short_array" ".\[0-9\]* =.*\\{123,.*65080\\}" \
|
1999-04-16 01:35:26 +00:00
|
|
|
"set variable unsigned short pointer"
|
|
|
|
gdb_test "print *(v_unsigned_short_pointer+1)" ".\[0-9\]* = 65080"
|
|
|
|
#
|
|
|
|
# test "set variable" for type "int *"
|
|
|
|
#
|
2000-12-20 16:29:27 +00:00
|
|
|
test_set "set v_int_pointer=v_int_array" "set variable *(v_int_pointer)=123" "set variable *(v_int_pointer+1)=-456" "print v_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_int_pointer+1)" ".*.\[0-9\]* = -456" "set variable int pointer"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for type "signed int *"
|
|
|
|
#
|
2000-12-20 16:29:27 +00:00
|
|
|
test_set "set v_signed_int_pointer=v_signed_int_array" "set variable *(v_signed_int_pointer)=123" "set variable *(v_signed_int_pointer+1)=-456" "print v_signed_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_signed_int_pointer+1)" ".*.\[0-9\]* = -456" "set variable signed int pointer"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for type "unsigned int *"
|
|
|
|
#
|
2000-12-20 16:29:27 +00:00
|
|
|
test_set "set v_unsigned_int_pointer=v_unsigned_int_array" "set variable *(v_unsigned_int_pointer)=123" "set variable *(v_unsigned_int_pointer+1)=-456" "print v_unsigned_int_array" ".*.\[0-9\]* =.*\\{123,.*(4294966840|65080)\\}" "set variable unsigned int pointer"
|
1999-04-16 01:35:26 +00:00
|
|
|
test_set "" "print *(v_unsigned_int_pointer+1)" ".*.\[0-9\]* = (4294966840|65080)" "print variable unsigned int pointer+1"
|
|
|
|
#
|
|
|
|
# test "set variable" for type "long *"
|
|
|
|
#
|
2000-12-20 16:29:27 +00:00
|
|
|
test_set "set v_long_pointer=v_long_array" "set variable *(v_long_pointer)=123" "set variable *(v_long_pointer+1)=-456" "print v_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_long_pointer+1)" ".*.\[0-9\]* = -456" "set variable long pointer"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for type "signed long *"
|
|
|
|
#
|
2000-12-20 16:29:27 +00:00
|
|
|
test_set "set v_signed_long_pointer=v_signed_long_array" "set variable *(v_signed_long_pointer)=123" "set variable *(v_signed_long_pointer+1)=-456" "print v_signed_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_signed_long_pointer+1)" ".*.\[0-9\]* = -456" "set variable signed long pointer"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for type "unsigned long *"
|
|
|
|
#
|
2000-12-20 16:29:27 +00:00
|
|
|
test_set "set v_unsigned_long_pointer=v_unsigned_long_array" "set variable *(v_unsigned_long_pointer)=123" "set variable *(v_unsigned_long_pointer+1)=-456" "print v_unsigned_long_array" ".*.\[0-9\]* =.*\\{123,.*$ulong_minus_456\\}" "print *(v_unsigned_long_pointer+1)" ".*.\[0-9\]* = $ulong_minus_456" "set variable unsigned long pointer"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for type "float *"
|
|
|
|
#
|
2000-12-20 16:29:27 +00:00
|
|
|
test_set "set v_float_pointer=v_float_array" "set variable *(v_float_pointer)=123.0" "set variable *(v_float_pointer+1)=-456.0" "print v_float_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_float_pointer+1)" ".*.\[0-9\]* = -456" "set variable float pointer"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for type "double *"
|
|
|
|
#
|
2000-12-20 16:29:27 +00:00
|
|
|
test_set "set v_double_pointer=v_double_array" "set variable *(v_double_pointer)=123.0" "set variable *(v_double_pointer+1)=-456.0" "print v_double_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_double_pointer+1)" ".*.\[0-9\]* = -456" "set variable double pointer"
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for struct members
|
|
|
|
#
|
|
|
|
test_set "set variable v_struct1.v_char_member='h'" "print v_struct1.v_char_member" ".*.\[0-9\]* = 104 \'h\'" "set variable structure char member"
|
|
|
|
test_set "set variable v_struct1.v_short_member=1" "print v_struct1.v_short_member" ".*.\[0-9\]* = 1" "set variable structure short member"
|
|
|
|
test_set "set variable v_struct1.v_int_member=2" "print v_struct1.v_int_member" ".*.\[0-9\]* = 2" "set variable structure int member"
|
|
|
|
test_set "set variable v_struct1.v_long_member=3" "print v_struct1.v_long_member" ".*.\[0-9\]* = 3" "set variable structure long member"
|
|
|
|
test_set "set variable v_struct1.v_float_member=4.0" "print v_struct1.v_float_member" ".*.\[0-9\]* = 4" "set variable structure float member"
|
|
|
|
test_set "set variable v_struct1.v_double_member=5.0" "print v_struct1.v_double_member" ".*.\[0-9\]* = 5" "set variable structure double member"
|
|
|
|
|
|
|
|
gdb_test "print v_struct1" \
|
|
|
|
".*.\[0-9\]* = \{.*v_char_member = 104 \'h\',.*v_short_member = 1,\
|
|
|
|
.*v_int_member = 2,.*\
|
|
|
|
v_long_member = 3,.*v_float_member = 4,.*v_double_member = 5.*\}" \
|
|
|
|
"set print structure #1"
|
|
|
|
|
1999-12-14 01:06:04 +00:00
|
|
|
# Some believe that the following should be an error. GCC extensions for
|
|
|
|
# structure constants require the type of the structure to be specified, as in
|
1999-04-16 01:35:26 +00:00
|
|
|
# v_struct1 = (struct t_struct) {32, 33, 34, 35, 36, 37}
|
1999-12-14 01:06:04 +00:00
|
|
|
# The argument is that GDB should do the same if it wants to provide this
|
|
|
|
# feature, i.e., require the cast.
|
|
|
|
# We decided that we don't want the debugger to be as picky as a
|
|
|
|
# compiler and make us type complex casts.
|
|
|
|
|
1999-07-07 17:31:57 +00:00
|
|
|
# We need to up this because this can be really slow on some boards.
|
|
|
|
# (malloc() is called as part of the test).
|
* gdb.base/call-strs.exp, gdb.base/default.exp,
gdb.base/ending-run.exp, gdb.base/finish.exp, gdb.base/funcargs.exp,
gdb.base/huge.exp, gdb.base/nodebug.exp, gdb.base/ptype.exp,
gdb.base/restore.exp, gdb.base/return.exp, gdb.base/setvar.exp,
gdb.base/watchpoints.exp, gdb.threads/gcore-thread.exp,
gdb.base/watchpoint-solib.exp: Save and restore timeout.
* gdb.base/ending-run.exp: Correct restore of timeout.
* gdb.base/page.exp: Remove unnecessary timeout setting.
2010-01-29 15:38:38 +00:00
|
|
|
set prev_timeout $timeout
|
|
|
|
set timeout 60
|
1999-04-16 01:35:26 +00:00
|
|
|
|
1999-12-14 01:06:04 +00:00
|
|
|
# Change the values
|
|
|
|
test_set "set variable v_struct1 = {32, 33, 34, 35, 36, 37}" \
|
|
|
|
"print v_struct1" \
|
2000-12-20 16:29:27 +00:00
|
|
|
".*.\[0-9\]* = \\{.*v_char_member = 32 \' \',.*v_short_member = 33,\
|
1999-12-14 01:06:04 +00:00
|
|
|
.*v_int_member = 34,.*\
|
2000-12-20 16:29:27 +00:00
|
|
|
v_long_member = 35,.*v_float_member = 36,.*v_double_member = 37.*\\}" \
|
1999-12-14 01:06:04 +00:00
|
|
|
"set print structure #2"
|
|
|
|
|
|
|
|
# Change them back
|
|
|
|
test_set "set variable v_struct1 = {'h', 1, 2, 3, 4.0, 5.0}" \
|
|
|
|
"print v_struct1" \
|
2000-12-20 16:29:27 +00:00
|
|
|
".*.\[0-9\]* = \\{.*v_char_member = 104 \'h\',.*v_short_member = 1,\
|
1999-04-16 01:35:26 +00:00
|
|
|
.*v_int_member = 2,.*\
|
2000-12-20 16:29:27 +00:00
|
|
|
v_long_member = 3,.*v_float_member = 4,.*v_double_member = 5.*\\}" \
|
1999-12-14 01:06:04 +00:00
|
|
|
"set print structure #3"
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2012-11-02 00:14:39 +00:00
|
|
|
#
|
|
|
|
# test "set variable" for nested struct
|
|
|
|
#
|
|
|
|
test_set "set variable v_struct3 = {1, {'h', 1, 2, 3, 4.0, 5.0}, 37}" \
|
|
|
|
"print v_struct3" \
|
|
|
|
".*.\[0-9\]* = \\{.*v_long_member = 1,.*t = \\{.*v_char_member = 104 \'h\',.*v_short_member = 1,.*v_int_member = 2,.*v_long_member = 3,.*v_float_member = 4,.*v_double_member = 5.*\\},.*v_char_member = 37 \'%\'\\}" \
|
|
|
|
"set print structure #4"
|
|
|
|
|
* gdb.base/call-strs.exp, gdb.base/default.exp,
gdb.base/ending-run.exp, gdb.base/finish.exp, gdb.base/funcargs.exp,
gdb.base/huge.exp, gdb.base/nodebug.exp, gdb.base/ptype.exp,
gdb.base/restore.exp, gdb.base/return.exp, gdb.base/setvar.exp,
gdb.base/watchpoints.exp, gdb.threads/gcore-thread.exp,
gdb.base/watchpoint-solib.exp: Save and restore timeout.
* gdb.base/ending-run.exp: Correct restore of timeout.
* gdb.base/page.exp: Remove unnecessary timeout setting.
2010-01-29 15:38:38 +00:00
|
|
|
set timeout $prev_timeout
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
# Test printing of enumeration bitfields.
|
|
|
|
# GNU C supports them, some other compilers don't.
|
|
|
|
|
|
|
|
if {$gcc_compiled} then {
|
|
|
|
gdb_test "print sef.field=sm1" ".*.\[0-9\]* = sm1"
|
|
|
|
gdb_test "print sef.field" ".*.\[0-9\]* = sm1" "print sef.field (sm1)"
|
|
|
|
gdb_test "print sef.field=s1" ".*.\[0-9\]* = s1"
|
|
|
|
gdb_test "print sef.field" ".*.\[0-9\]* = s1" "print sef.field (s1)"
|
|
|
|
gdb_test "print uef.field=u2" ".*.\[0-9\]* = u2"
|
|
|
|
gdb_test "print uef.field" ".*.\[0-9\]* = u2" "print uef.field (u2)"
|
|
|
|
gdb_test "print uef.field=u1" ".*.\[0-9\]* = u1"
|
|
|
|
gdb_test "print uef.field" ".*.\[0-9\]* = u1" "print uef.field (u1)"
|
|
|
|
|
|
|
|
# Test for truncation when assigning invalid values to bitfields.
|
|
|
|
gdb_test "print sef.field=7" \
|
|
|
|
".*warning: Value does not fit in 2 bits.*\[0-9\]* = sm1"
|
|
|
|
gdb_test "print uef.field=6" \
|
|
|
|
".*warning: Value does not fit in 2 bits.*\[0-9\]* = u2"
|
|
|
|
}
|