[v3,5/5] Use the .py file in gdb.dap/pause.exp

Message ID 20240220-py-simple-exc-v3-5-a2825caa4b74@adacore.com
State New
Headers
Series Fix DAP pause bug |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed

Commit Message

Tom Tromey Feb. 20, 2024, 7:46 p.m. UTC
  Tom de Vries pointed out that the gdb.dap/pause.exp test writes a
Python file but then does not use it.  This patch corrects the
oversight.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31354
---
 gdb/testsuite/gdb.dap/pause.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Tom de Vries Feb. 27, 2024, 9:36 a.m. UTC | #1
On 2/20/24 20:46, Tom Tromey wrote:
> Tom de Vries pointed out that the gdb.dap/pause.exp test writes a
> Python file but then does not use it.  This patch corrects the
> oversight.
> 

LGTM.

Reviewed-By: Tom de Vries <tdevries@suse.de>

Thanks,
- Tom

> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31354
> ---
>   gdb/testsuite/gdb.dap/pause.exp | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdb/testsuite/gdb.dap/pause.exp b/gdb/testsuite/gdb.dap/pause.exp
> index 4d13dadd3ad..9038d0f037f 100644
> --- a/gdb/testsuite/gdb.dap/pause.exp
> +++ b/gdb/testsuite/gdb.dap/pause.exp
> @@ -134,7 +134,7 @@ dap_read_response cancel $cancel_id
>   # does not continue the inferior) can be canceled.
>   #
>   
> -write_file py "while True:\n  pass"
> +set gdbfile [write_file py "while True:\n  pass"]
>   set cont_id [dap_send_request evaluate \
>   		 [format {o expression [s "source %s"] context [s repl]} \
>   		      $gdbfile]]
>
  

Patch

diff --git a/gdb/testsuite/gdb.dap/pause.exp b/gdb/testsuite/gdb.dap/pause.exp
index 4d13dadd3ad..9038d0f037f 100644
--- a/gdb/testsuite/gdb.dap/pause.exp
+++ b/gdb/testsuite/gdb.dap/pause.exp
@@ -134,7 +134,7 @@  dap_read_response cancel $cancel_id
 # does not continue the inferior) can be canceled.
 #
 
-write_file py "while True:\n  pass"
+set gdbfile [write_file py "while True:\n  pass"]
 set cont_id [dap_send_request evaluate \
 		 [format {o expression [s "source %s"] context [s repl]} \
 		      $gdbfile]]