User forums > Using Code::Blocks

Debugging DLL for console app.

(1/2) > >>

Ariman:
I'm trying to debug a plugin for third-party console application. Plugin is written as a DLL. When I start debugger host process is created (I can see new process in process list) but there is no console window appears.
Codeblocks version: svn 5382 (nightly build)
OS: Windows
Compiler: mingw (gcc 3.4.5) + gdb 6.8
Should I make some additional adjustment in settings or my library or debugger options to actually make console appear?

ollydbg:
I'm sure the way below works, you can have a try.
Debug from the host application :D, then trace into your DLL.

Ariman:

--- Quote from: ollydbg on January 23, 2009, 10:49:36 am ---I'm sure the way below works, you can have a try.
Debug from the host application :D, then trace into your DLL.

--- End quote ---
I wish it was so simple. But host app has no debug symbols let alone source code. :(

ollydbg:
You can download the sample programming from :
http://forums.codeblocks.org/index.php?action=dlattach;topic=4896.0;attach=1707
And set DLL as main target, and set the exe has a host applications. It works fine. :D, see my screenshot below.


[attachment deleted by admin]

Ariman:
Thanks for the sample. It works fine indeed.  :)

I did some more experiments and found interesting thing. I've found all stuff that should be printed on console in debugger log ("Debugger (debug)" window). Seems that stdout handle of the host app is redirected. But breakpoints in DLL are working properly.
Does anybody know how to change this behavior? I need console to be shown as usual.

I've attached sample projects (one for console app and one for DLL for more clean experiment  :D).

[attachment deleted by admin]

Navigation

[0] Message Index

[#] Next page

Go to full version