X11 Debugging

Im building a window manager and need to do some debugging.
But I cant start a X server inside another one.
I've even tried launching my wm using Xephyr in vs code, but no success.
Is there a way to debug window managers? Or, how can I launch my program in Xephyr, using vs code/another IDE? I cant find answer on the web.
Any help is appreciated.

Attached: X11.png (512x512, 104.86K)

Other urls found in this thread:

stackoverflow.com/questions/43836861/how-to-run-a-command-in-visual-studio-code-with-launch-json
twitter.com/SFWRedditImages

Just use a bash script

You can also try launching it in a VNC session using vnc4server?

>2022
>building an x11 window manager
x11 is deprecated abandonware, stop wasting your time, write a wayland compositor instead

Wayland is slow and everything breaks in it. Plus freedesktop.org is shilling it.

Xephyr -br -ac -noreset -screen 1024x768 :2
DISPLAY=:2

Yes, I know that. But I need to debug the lines of code.... See were my program is crashing...

Idc. Its fun.
I plan to learn Wayland btw

DISPLAY=:2 gdb

use a second machine. attach gdb. return to the chad OG unix days.

I use Xnest:
Xnest :2 -geometry 1280x1024
And run the window manager in a separate window:
DISPLAY=:2 gdb dwm

Thx, that helps!

Thx for the suggestion, probably will also try that...

I'm assuming this is a C or C++ program.

0. Look at the manpage of Xephyr and open a window on display :1

1. In VSCode you will set up debugging like any other C or C++ program. Make sure you understand how to do this, set a breakpoint on main to check that that's working.

2. In your launch environment, ensure the DISPLAY environment variable is set to whatever Xephyr session you have open.

Yes, Im using C.
You mean exporting DISPLAY in launch.json in vscode?

Yes

Are you using Xlib or xcb?

Pure Xlib.
I've put "export DISPLAY=:2" in a task following
>stackoverflow.com/questions/43836861/how-to-run-a-command-in-visual-studio-code-with-launch-json
and executed the task in preBuildCommand... But still, cant open the program. It crashes in XOpenDisplay meaning it is not finding the X server.
Thx for your help btw. I'll keep trying...

>I've even tried launching my wm using Xephyr in vs code, but no success.
You're just too retarded to do the things you want to do.

Attached: X11Trannies-02.png (725x610, 72.25K)

Sorry, Im trying to get better.
Can you help me?
I was using Vim but switched to vscode just to debug... I try to attach gdb running the wm in another tty and it gives me no output when the bug/crash happens.
I will try commenting features till I find whats causing it.
Im drawing frame decorations suign xpm, maybe is something releated to that

I guess I need programming socks.
Then I'll be a better programmer...

Read something that explains how X11 works, then learn how environment variables work. Stop trying to make things work by banging on the keyboard randomly like a monkey.