Page 5 of 5

Re: Programmer's Education Index

Posted: Tue Feb 04, 2014 4:53 pm
by dandymcgee
Accy wrote: I considered double majoring as a way to widen my options in the job field and was told that it would be a waste of time with good reason. I said a whole page back that I'm not going to do it anymore. I don't really know what point you think I missed.
Apparently none, so we're good. I only meant to make sure you understood what we were saying so you can make your own informed decisions. Sincere apologies if my post came off in the wrong way.

Re: Programmer's Education Index

Posted: Sun Jul 31, 2016 8:50 pm
by Accy
I've been programming quite a bit using SDL2 as of late (on ganoo/linux) and I'm having a bit of an issue. When I run a program that uses an SDL window, I get locked out of the terminal I'm running it from. Thus, I can't use GDB to debug, which sucks because it's my favorite debug tool and I really do not like IDEs.

I was wondering if anyone knew a way I could use SDL with GDB or free up a terminal while running an SDL program? I could conceivably run GDB in emacs, but I found that process confusing

EDIT: I found a solution by fucking around with it. I am surprised no one else on the entire internet seems to have had the same issue.
Anyways, the problem is that I had the generic while( !quit ) style of loop as my main loop, and GDB will seize with this kind of loop regardless of using an X window API or not. What you can do is press ^C in the GDB terminal to kill the loop, which will freeze your game and allow you to use gdb functions. Once you're done, you can use the continue function to pick up where you left off.

Re: Programmer's Education Index

Posted: Fri Aug 05, 2016 11:28 pm
by short
See if learning more about how GDB works helps :)

edit: My computer seems to be busted and can't copy/paste atm, but just google GDB tutorials

Re: Programmer's Education Index

Posted: Fri Aug 19, 2016 10:09 am
by Accy
Yeah, in my edit I talk a bit about my solution. There's really no tutorials that go into this problem, in depth. A little solution I worked out is to put a breakpoint at the start of your main loop. Then disable the breakpoint and continue. When you reach an issue, press ctrl+c to stop execution of the program, enable the breakpoint, continue, and then you have a paused program with GDB in the correct place.

Also, there's this tutorial by rms who is evidently not that rms
http://www.unknownroad.com/rtfm/gdbtut/gdbinfloop.html
Although it's more tailored to fixing an infinite loop rather than working with one, it is rather helpful.