public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Help with setting up DAP for Kate text editor
@ 2024-01-16  9:24 Akseli Lahtinen
  2024-01-17 15:15 ` Tom Tromey
  0 siblings, 1 reply; 8+ messages in thread
From: Akseli Lahtinen @ 2024-01-16  9:24 UTC (permalink / raw)
  To: gdb

[-- Attachment #1: Type: text/plain, Size: 1857 bytes --]

Hey, I am trying to set up DAP for Kate text editor with following config  

  

```json  

  

"gdb": {  

"url": "gdb",  

"run": {  

"command": ["gdb", "-i", "dap"],  

"redirectStderr": true,  

"redirectStdout": true,  

"supportsSourceRequest": false  

},  

"configurations": {  

"launch (debug)": {  

"request": {  

"command": "launch",  

"mode": "debug",  

"program": "${file}",  

"args": "${args|list}",  

"cwd": "${workdir}"  

}  

}  

}  

},  

  

```  

  

It starts running fine and can find breakpoints,  

but when I try to start the debugging process, I get following error:  

  

error on response:  

gdb.dap.server.request.<locals>.wrap.<locals>.non_sync_call() argument after  

** must be a mapping, not NoneType  

  

Just for comparison, I can run LLDB with Kate just fine with the following  

config:  

  

```json  

  

"lldb": {  

"url": "<https://github.com/llvm/llvm-project/tree/main/lldb/tools/>  

lldb-vscode",  

"run": {  

"command": ["lldb-vscode", "-p", "${#run.port}"],  

"port": 0,  

"redirectStderr": true,  

"redirectStdout": true,  

"supportsSourceRequest": false  

},  

"configurations": {  

"launch (debug)": {  

"request": {  

"command": "launch",  

"mode": "debug",  

"program": "${file}",  

"args": "${args|list}",  

"cwd": "${workdir}",  

"stopOnEntry": false  

}  

}  

}  

},  

  

```  

  

Just wondering if I am missing something?  

  

Thanks for the DAP support by the way. GDB is amazing debugger and I love  

using it, but I would love to use it in the Kate text editor as well :)  

  

Best regards,  

Akseli  

  

ps. Please use reply-all since I am not subscribed to the mailing list, thank  

you!  


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Help with setting up DAP for Kate text editor
  2024-01-16  9:24 Help with setting up DAP for Kate text editor Akseli Lahtinen
@ 2024-01-17 15:15 ` Tom Tromey
  2024-01-21 17:03   ` Akseli Lahtinen
  0 siblings, 1 reply; 8+ messages in thread
From: Tom Tromey @ 2024-01-17 15:15 UTC (permalink / raw)
  To: Akseli Lahtinen; +Cc: gdb

>>>>> Akseli Lahtinen <akselmo@akselmo.dev> writes:

> Hey, I am trying to set up DAP for Kate text editor with following config  
[...]
> It starts running fine and can find breakpoints,  
> but when I try to start the debugging process, I get following error:  
  
> error on response:  

> gdb.dap.server.request.<locals>.wrap.<locals>.non_sync_call() argument after  

> ** must be a mapping, not NoneType  

  
Is that the complete text?

If so you can you add the arguments -iex "set debug dap-log-file /tmp/log"
to the gdb invocation, reproduce the problem, and then send the log file?
(Opening a new bug would be best.)

It's probably a bug in the gdb DAP implementation.  It may depend on the
version of Python your gdb happens to be linked against.

thanks,
Tom

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Help with setting up DAP for Kate text editor
  2024-01-17 15:15 ` Tom Tromey
@ 2024-01-21 17:03   ` Akseli Lahtinen
  2024-01-22 13:45     ` Tom Tromey
  0 siblings, 1 reply; 8+ messages in thread
From: Akseli Lahtinen @ 2024-01-21 17:03 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb

Hey, sorry for the late response. 

I have requested an account to the sourceware bugzilla so I can
create a separate bug report, but here's the logs I got from running the 
command.

