Programmer's Education Index

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Re: Programmer's Education Index

Postby dandymcgee on Tue Feb 04, 2014 6:53 pm

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.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
 
Posts: 4911
Joined: Tue Apr 29, 2008 4:24 pm
Location: New Hampshire

Re: Programmer's Education Index

Postby Accy on Sun Jul 31, 2016 9:50 pm

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.
User avatar
Accy
Chaos Rift Newbie
Chaos Rift Newbie
 
Posts: 29
Joined: Tue Jan 28, 2014 1:10 pm
Location: USA

Re: Programmer's Education Index

Postby short on Sat Aug 06, 2016 12:28 am

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
My github repository contains the project I am currently working on,
link: https://github.com/bjadamson
User avatar
short
ES Beta Backer
ES Beta Backer
 
Posts: 570
Joined: Thu Apr 30, 2009 3:22 am
Location: Oregon, US

Re: Programmer's Education Index

Postby Accy on Fri Aug 19, 2016 11:09 am

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.
User avatar
Accy
Chaos Rift Newbie
Chaos Rift Newbie
 
Posts: 29
Joined: Tue Jan 28, 2014 1:10 pm
Location: USA

Previous

Return to Programming Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron