Debugging problem

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
stepanium
Posts: 1
Joined: February 13th, 2019, 8:33 am

Debugging problem

Post by stepanium » February 13th, 2019, 2:55 pm

Hello evereyone. I've just finished watching Chili's 7th tutorial, started doing the homework and I have a problem with a debugger: it breaks, shows me the error line (assert (x >=0)) but when I try to step out or step in or step over I get send to the page "assert.cpp not found". Couldn't find anything about it on google. What should I do to fix it?
Attachments
VS2017_assert.cpp_not_found.jpg
(272.85 KiB) Not downloaded yet

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Debugging problem

Post by albinopapa » February 14th, 2019, 3:17 am

Wouldn't worry too much about the assert.cpp not found message, the main issue is what caused the assertion ( x >= 0 ) which in this case, means that x >= 0 is false. If you look down in the Autos or Locals window, your x and y variables have not been set to valid values and are negative.

Make sure you have correctly initialized your x and y values.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Debugging problem

Post by albinopapa » February 14th, 2019, 3:19 am

One thing you can do is use the Call Stack window to back track a few functions and see where the problem started. For instance, double click on Game::ComposeFrame and see what values you get for that function, if they all look valid and correct, double click on the Graphics::DrawBox function and verify those values are valid and correct.

I'm willing to bet one of those functions is where you'll find your problem.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Debugging problem

Post by chili » February 15th, 2019, 6:20 am

Yep, the thing to do is use the call stack to move up into your own code and find where the problem *really* lies.
Chili

Post Reply