User forums > Using Code::Blocks

C::B debug (gdb) remove Console of my host application

<< < (3/4) > >>

oBFusCATed:
Hm, strange...
Can you try this steps:
1. make a console application
2. make a dll project
3. declare/export a function in the dll
4. call the function in the console application
5. active the dll project and try to debug it (probably you'll need to enable the "run host in terminal" option)

kccheng:

--- Quote from: oBFusCATed on June 17, 2011, 10:22:10 pm ---Hm, strange...
Can you try this steps:
1. make a console application
2. make a dll project
3. declare/export a function in the dll
4. call the function in the console application
5. active the dll project and try to debug it (probably you'll need to enable the "run host in terminal" option)

--- End quote ---

I do a similar test.  Create a DLL project, and set the host application to a Console Application
I simply set the host application to "c:\windows\system32\attrib.exe" with arg "C:\windows\temp\*.*"

OK, I know ... the application does not use the function exported by DLL ... since I don't think
it's important to see if DOS prompt will be disappear or not.

Now in DLL's project, "Debug->Start" ... will make DOS prompt disappear with/without
"run host in terminal".
The message will be re-direct to "Debugger log"

Using "Build->Run" ... the DOS prompt will show up and run "attrib C:\windows\temp\*.*"
correctly.

Well, message show on "Debugger log" seems not show up in real-time ... but
if it catch all message, I think I can live with that.


Regards,
KC

oBFusCATed:
Keep in mind that there is a little difference between "Build -> Run" and "Debug -> Start"
In the "Build -> Run" situation, C::B starts console_runner, which then starts your application and when your application finishes it prints "Press any key to continue message"
The debugger on the other hand doesn't use console_runner, so no message is printed. You can achieve similar effect by putting a breakpoint at the '}' of the main function.


--- Quote from: kccheng on June 17, 2011, 11:18:58 pm ---Well, message show on "Debugger log" seems not show up in real-time ... but
if it catch all message, I think I can live with that.

--- End quote ---
The log window has some refresh problems on windows, the messages are almost "realtime".
You have to scroll up-down, so the log window can be refreshed correctly...

kccheng:
Thanks for the helpful information.

KC

kccheng:

--- Quote from: oBFusCATed on June 18, 2011, 01:31:22 am ---
--- Quote from: kccheng on June 17, 2011, 11:18:58 pm ---Well, message show on "Debugger log" seems not show up in real-time ... but
if it catch all message, I think I can live with that.

--- End quote ---
The log window has some refresh problems on windows, the messages are almost "realtime".
You have to scroll up-down, so the log window can be refreshed correctly...

--- End quote ---

Hi,

I have done more test on debugger log, it's not just the refresh issue you mentioned.

What I found is all message from printf() will not be flush automatically even the message
include "\n".  I need to enforce flush by calling fflush(0) right after each printf() to make them
show on debugger log immediately.

But debugger log does catch all message eventually which should normally
goes to Console.

I don't think this is correct behavior.  The "\n" in printf() should cause auto flush.
Could this be improved in the future ?

Best Regards,
KC

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version