Author Topic: Console app run/debugging for MacOSX  (Read 11269 times)

Offline bnilsson

  • Almost regular
  • **
  • Posts: 184
Re: Console app run/debugging for MacOSX
« Reply #15 on: December 01, 2006, 04:42:21 pm »
Oh dear..
I started with this at home yesterday, applying the patch.
Today I continued at some spare time at work, forgetting that the patch was not applied here. Sorry!
Now "run" works fine with Terminal, but not debug. Maybe debug/Terminal is not working yet?
-- Ingnorance should not be taken for stupidity --

HW: PowerMac Dual PowerPC G5 2.3Ghz, 1GB RAM OS: MacOSX 10.4.10 Compiler: powerpc-apple-darwin8-gcc-4.0.1

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Console app run/debugging for MacOSX
« Reply #16 on: December 01, 2006, 04:45:25 pm »
There is a debug/Terminal ?  :-o OK, will add that too then :-)

Offline bnilsson

  • Almost regular
  • **
  • Posts: 184
Re: Console app run/debugging for MacOSX
« Reply #17 on: December 02, 2006, 04:34:12 pm »
Checking the "run" function at home, and the test was not successful:
Quote
[Tiger:~] bnilsson% DYLD_LIBRARY_PATH=.:$DYLD_LIBRARY_PATH "/Users/bnilsson/Documents/Programming/Active/CB_projects/dxfcnv/dxfcnv"
tcsh: DYLD_LIBRARY_PATH=.:/Users/bnilsson/lib: Command not found.
The only difference being that here I use /bin/tcsh and at work I use /bin/bash as shell in my user setup. After changing ny shell to /bin/bash it worked.

Seems it is sensitive to the shell used.
I tried different shells in the "Environment" setting "Shell to run commands in", but there was no difference.
Is it not active?

-- Ingnorance should not be taken for stupidity --

HW: PowerMac Dual PowerPC G5 2.3Ghz, 1GB RAM OS: MacOSX 10.4.10 Compiler: powerpc-apple-darwin8-gcc-4.0.1

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Console app run/debugging for MacOSX
« Reply #18 on: December 02, 2006, 05:11:30 pm »
The only difference being that here I use /bin/tcsh and at work I use /bin/bash as shell in my user setup. After changing ny shell to /bin/bash it worked. Seems it is sensitive to the shell used.

Tcsh/csh is not supported at the moment. (I wouldn't recommend it to anyone, either)
However, if you supply the syntax it can be made into an Terminal syntax option or so ?

Code: Text
  1. setenv DYLD_LIBRARY_PATH ".:$DYLD_LIBRARY_PATH";
  2. "/Users/bnilsson/Documents/Programming/Active/CB_projects/dxfcnv/dxfcnv"

Quote
I tried different shells in the "Environment" setting "Shell to run commands in", but there was no difference.
Is it not active?

I believe the current "shell" setting is only used in variable expansion, running tools, etc.

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Console app run/debugging for MacOSX
« Reply #19 on: December 04, 2006, 05:57:09 pm »
Would this (new) code work for you:
Code: [Select]
#if defined(__APPLE__) && defined(__MACH__)
    #define LIBRARY_ENVVAR "DYLD_LIBRARY_PATH"
#else
    #define LIBRARY_ENVVAR "LD_LIBRARY_PATH"
#endif
        wxString shell;
        wxGetEnv(_T("SHELL"), &shell);
        if (shell.Contains(_T("csh")))
            command << _T("'") << _T("setenv " LIBRARY_ENVVAR " .:$" LIBRARY_ENVVAR " &&") << _T(" ");
        else
            command << _T("'") << _T("" LIBRARY_ENVVAR "=.:$" LIBRARY_ENVVAR) << _T(" ");

It should use setenv for csh and tcsh.

Offline bnilsson

  • Almost regular
  • **
  • Posts: 184
Re: Console app run/debugging for MacOSX
« Reply #20 on: December 04, 2006, 06:41:03 pm »
I will try it.
However, the arguments against /bin/tcsh are strong, so I changed to /bin/bash.
But I will try it with /bin/tcsh, it's easy to switch.

Any progress with the console Terminal debugger?

-- Ingnorance should not be taken for stupidity --

HW: PowerMac Dual PowerPC G5 2.3Ghz, 1GB RAM OS: MacOSX 10.4.10 Compiler: powerpc-apple-darwin8-gcc-4.0.1

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Console app run/debugging for MacOSX
« Reply #21 on: December 04, 2006, 07:51:06 pm »
I will try it.
However, the arguments against /bin/tcsh are strong, so I changed to /bin/bash.
But I will try it with /bin/tcsh, it's easy to switch.

Actually there are systems aside from Mac OS X 10.2 that ships with csh as their default shell (PC-BSD did, for instance), so it doesn't hurt to add a feature to support it. Just that I don't like it myself :-)

I'm normally using zsh, so a little choice never hurts.

Quote
Any progress with the console Terminal debugger?

I have Build > Run, and I have Debug > Start. What I am looking at for the "console debugger" ?

Did you have some simple steps to test/reproduce the issue, and I'm sure it could be fixed as well.

Offline bnilsson

  • Almost regular
  • **
  • Posts: 184
Re: Console app run/debugging for MacOSX
« Reply #22 on: December 17, 2006, 12:11:34 pm »
What I would ask for is the same behaviour as Run, i.e. to be able to communicate with the app via the Terminal keyboard, but being able to use breakpoints and watches to debug the session.

Right now, l if I start a debug session for a console app, no terminal window appears so I cannot use interactive mode in controlling the application.

 
-- Ingnorance should not be taken for stupidity --

HW: PowerMac Dual PowerPC G5 2.3Ghz, 1GB RAM OS: MacOSX 10.4.10 Compiler: powerpc-apple-darwin8-gcc-4.0.1

Offline bnilsson

  • Almost regular
  • **
  • Posts: 184
Re: Console app run/debugging for MacOSX
« Reply #23 on: December 17, 2006, 12:25:41 pm »
Regarding the above suggestion:
Quote
Would this (new) code work for you:
Could you please tell me exactly where to put this in?
I assume it is in compilergcc.cpp, but this file may be revised to the extent that the pattern does not look the same now, since I did not respond right away.
-- Ingnorance should not be taken for stupidity --

HW: PowerMac Dual PowerPC G5 2.3Ghz, 1GB RAM OS: MacOSX 10.4.10 Compiler: powerpc-apple-darwin8-gcc-4.0.1

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Console app run/debugging for MacOSX
« Reply #24 on: December 18, 2006, 12:36:12 pm »
I'll post a revised snippet, just a little busy with wx 2.8.0 first...

I think the support for Terminal.app and /bin/csh should be able
to go right in, but will update and test with a newer Code::Blocks