News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Debugging on OSX: how to set tty

Started by warpino, April 23, 2018, 12:12:11 AM

Previous topic - Next topic

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
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'

and in Settings -> Debugger
I set "Arguments":
--tty=/dev/ttys000

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?
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?
Is this the same if you start it from the command line?
(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!]

warpino

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

w

warpino

QuoteIs this the same if you start it from the command line?

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?
(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!]