```log

+++ cd /home/akseli/Repositories/artificial-rage/build/
>>> Working directory /home/akseli/Repositories/artificial-rage/build.

+++ file /home/akseli/Repositories/artificial-rage/build/ArtificialRage
WROTE: <<<{"type": "event", "event": "module", "body": {"reason": "new", 
"module": {"id": "/home/akseli/Repositories/artificial-rage/build/
ArtificialRage", "name": "/home/akseli/Repositories/artificial-rage/build/
ArtificialRage", "path": "/home/akseli/Repositories/artificial-rage/build/
ArtificialRage"}}}>>>
>>> Reading symbols from /home/akseli/Repositories/artificial-rage/build/
ArtificialRage...

READ: <<<{"arguments": null, "command": "configurationDone", "seq": 2, "type": 
"request"}>>>
Traceback (most recent call last):
  File "/usr/share/gdb/python/gdb/dap/server.py", line 81, in _handle_command
    body = _commands[params["command"]](**args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: gdb.dap.server.request.<locals>.wrap.<locals>.non_sync_call() 
argument after ** must be a mapping, not NoneType
WROTE: <<<{"request_seq": 2, "type": "response", "command": 
"configurationDone", "success": false, "message": 
"gdb.dap.server.request.<locals>.wrap.<locals>.non_sync_call() argument after 
** must be a mapping, not NoneType"}>>>
READ: <<<{"arguments": null, "command": "configurationDone", "seq": 3, "type": 
"request"}>>>
Traceback (most recent call last):
  File "/usr/share/gdb/python/gdb/dap/server.py", line 81, in _handle_command
    body = _commands[params["command"]](**args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: gdb.dap.server.request.<locals>.wrap.<locals>.non_sync_call() 
argument after ** must be a mapping, not NoneType
WROTE: <<<{"request_seq": 3, "type": "response", "command": 
"configurationDone", "success": false, "message": 
"gdb.dap.server.request.<locals>.wrap.<locals>.non_sync_call() argument after 
** must be a mapping, not NoneType"}>>>
READ: <<<{"arguments": null, "command": "configurationDone", "seq": 4, "type": 
"request"}>>>
Traceback (most recent call last):
  File "/usr/share/gdb/python/gdb/dap/server.py", line 81, in _handle_command
    body = _commands[params["command"]](**args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: gdb.dap.server.request.<locals>.wrap.<locals>.non_sync_call() 
argument after ** must be a mapping, not NoneType
WROTE: <<<{"request_seq": 4, "type": "response", "command": 
"configurationDone", "success": false, "message": 
"gdb.dap.server.request.<locals>.wrap.<locals>.non_sync_call() argument after 
** must be a mapping, not NoneType"}>>>
READ: <<<{"arguments": {}, "command": "disconnect", "seq": 5, "type": 
"request"}>>>
WROTE: <<<{"request_seq": 5, "type": "response", "command": "disconnect", 
"success": true}>>>
+++ quit

```

Thanks!
- Akseli

On Wednesday 17 January 2024 17:15:04 EET you wrote:
> >>>>> Akseli Lahtinen <akselmo@akselmo.dev> writes:
> > Hey, I am trying to set up DAP for Kate text editor with following config
> 
> [...]
> 
> > It starts running fine and can find breakpoints,
> > but when I try to start the debugging process, I get following error:
> > 
> > error on response:
> > 
> > gdb.dap.server.request.<locals>.wrap.<locals>.non_sync_call() argument
> > after
> > 
> > ** must be a mapping, not NoneType
> 
> Is that the complete text?
> 
> If so you can you add the arguments -iex "set debug dap-log-file /tmp/log"
> to the gdb invocation, reproduce the problem, and then send the log file?
> (Opening a new bug would be best.)
> 
> It's probably a bug in the gdb DAP implementation.  It may depend on the
> version of Python your gdb happens to be linked against.
> 
> thanks,
> Tom





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Help with setting up DAP for Kate text editor
  2024-01-21 17:03   ` Akseli Lahtinen
@ 2024-01-22 13:45     ` Tom Tromey
  2024-01-22 17:21       ` Tom Tromey
  0 siblings, 1 reply; 8+ messages in thread
From: Tom Tromey @ 2024-01-22 13:45 UTC (permalink / raw)
  To: Akseli Lahtinen; +Cc: Tom Tromey, gdb

>>>>> Akseli Lahtinen <akselmo@akselmo.dev> writes:

> Hey, sorry for the late response. 
> I have requested an account to the sourceware bugzilla so I can
> create a separate bug report, but here's the logs I got from running the 
> command.

Thank you.  The problem seems clear to me:

> READ: <<<{"arguments": null, "command": "configurationDone", "seq": 2, "type": 
> "request"}>>>

Here, 'arguments' is documented as:

    interface ConfigurationDoneRequest extends Request {
      command: 'configurationDone';

      arguments?: ConfigurationDoneArguments;
    }

In gdb, I assumed that optional things would simply not be provided.  It
isn't clear to me that 'null' is a valid value here.

I filed an DAP clarification bug to find out:

https://github.com/microsoft/debug-adapter-protocol/issues/456

If this is in fact valid, it's easy to fix.  I have a patch for it
already, but I'd prefer not to land it if this request is invalid.

Tom

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Help with setting up DAP for Kate text editor
  2024-01-22 13:45     ` Tom Tromey
