Author Topic: No console output window while debugging console app on Mac OS X  (Read 21883 times)

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: No console output window while debugging console app on Mac OS X
« Reply #15 on: June 08, 2010, 02:12:24 pm »
…that is our best bet to get the debug terminal window working on OS X and that would also not break the build for Windows and Linux using the same code base?

It needs a little more work, since it only handles "xterm -T" and not "osascript".

But that's definitely it, it is not setting the right gdb tty on the wxMac platform...


Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: No console output window while debugging console app on Mac OS X
« Reply #16 on: June 08, 2010, 02:47:06 pm »
Fixed, r6336.

Offline edwin

  • Multiple posting newcomer
  • *
  • Posts: 38
Re: No console output window while debugging console app on Mac OS X
« Reply #17 on: June 08, 2010, 04:51:29 pm »
Hi afb,

Whoooaa… I will check this out immediately. This fix will certainly help the Mac debug cycles.

You are indeed awesome sir…

edwin


Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: No console output window while debugging console app on Mac OS X
« Reply #18 on: June 08, 2010, 05:04:29 pm »
Whoooaa… I will check this out immediately. This fix will certainly help the Mac debug cycles.

You are indeed awesome sir…

Even awesomer would have been to catch these before the release...

But I guess we can put up some plugin fixes (keybinder and debugger)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12122
    • Travis build status
Re: No console output window while debugging console app on Mac OS X
« Reply #19 on: June 08, 2010, 08:38:37 pm »
afb: probably you could provide nightlies or an rc1 build for the next release...
But I don't know how hard it is to build them :)

Thanks for the fix, hopefully Morten, wouldn't have too much problems merging the fix with the debugger branch changes.

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: No console output window while debugging console app on Mac OS X
« Reply #20 on: June 08, 2010, 09:27:37 pm »
afb: probably you could provide nightlies or an rc1 build for the next release...
But I don't know how hard it is to build them :)

Nobody uses the nightlies... At least nothing compared to the releases.

So it's more likely to be a 10.5-p1 "patch" instead. Or maybe just plugins ?

But it's not hard, more like tedious. Takes a few hours and like 5 gigs or so.

Quote
Thanks for the fix, hopefully Morten, wouldn't have too much problems merging the fix with the debugger branch changes.

Don't think so, it's just a couple of lines. So, similar to how it was before.

Offline edwin

  • Multiple posting newcomer
  • *
  • Posts: 38
Re: No console output window while debugging console app on Mac OS X
« Reply #21 on: June 11, 2010, 07:58:52 pm »
Hi afb,

I was briefly diverted to other tasks…

I checked out and built CodeBlocks SVN 6336. The console terminal window is now being displayed during debugger sessions – I can now see the console app’s standard output.

Thanks very much for your effort. It will be a great help in moving forward. Thanks also oBFusCATed.

---------------------------

Other Info:
I have been working with CodeBlocks for a while now on the Mac platform. I have performed “usage type” testing as I have been developing real production code with the IDE. I have made notes regarding what works and appears stable and what seems to have a few hiccups. I use the functionality that works and shy away from the rest.  :)

Currently I am now running a pretty stable configuration of CodeBlocks on the Mac. It is in fact stable enough for me that I am productive using CodeBlock on Mac’s OS X 10.6.3. Exactly the original intended goal. I mean – I am really getting productive.

Note for anyone else reading this: The Windows and especially the Linux builds of CodeBlocks are excellent.


If I may, there are only three issues that – if resolved – would make a big difference immediately for the Mac build:

1)
Editor keyboard input is especially slow.

I don’t know why this is. As soon as I can free up a bit of time, I will try look into this under the debugger. If this could be resolved, it would be very, very good and would immediately impact the user’s productivity. Hopefully this is high on the Mac ToDo list of “things” to investigate.

I have not seen any editor related crashes and everything else about the editor appears stable.


2)
The code completion plugin appears to be related to 2 CodeBlocks crashes I have witnessed.

Two instances of crashing I have seen:

1)
Closing a workspace with the code completion plugin loaded and enabled will crash C::B. This “crash” is repeatable. I have looked over the crash dumps and I can see what led up to the termination. Also, when exiting C::B, the same crash occurs.

