Closed dvogel closed 1 year ago
The simple explanation for this is that these functions are never called and therefore don't exist in the executable. You can verify if this is the case by using go tool objdump
.
You're right, I was able to verify that the function doesn't appear in the objdump output. Thanks for pointing me in that direction. It seems very counter-intuitive that a debug tool would omit functions. That may feel obvious if you have extensive experience with the go toolchain but if you come from a C background you're used to debug builds containing all defined code. It would be good if delve automated the listing of symbols and reporting that a function doesn't exist rather than claiming the line in the function is not a statement.
This is a bug about breakpoints not being accepted. I have read the relevant FAQ section. The guidance there does not seem to apply to this issue since this file is partially amenable to breakpoints.
Observed results:
Expected result: Either a breakpoint or an error message that makes more sense within the context of the available source file.
In
ui/prompt.go
I have:Delve knows about that source file:
Listing from that file works:
So it can set breakpoints in this file but not on some non-statement lines (as expected):
The functions implementing the interfaces from the
furex
package seem to give it an issue. However non-interface functions after those are amenable to breakpoints so it's not a different view of the file:Similarly, specifying those functions by the package-based locspec shows the same split behavior:
In the steps above I allowed delve to build the program but I get the same results if I manually build the program with
go build -gcflags '-N -l' titd
. I have been unable to reproduce this with a smaller, more generic case so I suspect this is somehow related to the particular nature of the use of these interfaces within furex. However, please note that if this is the case I'm not looking for delve to fix this, just to give better guidance on whether a user should expect this to work.