User forums > Using Code::Blocks

How to debug a WinApi App with Threads

(1/2) > >>

flammi:
Hello,

I want to debug a Win32 Gui Project.
The only problem is, that this App uses Threads ( CreateThread(...) ). ( debugging of Apps without Threads works fine! )
The debugger didn't stop at breakpoints in the Thread i created, only breakpoints in the WinMain Thread were recognized.

How can i debug the Thread i created with CreateThread()???

Produce debugging Symbols is enabled.
I am using Code::Blocks 1.0 revision 3140 (a Nightly Build) with MingW.

mandrav:
Nothing special to do. Set a breakpoint inside the thread's code and it will break. If it doesn't (and breakpoint filename error is not printed in the log), it means the code was never run.

Pecan:
See the warnings about breakpoints in ctor/dtors.
http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks

kkez:
I just tested a breakpoint inside a thread proc in a winapi app, and gdb stops where it is. So that means your code wasn't run :)

Ps: Pecan, you forgot an s: http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks   :)

MortenMacFly:

--- Quote from: Pecan on October 26, 2006, 03:02:41 pm ---See the warnings about breakpoints in ctor/dtors.
http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks

--- End quote ---
See: This page is useful from the first second... why didn't we do this in the first place...?! ;-)

Navigation

[0] Message Index

[#] Next page

Go to full version