@ 2024-01-22 17:21       ` Tom Tromey
  2024-01-22 17:28         ` Akseli Lahtinen
  0 siblings, 1 reply; 8+ messages in thread
From: Tom Tromey @ 2024-01-22 17:21 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Akseli Lahtinen, gdb

Tom> I filed an DAP clarification bug to find out:

Tom> https://github.com/microsoft/debug-adapter-protocol/issues/456

The DAP maintainers said that the request in question is invalid.
So I think this is probably a bug in Kate instead.

thanks,
Tom

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Help with setting up DAP for Kate text editor
  2024-01-22 17:21       ` Tom Tromey
@ 2024-01-22 17:28         ` Akseli Lahtinen
  2024-01-22 19:05           ` Tom Tromey
  0 siblings, 1 reply; 8+ messages in thread
From: Akseli Lahtinen @ 2024-01-22 17:28 UTC (permalink / raw)
  To: Tom Tromey, Tom Tromey; +Cc: gdb

Thanks for your help!

I will create bugreport to Kate and ask around.

Br,
Akseli

On Monday 22 January 2024 19:21:15 EET Tom Tromey wrote:
> Tom> I filed an DAP clarification bug to find out:
> 
> Tom> https://github.com/microsoft/debug-adapter-protocol/issues/456
> 
> The DAP maintainers said that the request in question is invalid.
> So I think this is probably a bug in Kate instead.
> 
> thanks,
> Tom





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Help with setting up DAP for Kate text editor
  2024-01-22 17:28         ` Akseli Lahtinen
@ 2024-01-22 19:05           ` Tom Tromey
  2024-01-22 21:07             ` Akseli Lahtinen
  0 siblings, 1 reply; 8+ messages in thread
From: Tom Tromey @ 2024-01-22 19:05 UTC (permalink / raw)
  To: Akseli Lahtinen; +Cc: Tom Tromey, gdb

> Thanks for your help!
> I will create bugreport to Kate and ask around.

Let us know what you find out.  I'm happy to discuss the situation,
though coordinating via the DAP specification github might be best.

Tom

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Help with setting up DAP for Kate text editor
  2024-01-22 19:05           ` Tom Tromey
@ 2024-01-22 21:07             ` Akseli Lahtinen
  0 siblings, 0 replies; 8+ messages in thread
From: Akseli Lahtinen @ 2024-01-22 21:07 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Tom Tromey, gdb

It ended up being a very simple fix, you can see the merge request I made 
here: https://invent.kde.org/utilities/kate/-/merge_requests/1391

Basically Kate was sending QJsonValue that defaults to "null" but
changing that to QJsonObject fixed the issue.

- Akseli

On Monday 22 January 2024 21:05:19 EET Tom Tromey wrote:
> > Thanks for your help!
> > I will create bugreport to Kate and ask around.
> 
> Let us know what you find out.  I'm happy to discuss the situation,
> though coordinating via the DAP specification github might be best.
> 
> Tom





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-01-22 21:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-16  9:24 Help with setting up DAP for Kate text editor Akseli Lahtinen
2024-01-17 15:15 ` Tom Tromey
2024-01-21 17:03   ` Akseli Lahtinen
2024-01-22 13:45     ` Tom Tromey
2024-01-22 17:21       ` Tom Tromey
2024-01-22 17:28         ` Akseli Lahtinen
2024-01-22 19:05           ` Tom Tromey
2024-01-22 21:07             ` Akseli Lahtinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).