svaante / dape

Debug Adapter Protocol for Emacs
GNU General Public License v3.0
455 stars 25 forks source link

`dape--info-stack-update` barfs when stack frame source path is a URL #51

Closed sham1 closed 4 months ago

sham1 commented 8 months ago

Experimenting at work with using the java debug adapter with an attached debugger, with the example of this comment, I've gotten to an interesting issue.

Due to the architecture of the framework we use at work, when a breakpoint is hit in our code, the program's control flow goes through classes in the CLASSPATH, which the debug adapter will provide via the custom jdtls URL schema of jdt://. This causes problems in dape--info-stack-update, and in particular in the call to dape--format-file-line, since that assumes that the path will be a filesystem path instead of a URL, which in turn means that the inner call to file-relative-name will fail as a result.

The error in particular is (wrong-type-argument stringp nil) because internally file-relative-name is trying to call string-prefix-p with nil as the prefix, which is of course not allowed.


A proper fix would probably require proper support for URLs, but for the time being a working solution could be that if file provided to dape--format-file-line is a URL, it's used verbatim in the stack trace.

svaante commented 8 months ago

Hi! Are you using dape from elpa or from master? If you are using from maste could you please share the contents of the *dape-connection events* buffer?

svaante commented 4 months ago

Closing this at is probably the same issue as #78 and that has been solved by improving eglot-java.