2)
When saving configuration settings, CodeBlocks will crash. It appears the code completion plugin is also related to this. Hmmm…..

3)
Menu keyboard shortcuts have some “teething pains”. All of the keyboard shortcut issues have a work around so this is not mission critical. I am just thinking about development productivity – that’s all.

I am a long time keyboard guy and it slows me down whenever I have to grab for the mouse.  :)


In closing:
Right now, I use a minimal set of the plugins. I am working around the code completion plugin related issues – I enable/disable code completion depending on what I need to do. Normally I leave code completion ON because of the productivity boost it yields.

The keyboard input rate is pretty important. I think this is the most important thing to resolve.

I am sure the CodeBlocks development team is aware of this “stuff”. I hope this information is useful non-the-less.

As usual, kudos to the entire development team and great work on this IDE.
Simply wonderful.


Thank you,

edwin



Offline whpatton

  • Single posting newcomer
  • *
  • Posts: 2
Re: No console output window while debugging console app on Mac OS X
« Reply #22 on: July 08, 2010, 06:29:38 am »

http://forums.codeblocks.org/index.php/topic,12678.15.html

RE: codeblocks-10.05-src.tar.bz2 8 June 2010  Berlios download.

The routine \codeblocks-10.05\src\plugins\debuggergdb\debuggergdb.cpp

Needs some more #ifndef __WXMSW__  replacements of   #ifdef __WXGTK__
around the other 2 "linux" specific blocks.
    #ifdef __WXGTK__
    // kill any linux console


and
   #ifdef __WXGTK__
    // create xterm and issue tty "/dev/pts/#" to GDB where
    // # is the tty for the newly created xterm
   
    Also the fail case here needs to set something to suppress the start of GDB
    when a terminal failed to create. Namely, the case  RunNixConsole < 0.
    Currently if the terminal does not start but  GDB does anyway.
    Then it never terminates and does not respond to the Stop Debugger
    button on the menu. This propagates also out to a few more warnings about the
    dubgger not stopped even when closing the IDE.
   
    Possibly the thing to do is to test and return -1 if RunNixConsole is <0.
    This would match the case about 8 lines above after the  wxMilliSleep wait for 
        // start polling gdb's output
        ...
        if (!m_State.HasDriver())
        return -1;
   
 
 As in my prior message,http://forums.codeblocks.org/index.php/topic,12856.0.html
 I would like a conditionally longer wait for NiX terminal start.  - How about similar to the
 xwMillisleep wait above.
 
 replace: in routine int DebuggerGDB::RunNixConsole()
     // Issue the PS command to get the /dev/tty device name
     // First, wait for the xterm to settle down, else PS won't see the sleep task
     Manager::Yield();
     ::wxSleep(1);
     m_ConsoleTty = GetConsoleTty(m_nConsolePid);

with:
     // Issue the PS command to get the /dev/tty device name
     // First, wait for the xterm to settle down, else PS won't see the sleep task
    int i = 20;  // wait up to 20 ( half seconds ) for the terminal to start before failing
    while (i)
    {
        Manager::Yield();
        wxMilliSleep(500);  // half second
        Manager::Yield();
        --i;
        m_ConsoleTty = GetConsoleTty(m_nConsolePid);
        if (not m_ConsoleTty.IsEmpty() ) i = 0;
    }
 
 
 Thanks  William
   

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12122
    • Travis build status
Re: No console output window while debugging console app on Mac OS X
« Reply #23 on: July 08, 2010, 08:58:06 am »
Thanks for the suggestions, I'll implement the waiting for the terminal some day,
but this will happen in the debugger branch, there the code is a bit different.
Of course patches against the debugger branch are welcome ( svn diff > file.patch).

Here is the branch: http://svn.berlios.de/wsvn/codeblocks/branches/wxpropgrid_debugger/?rev=6384&peg=6384#ab1bb068457ecc925a5b07fe41a91d401
If you can give some feedback it will be great.

p.s. Please use [ code ] [/ code ] tags, your post are hardly readable.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]