gdb: How do I pause during loop execution?

后端 未结 1 1494
花落未央
花落未央 2021-02-03 18:54

I\'m writing a software renderer in g++ under mingw32 in Windows 7, using NetBeans 7 as my IDE.

I\'ve been needing to profile it of late, and this need has reached criti

1条回答
  •  失恋的感觉
    2021-02-03 19:22

    Have you tried simply running your executable in gdb, and then just hitting ^C (Ctrl+C) when you want to interrupt it? That should drop you to gdb's prompt, where you can simply run the where command to see where you are, and then carry on execution with continue.

    If you find yourself in a irrelevant thread (e.g. a looping UI thread), use thread, info threads and thread n to go to the correct one, then execute where.

    0 讨论(0)
提交回复
热议问题