browsh-org / browsh

A fully-modern text-based browser, rendering to TTY and browsers
https://www.brow.sh
GNU Lesser General Public License v2.1
16.74k stars 412 forks source link

Debugging guide #228

Open tobimensch opened 5 years ago

tobimensch commented 5 years ago

We have guides for setting up a build system on Mac, Windows and Linux.

But what about debugging?

I'm especially interested in the best way to debug the tty frontend.

It's possible to debug go binaries with a special go debugger called delve and also the well-known gdb.

Delve is supposed to have better support for go's data structures and features, since it was developed specifically for go.

I tried to run browsh in delve, but my issue was that the screen was never rendered to the tty, although browsh was running.

If someone understands how to initiate a debug session with either delve or gdb, where you can use browsh normally, and also get backtraces and step through code, I would be very pleased to read your instructions for it.

Another interesting topic is the debugging of the webextension. I didn't have much luck with Firefox's debugging tools. Maybe someone can share pro tips for that. I believe Chrome's debugging tools to be of better quality, which would be an additional reason for porting browsh to Chrome.

rleir commented 4 years ago

Hi all With the go debugger you can attach to a running process. Would that not allow you to debug in a separate window? https://github.com/go-delve/delve/blob/master/Documentation/usage/dlv_attach.md Thanks Rick