You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I managed to hack my way into a solution but I do not dare to send any pull request since my knowledge of Lua and/or DAP are very minimal but I at least can provide my hacky solution since someone else might find it useful.
I use Java and I needed to set a breakpoint in java.lang.Object default constructor so I changed a method in nvim-dap/lua/dap/session.lua#set_breakpoints accordingly. In my case that would be editing the payload table so that it does not contain parameters line and column and instead it contains parameter name with value "java.lang.Object#<init>" and also the request endpoint from "setBreakpoints" to "setFunctionBreakpoints".
Note that the <> are there only for constructors since those do not have a name themselves, the structure of the name parameter is "className#methodName" so for hashCode on the Object it would be "java.lang.Object#hashCode"
Here is a snippet of that:
local payload = {
.
.
return {
-- line = bp.line, **comment this out**
-- column = bp.column, **comment this out**
name = "java.lang.Object#<init>", **add this**
.
.
-- **change the request**
self:request("setFunctionBreakpoints", payload, function(err1, resp)
I am sure this can be done more cleanly and without manual changes to internal files but I need this once in a blue moon and it was sufficient.
This is another feature that would be incredibly useful for debugging C++ projects. I'd love to make a PR for this if you'd be happy to have a look @mfussenegger
Problem Statement
would be a nice addition to add a breakpoint having only the name of the function
https://code.visualstudio.com/Docs/editor/debugging#_function-breakpoints
Possible Solutions
No response
Considered Alternatives
No response
The text was updated successfully, but these errors were encountered: