User forums > Using Code::Blocks
No console output window while debugging console app on Mac OS X
edwin:
Hi oBFusCATed,
If I go to a console window and execute the command:
osascript -e 'tell app "Terminal"' -e 'activate' -e 'do script "$SCRIPT"' -e 'end tell'
An new console window gets created and the “value” contained in $SCRIPT is executed. For the test, the $SCRIPT value contains nothing.
I did look over the debug log. Hmmm….. I do not see any line with text “Execuing”.
Do you think I should post the log to this thread for you to look at?
Thank you,
edwin
oBFusCATed:
1. Post both logs.
2. Does the "Run" command show the terminal? (executed with Build -> Run) ?
If it doesn't this means that it is not a debugger problem, but something else.
afb:
--- Quote from: edwin on June 04, 2010, 10:26:42 pm ---An new console window gets created and the “value” contained in $SCRIPT is executed. For the test, the $SCRIPT value contains nothing.
--- End quote ---
$SCRIPT is a variable with the program to run, possibly with environment and arguments
--- Quote ---I did look over the debug log. Hmmm….. I do not see any line with text “Execuing”.
--- End quote ---
It should be in the Build log, not the Debug log (you did hit Build/Run, yes ? not Debug/Start)
edwin:
Hi oBFusCATed and afb,
Thank you for your help so far.
I understand what you are both suggesting…. I performed a few tests since last Friday. I am performing all of these tests with my project’s Debug build.
Build->Run (Fails from within the IDE if there are spaces in the path to the executable)
I tried performing a “Build->Run” and two terminal windows were displayed. The shell echoed an error that “the path could not be found”. Instantly it looked like “spaces in the path” issues from what I saw.
I specified a new output path in the build project that contained no spaces and the “Build->Run” then did function properly.
Long story short –I then performed “Build->Run” and “Debug->Start” tests. Here are the results:
Build->Run test:
1)
Removed spaces from the executabe's path.
2)
Rebuilt the Debug image.
3) Performed a "Build->Run". Everything worked:
Build Log:
Checking for existence: /Development/VOIPMediaEngine/PortingLayerTest/bin/DebugMac32/PortingLayerTest
Executing: osascript -e 'tell app "Terminal"' -e 'activate' -e 'do script "/Development/VOIPMediaEngine/PortingLayerTest/bin/DebugMac32/PortingLayerTest "' -e 'end tell' (in /Development/VOIPMediaEngine/PortingLayerTest/bin/DebugMac32)
Process terminated with status 0 (0 minutes, 0 seconds)
Debugger Log:
Contained nothing.
Debug->Start test:
1)
Performed a "Debug->Start". This did not work – No terminal window was displayed
Build Log:
-------------- Build: Debug Mac32 in PortingLayerTest ---------------
Target is up to date. Nothing to be done.
Debugger Log:
DYLD_LIBRARY_PATH=.:
Command-line: /usr/bin/gdb -nx -fullname -quiet -args bin/DebugMac32/PortingLayerTest
Working dir : /Development/VOIPMediaEngine/PortingLayerTest/
> set prompt >>>>>>cb_gdb:
Reading symbols for shared libraries ... done
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb 6.3.50-20050815 (Apple version gdb-1461.2) (Fri Mar 5 04:43:10 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set unwindonsignal on
>>>>>>cb_gdb:
> set disassembly-flavor intel
>>>>>>cb_gdb:
> catch throw
Catchpoint 1 (throw)
>>>>>>cb_gdb:
> source /Applications/AppNew/CodeBlocks.app/Contents/Resources/share/codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> cd bin/DebugMac32
>>>>>>cb_gdb:
> directory /Development/VOIPMediaEngine/PortingLayerTest/
>>>>>>cb_gdb:
> directory /Development/VOIPMediaEngine/
>>>>>>cb_gdb:
> run
Reading symbols for shared libraries +
+
. done
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Program exited normally.
>>>>>>cb_gdb:
> quit
I can run additional tests if needed.
Thank you both,
edwin
oBFusCATed:
I've looked at the code and the tty thing is compiled only for wxgtk = linux/freebsd
--- Code: ---
#ifdef __WXGTK__
// create xterm and issue tty "/dev/pts/#" to GDB where
// # is the tty for the newly created xterm
m_bIsConsole = (target && target->GetTargetType() == ttConsoleOnly);
if (m_bIsConsole)
{
if (RunNixConsole() > 0 )
{ wxString gdbTtyCmd;
gdbTtyCmd << wxT("tty ") << m_ConsoleTty;
m_State.GetDriver()->QueueCommand(new DebuggerCmd(m_State.GetDriver(), gdbTtyCmd, true));
DebugLog(wxString::Format( _("Queued:[%s]"), gdbTtyCmd.c_str()) );
}
}//if
#endif//def __WXGTK__
--- End code ---
An easy fix (if it works) is to replace
#ifdef __WXGTK__
with
#ifndef __WXMSW__
or to use if (!platform::windows)
But I can test it, because I don't have a osx running...
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version