Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing debugging instruction #2151

Closed
ael-code opened this issue Jun 22, 2018 · 2 comments
Closed

missing debugging instruction #2151

ael-code opened this issue Jun 22, 2018 · 2 comments

Comments

@ael-code
Copy link
Contributor

I couldn't find any relevant info in the HACKING guide about how to debug sway.

I compiled a debug build, run it and tried to attach with gdb using --pid. The whole interface froze and I needed to restart the system.

In issue #489 I found some this command:

 gdb -batch -ex "run -d" -ex "continue" -ex "generate-core-file" ./bin/sway

But it doesn't allow you to have a live instance of gdb attached to the sway process.

I really would like to contribute, but I'm missing some basic hacking instruction

@emersion
Copy link
Member

emersion commented Jun 22, 2018

Hi,

If you want to debug, the easiest thing to do would be to start gdb sway inside of sway - there you can pause the inner sway without freezing the outer one. Note that you can debug Sway like this inside any Wayland or X11 compositor.

If you need to debug the DRM backend, you'll need to either use coredumps or SSH into your machine from another one.

Hope this helps! Make sure to join #sway-devel on IRC if you have more questions!

@ascent12
Copy link
Member

I'd like to note that starting an interactive debugger on the DRM backend is just going to cause issues. Due to the way the DRM rendering loop inherently works, pausing it can really mess it up, and if you're unlucky, it can completely break your session.
As @emersion says, it's generally better to rely on coredumps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants