Using debuggers from the command line is the usual way to debug your program. This is also an important skill, as you could easily wind up in a situation where your more advanced coding platform is not available. For instance, you may need to debug a program that is already running in production. Attaching to a running process is possible with both gdb and lldb, but you may not be able to attach to the running program from within your editor.
Nevertheless, in a typical development environment setting, you would use a code editor or an IDE, which is convenient if you can debug your program from the editor right away, without leaving your editor. In this way, you get a much smoother debugging experience ...