diff options
author | Tom de Vries <tdevries@suse.de> | 2023-03-24 10:45:37 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2023-03-24 10:45:37 +0100 |
commit | c569a946f6925d3f210c3eaf74dcda56843350ef (patch) | |
tree | 810910c33bbc22a669a7d72df325cc48f0923e1a /gdb/testsuite/gdb.ada/mi_ex_cond.exp | |
parent | 1985d8cb7048bcfce60b59cfe219d3b09bda6373 (diff) | |
download | gdb-c569a946f6925d3f210c3eaf74dcda56843350ef.zip gdb-c569a946f6925d3f210c3eaf74dcda56843350ef.tar.gz gdb-c569a946f6925d3f210c3eaf74dcda56843350ef.tar.bz2 |
[gdb/testsuite] Fix unbalanced quotes in mi_expect_stop argument
In proc mi_expect_stop there's a proc argument reason that's handled like so:
...
set r "reason=\"$reason\","
...
That's fine for say:
...
set reason "foo"
...
for which this evaluates to:
...
set r "reason=\"foo\","
...
But there are more complex uses, for instance:
...
set reason "breakpoint-hit\",disp=\"keep\",bkptno=\"$decimal"
...
which evaluates to:
...
set r "\"breakpoint-hit\",disp=\"keep\",bkptno=\"$decimal\""
...
Note how in this reason argument, the first two '\"' seems to form a pair
surrounding ',disp=', which is not the case, which is confusing.
Fix this by only adding the quotes in mi_expect_stop if the string doesn't
already contain quotes, such that we have the more readable:
...
set reason "\"breakpoint-hit\",disp=\"keep\",bkptno=\"$decimal\""
...
Tested on x86_64-linux.
Diffstat (limited to 'gdb/testsuite/gdb.ada/mi_ex_cond.exp')
-rw-r--r-- | gdb/testsuite/gdb.ada/mi_ex_cond.exp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.ada/mi_ex_cond.exp b/gdb/testsuite/gdb.ada/mi_ex_cond.exp index f41b633..54aa6b5 100644 --- a/gdb/testsuite/gdb.ada/mi_ex_cond.exp +++ b/gdb/testsuite/gdb.ada/mi_ex_cond.exp @@ -77,7 +77,7 @@ mi_gdb_test "-catch-exception -c \"i = 2\" -e constraint_error" \ mi_run_cmd mi_expect_stop \ - "breakpoint-hit\",disp=\"keep\",bkptno=\"$any_nb\",exception-name=\"CONSTRAINT_ERROR(\",exception-message=\"foo\\.adb:$decimal explicit raise)?" \ + "\"breakpoint-hit\",disp=\"keep\",bkptno=\"$any_nb\",exception-name=\"CONSTRAINT_ERROR(\",exception-message=\"foo\\.adb:$decimal explicit raise)?\"" \ "foo" "" ".*" ".*" \ ".*" \ "run to exception catchpoint hit" |