User forums > General (but related to Code::Blocks)

Debugging on OSX: how to set tty

(1/1)

warpino:
Hi all,

I managed to build the latest svn of Code::Blocks and of the FortranProject plugin.
It is working! I am debugging a fortran project using the Intel debugger gdb-ia
coming with the Intel Fortran Compiler.
While debugging, in order to have to program output on an iTerm window I did the following:

in Environment settings -> General settings
I set "Terminal to launch console programs:" as

--- Code: ---osascript -e 'tell app "iTerm"' -e 'create window with default profile' -e 'tell current session of window 1 to write text "$SCRIPT"' -e 'end tell'
--- End code ---

and in Settings -> Debugger
I set "Arguments":

--- Code: -----tty=/dev/ttys000
--- End code ---

But this only works if the iTerm window that is opened actually is /dev/ttys000.
How can I set the ttys number of the gdb --tty option to match that of the window that will be opened?

Thanks for any help,

w

PS: why does the debugger take approx 1 min to start on OSX while it takes less than 1 sec on Linux?

oBFusCATed:

--- Quote from: warpino on April 23, 2018, 12:12:11 am ---But this only works if the iTerm window that is opened actually is /dev/ttys000.
How can I set the ttys number of the gdb --tty option to match that of the window that will be opened?

--- End quote ---
There is a code that tries to detect tty and it then executes the correct gdb command to set the redirection. I guess this code doesn't work correctly on macOS.
Search for console in the code. Probably in cbplugin.cpp or somewhere in debuggergdb/*.cpp.


--- Quote from: warpino on April 23, 2018, 12:12:11 am ---PS: why does the debugger take approx 1 min to start on OSX while it takes less than 1 sec on Linux?

--- End quote ---
Is this the same if you start it from the command line?

warpino:
Er... yes, the code is there in cbplugin.cpp
I have no clue on why it does not work

w

warpino:

--- Quote ---Is this the same if you start it from the command line?
--- End quote ---

It seems that running the debugger from the command line there is no delay whatsoever.

oBFusCATed:
Have you tried to pass the same options cb is passing?

Navigation

[0] Message Index

Go to full version