Hi. 
Apologizes in advance if this sounds like a dumb question, but I am really struggling to run the kate program with GDB… Indeed, the process exits immediately after the command, then the Kate window starts…
I am guessing the kate executable is just a wrapper, but is there a technique to run Kate under a debugging session and/or to retrieve its standard outputs?
I would like to contribute in fixing some small bugs… 
Thank you very much in advance.
Since it’s been two month, I’m allowing myself to bump up this thread, I really don’t understand how to run Kate through a debugger, although I have no problems with any other application…
Looks like Kate detaches (forks) by default: apps/kate/main.cpp · master · Utilities / Kate · GitLab
This is useful for not blocking creating new instances of Kate I think, but it causes GDB to not attach to it by default.
To bypass this, either:
gdb kate
run --block # same as running kate --block, which does not detach
or attach manually:
kate
gdb --pid $(pidof kate)
I tried both of these and they do work. You can try opening KRunner and running killall -11 kate (-11 means SIGSEGV, segmentation fault) then running backtrace or bt in the gdb shell.
2 Likes
Thanks, this is precisely what I needed. I didn’t know about the –block option. 