Question

Hi I want to improve my math library,

when I compute lenght of something I do

assert( !equal(len,0.0));
const f32 invsqrt = 1.0/sqrt(len);
X*= invsqrt;
Y*= invsqrt;
Z*= invsqrt;

this code is nice and if I do wrongly the division by zero the code breaks

"Runtime has requested to break application at line .. Vector.h line 88"

This is nice, but I want to do better, I want to show where error is REALLY.

So instead of showing "vector.h" and line 88 I want to show "main.cpp" "line 15" (if the getLength function is called at line 15 in main).

Vector is header only, so I think that achieving that is possible (that's just a feeling).. but how?

Thanks in advance. I hope you can see how usefull would be doing that.

Was it helpful?

Solution

That's where the code is, so that where it will break.

I think what you mean is to see the call stack.
In visual studio it's at: Debug -> Windows -> Call Stack.

The call stack can show you how you got to that line of code (which function were called in the work flow)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top