diff options
author | Tom Tromey <tromey@adacore.com> | 2023-05-16 09:34:20 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-06-12 12:09:56 -0600 |
commit | 67efac36f17824b147b3d4645719404ccd662206 (patch) | |
tree | d31f11164e20dbf2507a991be2ffa9f6a5784485 /gdb/testsuite/lib | |
parent | 8115dffa1e76ab007223199dfbc8c1298d2bf06e (diff) | |
download | gdb-67efac36f17824b147b3d4645719404ccd662206.zip gdb-67efac36f17824b147b3d4645719404ccd662206.tar.gz gdb-67efac36f17824b147b3d4645719404ccd662206.tar.bz2 |
Add "target" parameter to DAP attach request
This adds a new "target" to the DAP attach request. This is passed to
"target remote". I thought "attach" made the most sense for this,
because in some sense gdb is attaching to a running process. It's
worth noting that all DAP "attach" parameters are defined by the
implementation.
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r-- | gdb/testsuite/lib/dap-support.exp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/dap-support.exp b/gdb/testsuite/lib/dap-support.exp index 5c54748..e1fada8 100644 --- a/gdb/testsuite/lib/dap-support.exp +++ b/gdb/testsuite/lib/dap-support.exp @@ -283,6 +283,17 @@ proc dap_attach {pid} { [format {o pid [i %s]} $pid]] } +# Start gdb, send a DAP initialize request, and then an attach request +# specifying TARGET as the remote target. Returns the empty string on +# failure, or the response object from the attach request. +proc dap_target_remote {target} { + if {[_dap_initialize "startup - initialize"] == ""} { + return "" + } + return [dap_check_request_and_response "startup - target" attach \ + [format {o target [s %s]} $target]] +} + # Cleanly shut down gdb. TERMINATE is passed as the terminateDebuggee # parameter to the request. proc dap_shutdown {{terminate false}} { |