# Trying to set the catchpoint
set thistest "catch syscall with arguments, $syscall"
- gdb_test "catch syscall $syscall" "Catchpoint $decimal \\(syscall \'?${syscall}\'?( \[${decimal}\])?\\)" $thistest
+ gdb_test "catch syscall $syscall" \
+ [subst_vars \
+ {Catchpoint $decimal \(syscall '?$syscall'?( \[$decimal\])?\)}] \
+ $thistest
check_info_bp_specific_syscall $syscall
}
[multi_line \
"Dcache $decimal lines of $decimal bytes each." \
"Contains data for (process $decimal|Thread \[^\r\n\]*)" \
- "Line 0: address $hex \[$decimal hits\].*" \
+ [subst_vars {Line 0: address $hex \[$decimal hits\].*}] \
"Cache state: $decimal active lines, $decimal hits" ] \
"check dcache before flushing"
[multi_line \
"Dcache $decimal lines of $decimal bytes each." \
"Contains data for (process $decimal|Thread \[^\r\n\]*)" \
- "Line 0: address $hex \[$decimal hits\].*" \
+ [subst_vars {Line 0: address $hex \[$decimal hits\].*}] \
"Cache state: $decimal active lines, $decimal hits" ] \
"check dcache before refilling"
"End with.*" \
"detach in commands"
-gdb_test "run" "\[Inferior $decimal \\(\[^\r\n\]*\\) detached\]" \
+gdb_test "run" \
+ [subst_vars {\[Inferior $decimal \([^\r\n]*\) detached\]}] \
"run - detach"
# Test kill in breakpoint commands.
"End with.*" \
"kill in commands"
-gdb_test "run" "\[Inferior $decimal \\(\[^\r\n\]*\\) killed\]" \
+gdb_test "run" \
+ [subst_vars {\[Inferior $decimal \([^\r\n]*\) killed\]}] \
"run - kill"
gdb_test "break main if callexit()" "Breakpoint $decimal at .*"
gdb_test "run" \
- "\[Inferior $decimal \\(\[^\r\n\]*\\) exited normally\].*
-Error in testing condition for breakpoint $decimal:.*
-The program being debugged exited while in a function called from GDB\\..*
-Evaluation of the expression containing the function.*
-\\(callexit\\) will be abandoned\\..*
-No registers\\."
+ [multi_line \
+ [subst_vars {\[Inferior $decimal \([^\r\n]*\) exited normally\]}] \
+ "Error in testing condition for breakpoint $decimal:" \
+ [string_to_regexp \
+ "The program being debugged exited while in a function called from GDB."] \
+ "Evaluation of the expression containing the function" \
+ [string_to_regexp "(callexit) will be abandoned."] \
+ [string_to_regexp "No registers."]]
-re "Continuing\.\r\n" {
exp_continue
}
- -re "\[New inferior $decimal \\(process $decimal\\)\]\r\n" {
+ -re "\\\[New inferior $decimal \\(process $decimal\\)\\\]\r\n" {
exp_continue
}
-re -wrap "Breakpoint .* main .*exit.*" {
delete_breakpoints
gdb_test "with confirm off -- run" \
- "\[Inferior $decimal \\(\[^\r\n\]*\\) exited normally\]" \
+ [subst_vars {\[Inferior $decimal \([^\r\n]*\) exited normally\]}] \
"run without breakpoint"
set bp_location [gdb_get_line_number "result = solib_main"]
gdb_test "continue" "Breakpoint.*handle_TERM.*" "send signal TERM"
with_timeout_factor 2 {
- gdb_test "continue" "\[process ${::decimal} .*" "continue to signal exit" \
+ gdb_test "continue" "Process record: inferior program stopped.*" \
+ "continue to signal exit" \
"The next instruction is syscall exit_group.* program...y. or n. " \
"yes"
}
gdb_test "detach" "Detaching from .*, process $decimal\r\n\\\[Inferior $decimal \\(.*\\) detached\\\]" \
"detach child"
- gdb_test "inferior 1" "\[Switching to inferior $decimal\].*" \
+ gdb_test "inferior 1" \
+ [subst_vars {\[Switching to inferior $decimal .*}] \
"switch to parent"
if {$cmd == "detach"} {
# Move the threads and hit the watchpoints TRIGGERS times.
for { set i 1 } { $i <= $TRIGGERS } { incr i } {
- gdb_test continue "Continuing\\..*Hardware watchpoint ${::decimal}: watched_data\[${::decimal}\].*Old value = ${::decimal}.*New value = ${::decimal}.*thread_function \\(arg=$hex\\) at .*$srcfile.*" \
+ gdb_test continue \
+ "Continuing\\..*Hardware watchpoint ${::decimal}: watched_data\\\[${::decimal}\\\].*Old value = ${::decimal}.*New value = ${::decimal}.*thread_function \\(arg=$hex\\) at .*$srcfile.*" \
"Continue to watchpoint trigger $i out of ${TRIGGERS} on watched_data"
}
}
# Add "convience abbreviation" for positive decimals, without leading zeros.
-set positive {[1-9][0-9]*}
+set positive {(?:[1-9][0-9]*)}
+
+# Dejagnu defines decimal as one of the "convenience abbreviations".
+# Override it with one that uses parentheses, which flushes incorrect uses
+# like "\[Inferior $decimal\]".
+set decimal {(?:[0-9]+)}
+
+# Dejagnu defines hex as one of the "convenience abbreviations".
+# Override it with one that uses parentheses.
+set hex {(?:0x[0-9A-Fa-f]+)}
# Execute BODY, if COND wrapped in proc WRAP.
# Instead of writing the verbose and repetitive:
set EXEEXT $env(EXEEXT)
}
-set octal "\[0-7\]+"
+set octal {(?:[0-7]+)}
set inferior_exited_re "(?:\\\[Inferior ${::decimal} \\(\[^\n\r\]*\\) exited)"