diff options
author | Andrew Burgess <aburgess@redhat.com> | 2023-08-22 18:11:11 +0100 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2023-08-23 09:07:35 +0100 |
commit | adc5f8b99a9d1ec96b5bf2492ad5516db580839a (patch) | |
tree | 90482fba2de4c8806bd74c5a32c1f0fac59e8fad /gdb | |
parent | f29ab2e0e350a4b382a1e4eb1b41c28564d83e94 (diff) | |
download | binutils-adc5f8b99a9d1ec96b5bf2492ad5516db580839a.zip binutils-adc5f8b99a9d1ec96b5bf2492ad5516db580839a.tar.gz binutils-adc5f8b99a9d1ec96b5bf2492ad5516db580839a.tar.bz2 |
gdb/testsuite: improve MI support for inferior specific breakpoints
In this commit:
commit b080fe54fb3414b488b8ef323c6c50def061f918
Date: Tue Nov 8 12:32:51 2022 +0000
gdb: add inferior-specific breakpoints
limited support was added in lib/mi-support.exp to help with testing
of inferior specific breakpoints.
Though the changes that were added were not wrong, while working on a
later patch, I realised that I had added the support in the wrong
place -- I only added support to mi_make_breakpoint_multi, when really
I should have added the support to mi_make_breakpoint_1, which is used
by all of the MI procs that create breakpoints.
This commit moves the support to mi_make_breakpoint_1, and updates all
the procs that use mi_make_breakpoint_1 to accept, and then pass
through, and (optional) inferior argument. This will make it much
easier to write MI tests for inferior specific breakpoints.
There's no change in what is tested after this commit.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/lib/mi-support.exp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index 3cd94b0..c9af88b 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -2578,8 +2578,8 @@ proc mi_make_breakpoint_loc {args} { # Bits shared between mi_make_breakpoint and mi_make_breakpoint_multi. -proc mi_make_breakpoint_1 {attr_list thread cond evaluated-by times \ - ignore script original-location} { +proc mi_make_breakpoint_1 {attr_list thread inferior cond evaluated-by \ + times ignore script original-location} { set result "bkpt=\\\{[mi_build_kv_pairs $attr_list]" # There are always exceptions. @@ -2590,6 +2590,12 @@ proc mi_make_breakpoint_1 {attr_list thread cond evaluated-by times \ append result [mi_build_kv_pairs [list "thread" $thread]] } + # If INFERIOR is not present, do not output it. + if {[string length $inferior] > 0} { + append result "," + append result [mi_build_kv_pairs [list "inferior" $inferior]] + } + # If COND is not present, do not output it. if {[string length $cond] > 0} { append result "," @@ -2667,15 +2673,9 @@ proc mi_make_breakpoint_multi {args} { lappend attr_list "addr" "<MULTIPLE>" - # Only include the inferior field if it was set. This field is - # optional in the MI output. - if {$inferior ne ""} { - lappend attr_list "inferior" $inferior - } - set result [mi_make_breakpoint_1 \ - $attr_list $thread $cond ${evaluated-by} $times \ - $ignore $script ${original-location}] + $attr_list $thread $inferior $cond ${evaluated-by} \ + $times $ignore $script ${original-location}] append result "," append result [mi_build_kv_pairs [list "locations" $locations]] @@ -2703,8 +2703,8 @@ proc mi_make_breakpoint_multi {args} { proc mi_make_breakpoint_pending {args} { parse_args {{number .*} {type .*} {disp .*} {enabled .*} - {pending .*} {original-location .*} {thread ""} {cond ""} - {script ""} {times .*}} + {pending .*} {original-location .*} {thread ""} {inferior ""} + {cond ""} {script ""} {times .*}} set attr_list {} foreach attr [list number type disp enabled] { @@ -2721,8 +2721,8 @@ proc mi_make_breakpoint_pending {args} { set evaluated-by "" set result [mi_make_breakpoint_1 \ - $attr_list $thread $cond ${evaluated-by} $times \ - $ignore $script ${original-location}] + $attr_list $thread $inferior $cond ${evaluated-by} \ + $times $ignore $script ${original-location}] append result "\\\}" return $result @@ -2750,7 +2750,7 @@ proc mi_make_breakpoint {args} { {func .*} {file .*} {fullname .*} {line .*} {thread-groups \\\[.*\\\]} {times .*} {ignore 0} {script ""} {original-location .*} {cond ""} {evaluated-by ""} - {thread ""}} + {thread ""} {inferior ""}} set attr_list {} foreach attr [list number type disp enabled addr func file \ @@ -2759,8 +2759,8 @@ proc mi_make_breakpoint {args} { } set result [mi_make_breakpoint_1 \ - $attr_list $thread $cond ${evaluated-by} $times \ - $ignore $script ${original-location}] + $attr_list $thread $inferior $cond ${evaluated-by} \ + $times $ignore $script ${original-location}] append result "\\\}" return $result |