1

I am developing a OpenGL program using Mingw32 on Windows 10(64 bit)

The program runs without problem

But when I debug my program using gdb, it shows:

(gdb) n

0x6a7706f8 in ?? () from C:\Windows\System32\DriverStore\FileRepository\c0310483.inf_amd64_ab6d2afa5c543409\atioglxx.dll

(gdb) n

Cannot find bounds of current function (gdb)

Here is the code I want to debug

int main() {
GLFWwindow * window = initGLContext();
initImGui(window);

int points[8] = { 0 };

GLuint VAO, VBO;
glGenVertexArrays(1, &VAO); // I set breakpoint here
glGenBuffers(1, &VBO);

GLShader curveShader("", "", "");

while (!glfwWindowShouldClose(window)) {
    glfwPollEvents();
    useGUI(points);
    render();
    glfwSwapBuffers(window);
}

ImGui_ImplGlfwGL3_Shutdown();
ImGui::DestroyContext();
glfwTerminate();

return 0;
}

please let me know if more info is needed

Thanks in advance

Edited:

It turns out that my program lack the debug information for glGenVertexArrays(),which is offered by atioglxx.dll, so I decide to use printf() instead

Rayman
  • 61
  • 1
  • 8
  • Possible duplicate of [Why I do get "Cannot find bound of current function" when I overwrite the ret address of a vulnerable program?](https://stackoverflow.com/questions/8741493/why-i-do-get-cannot-find-bound-of-current-function-when-i-overwrite-the-ret-ad) – YesThatIsMyName May 18 '18 at 06:32

1 Answers1

1

But when I debug my program using gdb, it shows:

(gdb) n
0x6a7706f8 in ?? () from C:\Windows\System32\DriverStore...

This is happening because you are stopped inside atioglxx.dll, which has no debugging info (or even symbol table).

When debugging, you need to be aware of your current context (e.g. which function am I stopped in).

When you are in your own code, and assuming you compiled it with debug info, you can do next, step, info locals, etc. But when you are in somebody else's code (e.g. in system-provided DLL), these commands will not work (are not expected to work).

Community
  • 1
  • 1
Employed Russian
  • 199,314
  • 34
  • 295
  • 362