[3/9] gdb/testsuite/dap: write requests to gdb.log

Message ID 20230106185729.42372-4-simon.marchi@efficios.com
State Committed
Commit 4cdda229da53bde30b2a22155ee7ceb025cebc49
Headers
Series Fix gdb.dap/basic-dap.exp for PIE |

Commit Message

Simon Marchi Jan. 6, 2023, 6:57 p.m. UTC
  This helps following what happens when reading gdb.log.  The downside is
that it becomes harder to tell what text is from GDB and what text is
going to GDB, but I think that seeing responses without seeing requests
is even more confusing.  At least, the lines are prefix with >>>, so
when you see this, you know that until the end of the line, it's
something that was sent to GDB, and not GDB output.

Change-Id: I1ba1acd8b16f4e64686c5ad268cc41082951c874
---
 gdb/testsuite/lib/dap-support.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Tom Tromey Jan. 25, 2023, 9:59 p.m. UTC | #1
>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> This helps following what happens when reading gdb.log.  The downside is
Simon> that it becomes harder to tell what text is from GDB and what text is
Simon> going to GDB, but I think that seeing responses without seeing requests
Simon> is even more confusing.  At least, the lines are prefix with >>>, so
Simon> when you see this, you know that until the end of the line, it's
Simon> something that was sent to GDB, and not GDB output.

Seems fine to me, and if it is ever annoying, we can always revert it.

Tom
  
Tom Tromey Jan. 25, 2023, 10:01 p.m. UTC | #2
>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> This helps following what happens when reading gdb.log.  The downside is
Simon> that it becomes harder to tell what text is from GDB and what text is
Simon> going to GDB, but I think that seeing responses without seeing requests
Simon> is even more confusing.  At least, the lines are prefix with >>>, so
Simon> when you see this, you know that until the end of the line, it's
Simon> something that was sent to GDB, and not GDB output.

I meant to mention -- the full DAP I/O is in the test subdir.
E.g. look at gdb/testsuite/outputs/gdb.dap/basic-dap/dap.log.1 in the
build tree.

Tom
  
Simon Marchi Jan. 26, 2023, 3:01 a.m. UTC | #3
On 1/25/23 17:01, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Simon> This helps following what happens when reading gdb.log.  The downside is
> Simon> that it becomes harder to tell what text is from GDB and what text is
> Simon> going to GDB, but I think that seeing responses without seeing requests
> Simon> is even more confusing.  At least, the lines are prefix with >>>, so
> Simon> when you see this, you know that until the end of the line, it's
> Simon> something that was sent to GDB, and not GDB output.
> 
> I meant to mention -- the full DAP I/O is in the test subdir.
> E.g. look at gdb/testsuite/outputs/gdb.dap/basic-dap/dap.log.1 in the
> build tree.

Yeah, I saw that.  But to debug the actual test, I found that having the
full communication in gdb.log was a bit easier, to correlate with passes
and fails.

Simon
  

Patch

diff --git a/gdb/testsuite/lib/dap-support.exp b/gdb/testsuite/lib/dap-support.exp
index a91b5533643..94a0d27c8a8 100644
--- a/gdb/testsuite/lib/dap-support.exp
+++ b/gdb/testsuite/lib/dap-support.exp
@@ -102,7 +102,7 @@  proc _dap_send_ton {obj} {
     set json [namespace eval ton::2json $obj]
     # FIXME this is wrong for non-ASCII characters.
     set len [string length $json]
-    verbose ">>> $json"
+    verbose -log ">>> $json"
     send_gdb "Content-Length: $len\r\n\r\n$json"
 }