Closed TatriX closed 8 months ago
Hi! Temporary breakpoints are not supported by the debug adapter protocol. The repl passes evaluations down to the adapter which does whatever it want's with it. I am guessing is that you use cpptools with MIMode gdb, which then passes tbreak to gdb. These kinds of specialised bindings that are adapter specific wont be a part of dape.
In the latest release dape-evaluate-expression
will send expressions in repl context which means that repl commands like tbrake
(when running gdb backed adapter) will be executed by the adapter.
Then you can do something like the following to improve your workflow:
(defun dape-until-gdb ()
(interactive)
;; Or tbreak but it sound like you want until instead
;; https://ftp.gnu.org/old-gnu/Manuals/gdb/html_node/gdb_37.html
(dape-evaluate-expression (format "until %d" (line-number-at-pos))))
(defun dape-until-lldb ()
(interactive)
(dape-evaluate-expression (format "thread until %d" (line-number-at-pos))))
(define-key dape-global-map "u" 'dape-until-gdb)
Hope this helps
Sorry for the offtopic, but where would one get this DAP-enabled gdb? Does one have to compile oneself?
I've just grabbed one mentioned in the readme: https://github.com/vadimcn/codelldb/releases (So it's lldb, not gdb)
@joaotavora Have not tried I believe cpptools use gdb mi interface when it uses gdb as it's backend but that is just a qualified guess. gdb 14.1 adds support, unfortunately gdb is not supported on system (last time I checked) so I have not tried it out.
Hi!
Oftentimes I need to continue running until certain point in code. In order to do that, right now I can go to repl
R
, put a temporary breakpoint by manually typingtbreak $line
and then continuec
. Instead it would be awesome if I could for exampleC-x C-a j
, or jump to the current line, which would do what I described earlier - put a temporary breakpoint on the current line and continue.And probably it would also be useful to expose
dape-breakpoint-temporary
so one could bind it directly and use together withdape-continue
.Personally I would bind
dape-breakpoint-toggle
tob
,dape-breakpoint-temporary
to sayC-b
anddape-breakpoint-expression
toM-b
, and then usee
fordape-evaluate-expression
. Which I can surely do in my config, and I'm sharing this just because it may be a useful addition for the README, to show how to configure dape to better fit one's needs.Thank you for this project, it looks very promising!