mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-23 19:50:13 +08:00
Introduce mi_runto_main
This adds an mi_runto_main routine, very much like the runto_main CLI counterpart. Note there's already a mi_run_to_main (extra underscore in "run_to"), but unlike its intro comment says, that does more than the CLI's runto_main -- it also starts GDB. I would like to eliminate that other one by introducing a mi_clean_restart function instead. That is done later in the series. gdb/testsuite/ChangeLog: * lib/mi-support.exp (mi_runto_main): New proc. (mi_run_to_main): Use it. * gdb.mi/mi-catch-cpp-exceptions.exp: Likewise. * gdb.mi/mi-var-cmd.exp: Likewise. * gdb.mi/mi-var-invalidate.exp: Likewise. * mi-var-list-children-invalid-grandchild.exp: Likewise. * gdb.mi/mi2-amd64-entry-value.exp: Likewise. * gdb.mi/new-ui-mi-sync.exp: Likewise. * gdb.mi/user-selected-context-sync.exp: Likewise. * gdb.opt/inline-cmds.exp: Likewise. * gdb.python/py-framefilter-mi.exp: Likewise. * gdb.python/py-mi.exp: Likewise. Change-Id: I2e49ca7b0b61cea57c1202e5dfa32417e6a4403d
This commit is contained in:
@ -1,3 +1,18 @@
|
||||
2020-10-13 Pedro Alves <pedro@palves.net>
|
||||
|
||||
* lib/mi-support.exp (mi_runto_main): New proc.
|
||||
(mi_run_to_main): Use it.
|
||||
* gdb.mi/mi-catch-cpp-exceptions.exp: Likewise.
|
||||
* gdb.mi/mi-var-cmd.exp: Likewise.
|
||||
* gdb.mi/mi-var-invalidate.exp: Likewise.
|
||||
* mi-var-list-children-invalid-grandchild.exp: Likewise.
|
||||
* gdb.mi/mi2-amd64-entry-value.exp: Likewise.
|
||||
* gdb.mi/new-ui-mi-sync.exp: Likewise.
|
||||
* gdb.mi/user-selected-context-sync.exp: Likewise.
|
||||
* gdb.opt/inline-cmds.exp: Likewise.
|
||||
* gdb.python/py-framefilter-mi.exp: Likewise.
|
||||
* gdb.python/py-mi.exp: Likewise.
|
||||
|
||||
2020-10-13 Pedro Alves <pedro@palves.net>
|
||||
|
||||
* gdb.ada/fun_in_declare.exp: Use "runto_main" instead of
|
||||
|
@ -59,7 +59,7 @@ proc restart_for_test {} {
|
||||
mi_gdb_reinitialize_dir $srcdir/$subdir
|
||||
mi_gdb_load ${binfile}
|
||||
|
||||
mi_runto main
|
||||
mi_runto_main
|
||||
|
||||
mi_create_breakpoint \
|
||||
"$srcfile:${main_lineno}" "break before exiting program" \
|
||||
|
@ -657,7 +657,7 @@ with_test_prefix "second run" {
|
||||
mi_create_varobj "L" "lsimple" "in-and-out-of-scope: create varobj"
|
||||
mi_check_varobj_value "L" "{...}" "in-and-out-of-scope: check initial value"
|
||||
|
||||
mi_runto main
|
||||
mi_runto_main
|
||||
|
||||
mi_gdb_test "-var-update L" \
|
||||
{\^done,changelist=\[{name="L",in_scope="false",type_changed="false",has_more="0"}\]} \
|
||||
|
@ -70,7 +70,7 @@ mi_create_floating_varobj float_simple array "create floating variable"
|
||||
#
|
||||
mi_delete_breakpoints
|
||||
mi_gdb_load ${binfile_bis}
|
||||
mi_runto main
|
||||
mi_runto_main
|
||||
|
||||
# Change format of floating variable immediately after reload reveals a
|
||||
# bug where gdb still uses a free'd pointer.
|
||||
|
@ -43,7 +43,7 @@ mi_gdb_test "-interpreter-exec console \"set print object on\"" \
|
||||
"(.*=cmd-param-changed,param=\"print object\",value=\"on\".*|)\\^done" \
|
||||
"set print object on"
|
||||
|
||||
mi_runto main
|
||||
mi_runto_main
|
||||
|
||||
mi_continue_to_line $line_invalid_pointer_value "continue to invalid pointer value"
|
||||
|
||||
|
@ -49,7 +49,7 @@ foreach name {different breakhere_different breakhere_validity breakhere_invalid
|
||||
|
||||
# Test various kinds of `set print entry-values'.
|
||||
|
||||
if {[mi_runto main] == -1} {
|
||||
if {[mi_runto_main] == -1} {
|
||||
return -1
|
||||
}
|
||||
mi_gdb_test "-gdb-set print entry-values no" {\^done} "no: set print entry-values"
|
||||
@ -66,7 +66,7 @@ mi_send_resuming_command "exec-continue" "no: invalid: continue"
|
||||
mi_expect_stop "breakpoint-hit" .* {{name="inv",value="<optimized out>"}} .* .* {.* disp="keep"} "no: invalid: stop"
|
||||
mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value="<optimized out>"}\]} "no: invalid: -stack-list-variables"
|
||||
|
||||
if {[mi_runto main] == -1} {
|
||||
if {[mi_runto_main] == -1} {
|
||||
return -1
|
||||
}
|
||||
mi_gdb_test "-gdb-set print entry-values only" {\^done} "only: set print entry-values"
|
||||
@ -83,7 +83,7 @@ mi_send_resuming_command "exec-continue" "only: invalid: continue"
|
||||
mi_expect_stop "breakpoint-hit" .* {{name="inv@entry",value="<optimized out>"}} .* .* {.* disp="keep"} "only: invalid: stop"
|
||||
mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv@entry",arg="1",value="<optimized out>"}\]} "only: invalid: -stack-list-variables"
|
||||
|
||||
if {[mi_runto main] == -1} {
|
||||
if {[mi_runto_main] == -1} {
|
||||
return -1
|
||||
}
|
||||
mi_gdb_test "-gdb-set print entry-values preferred" {\^done} "preferred: set print entry-values"
|
||||
@ -100,7 +100,7 @@ mi_send_resuming_command "exec-continue" "preferred: invalid: continue"
|
||||
mi_expect_stop "breakpoint-hit" .* {{name="inv@entry",value="<optimized out>"}} .* .* {.* disp="keep"} "preferred: invalid: stop"
|
||||
mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv@entry",arg="1",value="<optimized out>"}\]} "preferred: invalid: -stack-list-variables"
|
||||
|
||||
if {[mi_runto main] == -1} {
|
||||
if {[mi_runto_main] == -1} {
|
||||
return -1
|
||||
}
|
||||
mi_gdb_test "-gdb-set print entry-values if-needed" {\^done} "if-needed: set print entry-values"
|
||||
@ -117,7 +117,7 @@ mi_send_resuming_command "exec-continue" "if-needed: invalid: continue"
|
||||
mi_expect_stop "breakpoint-hit" .* {{name="inv",value="<optimized out>"}} .* .* {.* disp="keep"} "if-needed: invalid: stop"
|
||||
mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value="<optimized out>"}\]} "if-needed: invalid: -stack-list-variables"
|
||||
|
||||
if {[mi_runto main] == -1} {
|
||||
if {[mi_runto_main] == -1} {
|
||||
return -1
|
||||
}
|
||||
mi_gdb_test "-gdb-set print entry-values both" {\^done} "both: set print entry-values"
|
||||
@ -134,7 +134,7 @@ mi_send_resuming_command "exec-continue" "both: invalid: continue"
|
||||
mi_expect_stop "breakpoint-hit" .* {{name="inv",value="<optimized out>"},{name="inv@entry",value="<optimized out>"}} .* .* {.* disp="keep"} "both: invalid: stop"
|
||||
mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value="<optimized out>"},{name="inv@entry",arg="1",value="<optimized out>"}\]} "both: invalid: -stack-list-variables"
|
||||
|
||||
if {[mi_runto main] == -1} {
|
||||
if {[mi_runto_main] == -1} {
|
||||
return -1
|
||||
}
|
||||
mi_gdb_test "-gdb-set print entry-values compact" {\^done} "compact: set print entry-values"
|
||||
@ -151,7 +151,7 @@ mi_send_resuming_command "exec-continue" "compact: invalid: continue"
|
||||
mi_expect_stop "breakpoint-hit" .* {{name="inv",value="<optimized out>"}} .* .* {.* disp="keep"} "compact: invalid: stop"
|
||||
mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value="<optimized out>"}\]} "compact: invalid: -stack-list-variables"
|
||||
|
||||
if {[mi_runto main] == -1} {
|
||||
if {[mi_runto_main] == -1} {
|
||||
return -1
|
||||
}
|
||||
mi_gdb_test "-gdb-set print entry-values default" {\^done} "default: set print entry-values"
|
||||
|
@ -63,7 +63,7 @@ proc do_test {sync_command} {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if {[mi_runto main] < 0} {
|
||||
if {[mi_runto_main] < 0} {
|
||||
return
|
||||
}
|
||||
if {[mi_send_resuming_command_raw "123-exec-continue" $test] >= 0} {
|
||||
|
@ -401,7 +401,7 @@ proc_with_prefix test_setup { mode } {
|
||||
mi_gdb_reinitialize_dir $srcdir/$subdir
|
||||
mi_gdb_load $binfile
|
||||
|
||||
if { [mi_runto main] < 0 } {
|
||||
if { [mi_runto_main] < 0 } {
|
||||
fail "can't run to main"
|
||||
return
|
||||
}
|
||||
|
@ -355,7 +355,7 @@ with_test_prefix "mi" {
|
||||
continue
|
||||
}
|
||||
mi_gdb_load ${binfile}
|
||||
mi_runto main
|
||||
mi_runto_main
|
||||
|
||||
set line_number [gdb_get_line_number "set mi break here"]
|
||||
mi_gdb_test "-break-insert ${srcfile}:${line_number}" \
|
||||
|
@ -42,7 +42,7 @@ if {[lsearch -exact [mi_get_features] python] < 0} {
|
||||
return -1
|
||||
}
|
||||
|
||||
mi_runto main
|
||||
mi_runto_main
|
||||
|
||||
set remote_python_file [gdb_remote_download host ${srcdir}/${subdir}/${pyfile}]
|
||||
|
||||
|
@ -40,7 +40,7 @@ if {[lsearch -exact [mi_get_features] python] < 0} {
|
||||
return -1
|
||||
}
|
||||
|
||||
mi_runto main
|
||||
mi_runto_main
|
||||
|
||||
set remote_python_file [gdb_remote_download host ${srcdir}/${subdir}/${pyfile}]
|
||||
|
||||
@ -347,7 +347,7 @@ if {[lsearch -exact [mi_get_features] python] < 0} {
|
||||
return -1
|
||||
}
|
||||
|
||||
mi_runto main
|
||||
mi_runto_main
|
||||
mi_continue_to_line \
|
||||
[gdb_get_line_number {break to inspect struct and union} ${srcfile}] \
|
||||
"step to breakpoint"
|
||||
|
@ -1042,7 +1042,7 @@ proc mi_run_to_main { } {
|
||||
mi_gdb_reinitialize_dir $srcdir/$subdir
|
||||
mi_gdb_load ${binfile}
|
||||
|
||||
mi_runto main
|
||||
mi_runto_main
|
||||
}
|
||||
|
||||
|
||||
@ -1086,6 +1086,12 @@ proc mi_runto {func} {
|
||||
return [mi_runto_helper $func "run"]
|
||||
}
|
||||
|
||||
# Just like runto_main but works with the MI interface.
|
||||
|
||||
proc mi_runto_main {} {
|
||||
return [mi_runto_helper "main" "run"]
|
||||
}
|
||||
|
||||
# Next to the next statement
|
||||
# For return values, see mi_execute_to_helper
|
||||
|
||||
|
Reference in New Issue
Block a user