HNHacker News
TopNewBestAskShowJobs

werat

171 karma · joined October 11, 2022

submissionscomments
werat··on What a good debugger can do
This looks great, very interesting approach! Augumenting the code of a running process using a scripting language is a cool idea, excited to see what comes next. I will definitely keep an eye on the project.
werat··on What a good debugger can do
I agree that language server and debugger are different beasts, but both LSP and DAP serve a purpose of re-using the same server (xrefs or debugger) with different IDEs.

> I can implement the LSP and get support for IDEs essentially for free I mean, technically same is true for DAP... You can implement DAP and get support for IDE for free. But I agree that in general case implementing a good debugger is harder than implementing a good language server.

If Drustzig requires a special debugger (e.g. because it uses acustom format of debug information), then you'd need to implement it, yes. However, existing debuggers can support new languages relatively easy if those follow standard conventions (e.g. use PDB and DWARF). For example, Rust support in LLDB basically comes down to a custom demangler.

Again, I'm not saying that DAP is perfect and solves debugging, but IMO it's a step in the right direction. Make it popular, make it extensible. Debuggers can be mostly language agnostic (within reasonable bounds), but they don't _have_ to be.

werat··on What a good debugger can do
> Debuggers need to do more things

It's true that coming up with an interface for an abstract debugger is harder, but it's not impossible. Microsoft created Debug Adapter Protocol (https://microsoft.github.io/debug-adapter-protocol/), which is conceptually similar to LSP. It's not perfect, but covers most basic operations pretty well, while leaving to the debugger to deal with the implementation details.

werat··on How Wine works 101
This is Visual Studio with the Stadia debugger extension (https://github.com/googlestadia/vsi-lldb). It runs LLDB on Windows and attaches to a process running on a remote Linux machine (Wine in this case). We have a couple of custom patches to LLDB to support Wine, which are not open source yet, unfortunately. The Wine support is not perfect, but most things work (call stacks, breakpoints, stepping though the code, etc).