diff options
author | Yao Qi <yao@codesourcery.com> | 2013-03-15 01:41:29 +0000 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2013-03-15 01:41:29 +0000 |
commit | 0a251e08fa4e7130f05462ecc9f60e6683cdefca (patch) | |
tree | c79ccfc1f502d7e7d48c54b67720381603201b98 /gdb/testsuite/gdb.base/break-interp.exp | |
parent | 2c415c0f382fd6361d9d702ebdd71cd6d6a06d19 (diff) | |
download | binutils-gdb-0a251e08fa4e7130f05462ecc9f60e6683cdefca.tar.gz |
gdb/testsuite/
* gdb.threads/non-ldr-exc-1.exp (do_test): Fix the indent of
using with_test_prefix.
* gdb.threads/non-ldr-exc-2.exp (do_test): Likewise.
* gdb.threads/non-ldr-exc-3.exp (do_test): Likewise.
* gdb.threads/non-ldr-exc-4.exp (do_test): Likewise.
* gdb.threads/watchpoint-fork.exp (test): Likewise.
* gdb.base/break-interp.exp (test_core): Likewise.
(test_attach_gdb): Likewise.
* gdb.base/catch-load.exp (one_catch_load_test): Likewise.
* gdb.base/disp-step-syscall.exp (disp_step_cross_syscall):
Likewise.
* gdb.base/jit-so.exp (one_jit_test): Likewise.
* gdb.base/jit.exp (one_jit_test): Likewise.
* gdb.base/sepdebug.exp (test_different_dir): Likewise.
* gdb.dwarf2/dw2-dir-file-name.exp (test): Likewise.
* gdb.dwarf2/dw2-noloc.exp (file_symbols): Likewise.
* gdb.mi/mi-breakpoint-changed.exp (test_pending_resolved):
Likewise.
* gdb.mi/mi-cmd-param-changed.exp (test_command_param_changed):
Likewise.
* gdb.mi/mi-watch.exp test_watchpoint_all): Likewise.
* gdb.mi/pr11022.exp (test_memory_changed_observer): Likewise.
* gdb.trace/change-loc.exp (tracepoint_change_loc_1): Likewise.
(tracepoint_change_loc_2): Likewise.
* gdb.trace/disconnected-tracing.exp (disconnected_tracing):
Likewise.
(disconnected_tfind): Likewise.
* gdb.trace/mi-traceframe-changed.exp (test_tfind_tfile):
Likewise.
(test_tfind_remote): Likewise.
* gdb.trace/mi-tracepoint-changed.exp (test_reconnect):
Likewise.
(test_pending_resolved): Likewise.
* gdb.trace/mi-tsv-changed.exp (test_create_delete_modify_tsv):
Likewise.
(test_upload_tsv): Likewise.
* gdb.trace/pending.exp (pending_tracepoint_resolved):
Likewise.
(pending_tracepoint_works): Likewise.
* gdb.trace/report.exp (use_collected_data): Likewise.
* gdb.trace/status-stop.exp (test_tstart_tstop_tstart):
Likewise.
(test_tstart_tstart, test_buffer_full_tstart): Likewise.
* gdb.trace/strace.exp (strace_info_marker): Likewise.
(strace_trace_on_same_addr): Likewise.
(strace_trace_on_diff_addr): Likewise.
* gdb.trace/unavailable.exp (gdb_collect_args_test): Likewise.
(gdb_collect_locals_test): Likewise.
(gdb_unavailable_registers_test): Likewise.
(gdb_collect_globals_test): Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.base/break-interp.exp')
-rw-r--r-- | gdb/testsuite/gdb.base/break-interp.exp | 156 |
1 files changed, 80 insertions, 76 deletions
diff --git a/gdb/testsuite/gdb.base/break-interp.exp b/gdb/testsuite/gdb.base/break-interp.exp index 7a8a1f6ce15..1010afa415a 100644 --- a/gdb/testsuite/gdb.base/break-interp.exp +++ b/gdb/testsuite/gdb.base/break-interp.exp @@ -190,103 +190,107 @@ proc reach {func command displacement} { } } -proc test_core {file displacement} { with_test_prefix "core" { - global srcdir subdir gdb_prompt expect_out +proc test_core {file displacement} { + with_test_prefix "core" { + global srcdir subdir gdb_prompt expect_out - set corefile [core_find $file {} "segv"] - if {$corefile == ""} { - return - } + set corefile [core_find $file {} "segv"] + if {$corefile == ""} { + return + } - gdb_exit - gdb_start - # Clear it to never find any separate debug infos in $debug_root. - gdb_test_no_output "set debug-file-directory" \ - "set debug-file-directory for core" - gdb_reinitialize_dir $srcdir/$subdir - gdb_load $file + gdb_exit + gdb_start + # Clear it to never find any separate debug infos in $debug_root. + gdb_test_no_output "set debug-file-directory" \ + "set debug-file-directory for core" + gdb_reinitialize_dir $srcdir/$subdir + gdb_load $file - # Print the "PIE (Position Independent Executable) displacement" message. - gdb_test_no_output "set verbose on" + # Print the "PIE (Position Independent Executable) displacement" message. + gdb_test_no_output "set verbose on" - set test "core loaded" - set test_displacement "seen displacement message as $displacement" - gdb_test_multiple "core-file $corefile" $test { - -re "Using PIE \\(Position Independent Executable\\) displacement (0x\[0-9a-f\]+) " { - # Missing "$gdb_prompt $" is intentional. - if {$expect_out(1,string) == "0x0"} { - set case "ZERO" - } else { - set case "NONZERO" + set test "core loaded" + set test_displacement "seen displacement message as $displacement" + gdb_test_multiple "core-file $corefile" $test { + -re "Using PIE \\(Position Independent Executable\\) displacement (0x\[0-9a-f\]+) " { + # Missing "$gdb_prompt $" is intentional. + if {$expect_out(1,string) == "0x0"} { + set case "ZERO" + } else { + set case "NONZERO" + } + if {$displacement == $case || $displacement == "PRESENT"} { + pass $test_displacement + set displacement "FOUND-$displacement" + } else { + fail $test_displacement + } + exp_continue } - if {$displacement == $case || $displacement == "PRESENT"} { - pass $test_displacement - set displacement "FOUND-$displacement" - } else { - fail $test_displacement + -re "Core was generated by .*\r\n#0 .*$gdb_prompt $" { + # Do not check the binary filename as it may be truncated. + pass $test } - exp_continue } - -re "Core was generated by .*\r\n#0 .*$gdb_prompt $" { - # Do not check the binary filename as it may be truncated. - pass $test + if ![regexp {^(NONE|FOUND-.*)$} $displacement] { + fail $test_displacement } + + gdb_test "bt" "#\[0-9\]+ +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#\[0-9\]+ +\[^\r\n\]*\\mmain\\M.*" "core main bt" } - if ![regexp {^(NONE|FOUND-.*)$} $displacement] { - fail $test_displacement - } +} - gdb_test "bt" "#\[0-9\]+ +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#\[0-9\]+ +\[^\r\n\]*\\mmain\\M.*" "core main bt" -}} +proc test_attach_gdb {file pid displacement prefix} { + with_test_prefix "$prefix" { + global gdb_prompt expect_out -proc test_attach_gdb {file pid displacement prefix} { with_test_prefix "$prefix" { - global gdb_prompt expect_out - - gdb_exit - gdb_start + gdb_exit + gdb_start - # Print the "PIE (Position Independent Executable) displacement" message. - gdb_test_no_output "set verbose on" + # Print the "PIE (Position Independent Executable) displacement" message. + gdb_test_no_output "set verbose on" - gdb_test "file $file" "Reading symbols from .*done\\." "file" + gdb_test "file $file" "Reading symbols from .*done\\." "file" - set test "attach" - gdb_test_multiple "attach $pid" $test { - -re "Attaching to (program: .*, )?process $pid\r\n" { - # Missing "$gdb_prompt $" is intentional. - pass $test + set test "attach" + gdb_test_multiple "attach $pid" $test { + -re "Attaching to (program: .*, )?process $pid\r\n" { + # Missing "$gdb_prompt $" is intentional. + pass $test + } } - } - set test "attach final prompt" - set test_displacement "seen displacement message as $displacement" - gdb_test_multiple "" $test { - -re "Using PIE \\(Position Independent Executable\\) displacement (0x\[0-9a-f\]+) " { - # Missing "$gdb_prompt $" is intentional. - if {$expect_out(1,string) == "0x0"} { - set case "ZERO" - } else { - set case "NONZERO" + set test "attach final prompt" + set test_displacement "seen displacement message as $displacement" + gdb_test_multiple "" $test { + -re "Using PIE \\(Position Independent Executable\\) displacement (0x\[0-9a-f\]+) " { + # Missing "$gdb_prompt $" is intentional. + if {$expect_out(1,string) == "0x0"} { + set case "ZERO" + } else { + set case "NONZERO" + } + if {$displacement == $case || $displacement == "PRESENT"} { + pass $test_displacement + set displacement "FOUND-$displacement" + } else { + fail $test_displacement + } + exp_continue } - if {$displacement == $case || $displacement == "PRESENT"} { - pass $test_displacement - set displacement "FOUND-$displacement" - } else { - fail $test_displacement + -re "$gdb_prompt $" { + pass $test } - exp_continue } - -re "$gdb_prompt $" { - pass $test + if ![regexp {^(NONE|FOUND-.*)$} $displacement] { + fail $test_displacement } - } - if ![regexp {^(NONE|FOUND-.*)$} $displacement] { - fail $test_displacement - } - gdb_test "bt" "#\[0-9\]+ +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#\[0-9\]+ +\[^\r\n\]*\\mmain\\M.*" "attach main bt" - gdb_exit -}} + gdb_test "bt" "#\[0-9\]+ +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#\[0-9\]+ +\[^\r\n\]*\\mmain\\M.*" "attach main bt" + gdb_exit + } +} proc test_attach {file displacement {relink_args ""}} { global board_info |