Author Topic: Have GDB run in terminal?  (Read 11532 times)

Offline pubby8

  • Single posting newcomer
  • *
  • Posts: 9
Have GDB run in terminal?
« on: August 18, 2011, 02:09:30 am »
On windows when I start the debugger, it opens a CMD window and shows the output there.
On linux, it displays it on the "logs" section, however I would like to have it open in a new terminal window.

How can I do this? Thanks.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Have GDB run in terminal?
« Reply #1 on: August 18, 2011, 08:13:37 am »
Install xterm or search the forum how to setup gnome-terminal as your terminal
(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 pubby8

  • Single posting newcomer
  • *
  • Posts: 9
Re: Have GDB run in terminal?
« Reply #2 on: August 18, 2011, 11:07:18 pm »
I already got xfce terminal to work - it just isn't working for the debugger.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Have GDB run in terminal?
« Reply #3 on: August 18, 2011, 11:08:57 pm »
Build->Run shows your terminal, but Debug->Start doesn't?
(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 pubby8

  • Single posting newcomer
  • *
  • Posts: 9
Re: Have GDB run in terminal?
« Reply #4 on: August 19, 2011, 05:46:36 am »
Build->Run opens a terminal and displays "hello world"
Debug->Start displays "hello world" in the debugger tab of the logs & others window. I want it to open a terminal instead.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Have GDB run in terminal?
« Reply #5 on: August 19, 2011, 08:17:50 am »
Please check the settings in "Project -> Properties -> Build targets -> [theTarget] -> Type".
If it is not console application, it will not work.

If it is correct, please turn on the debuggers debug log  in "Settings -> Compiler and debugger -> Debgger settings" and post the content here (in code-tags).

Offline pubby8

  • Single posting newcomer
  • *
  • Posts: 9
Re: Have GDB run in terminal?
« Reply #6 on: August 20, 2011, 10:18:47 pm »
It won't let me copy/paste it.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Have GDB run in terminal?
« Reply #7 on: August 20, 2011, 11:18:40 pm »
Right click -> copy selection or copy all
(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 Somewho

  • Single posting newcomer
  • *
  • Posts: 5
Re: Have GDB run in terminal?
« Reply #8 on: October 27, 2011, 09:43:33 pm »
Hi. First of all, I'm new to Linux :)
I have Zenwalk 7.0 with XFCE, and I've installed Code::Blocks. I switched my terminal from Xorg's "xterm" to XFCE's "terminal". But it wasn't easy to resolve the same problem, as topicstarter's.
All works fine after I changed terminal command from "terminal --title=$TITLE -x" to just "terminal -x". Debugger's terminal wasn't launching just because he hadn't title. Is it planned or what?
I'm posting this just because it can be helpful for some linux novice like me :)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Have GDB run in terminal?
« Reply #9 on: October 28, 2011, 12:44:33 am »
So the problem is that $TITLE is empty?
(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 Somewho

  • Single posting newcomer
  • *
  • Posts: 5
Re: Have GDB run in terminal?
« Reply #10 on: October 28, 2011, 02:16:48 am »
It's not 100% true to say that problem is in $TITLE. When I used xterm, it correctly uderstood $TITLE for debug also. But I had ^H there :)
Maybe it's a problem with XFCE's terminal. I don't know exactly.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Have GDB run in terminal?
« Reply #11 on: October 28, 2011, 06:27:12 am »
The different terminals do not share the same commandline arguments.
I don't remember the correct settings for xfce-terminal, because I finally switched to gnome 3 and have removed xfce completetly.
« Last Edit: October 28, 2011, 07:53:39 am by jens »

Offline Somewho

  • Single posting newcomer
  • *
  • Posts: 5
Re: Have GDB run in terminal?
« Reply #12 on: October 28, 2011, 04:14:36 pm »
The different terminals do not share the same commandline arguments.
Yes, I know. But why line "terminal --title=$TITLE -x" works with "Run" and crashes "Debug"? Parameters are same. As far as I know, something wrong (incompatible with xfce's terminal) with debug's $TITLE.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Have GDB run in terminal?
« Reply #13 on: October 28, 2011, 04:28:37 pm »
Does "terminal --title=Test -x sleep 10000" works?
(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 Somewho

  • Single posting newcomer
  • *
  • Posts: 5
Re: Have GDB run in terminal?
« Reply #14 on: October 28, 2011, 04:35:43 pm »
Does "terminal --title=Test -x sleep 10000" works?
It won't work because after "-x" should be adress of executable file to run into terminal. And I haven't fount any analogs for "sleep" option in "terminal -h".

Oh, sorry :) Now I understand what your command means. If I choose "Run", it shows no error, but process exits after 1 sec. And if I choose "Debug", it's running till 1st console input command and waiting while user will enter something. But there is no windows to enter data.
« Last Edit: October 28, 2011, 04:40:52 pm by Somewho »