https://felix-knorr.net/posts/2022-02-27-direct-gdb.html
GDB is unfortunately not that great for debugging. Especially when you compare it to the Windows world's Visual Studio debugger. It's the best we got though on Linux, and PEDA makes it much more tolerable.