Print only part of a stack trace

Dennis dkorpel at gmail.com
Wed Jul 1 19:50:02 UTC 2020


On Wednesday, 1 July 2020 at 19:33:08 UTC, JN wrote:
> Bit off-topic, but if you can use them, debug contexts offer 
> much better OpenGL error-checking experience. 
> https://www.khronos.org/opengl/wiki/Debug_Output . Instead of 
> checking glGetError() after each call, you can setup a C 
> callback that will trigger whenever an error occurs. It also 
> offers some vendor-specific performance warnings.

I use those as well, to get a more detailed message about the 
error than the error code alone. While it helps describing _what_ 
went wrong, it doesn't tell me _where_ it went wrong.

I tried doing assert(0) in the callback, but even with 
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS), the stack trace looks 
something like this:

app.d: debugCallback [0x559eda75c7e8]
??:? [0x7f4a0bffa7d7]

And then it ends. It seems like it goes up into the OpenGL dll 
and then gets stuck, it does not trace back to the call site of 
the glFunction that failed.


More information about the Digitalmars-d-learn mailing list