Author Topic: initscr() and gdb problem  (Read 7180 times)

Offline Hirogens

  • Multiple posting newcomer
  • *
  • Posts: 17
initscr() and gdb problem
« on: August 09, 2011, 12:35:49 pm »
Hi,

I have ported my application to Debian.

Codeblocks work
My application work under linux

but if I want debug (gdb) , the my application Exit at the init of curses "initscr()"
the rapid message, said  "error opening terminal, unkown"



For Info,

gdb:
  Installed: 7.0.1-2+b1
  Candidate: 7.0.1-2+b1
  Version table:
codeblocks:
  Installed: 10.05dbg7289-1
  Candidate: 10.05dbg7289-1
  Version table:


Only on debug

B.Regards

« Last Edit: August 09, 2011, 01:19:05 pm by Hirogens »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: initscr() and gdb problem
« Reply #1 on: August 09, 2011, 01:39:08 pm »
Does it happen if you use gdb on 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!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: initscr() and gdb problem
« Reply #2 on: August 09, 2011, 01:47:01 pm »
Searching the web shows, that it seems to be a problem of gdb, not of C::B.

And searching also leads to an answer from this forum (just a workaround, not a real solution):
http://forums.codeblocks.org/index.php/topic,8810.msg100996.html#msg100996

Offline Hirogens

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: initscr() and gdb problem
« Reply #3 on: August 09, 2011, 02:06:22 pm »
Hi,

I have just found a another solution.

I don't start Codeblock by Gnome menu.

I start an root terminal and i type "codeblock>nul&"

and now It work...


B.Regards


Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: initscr() and gdb problem
« Reply #4 on: August 09, 2011, 02:44:02 pm »
Hi,

I have just found a another solution.

I don't start Codeblock by Gnome menu.

I start an root terminal and i type "codeblock>nul&"

and now It work...


B.Regards


It's nearly the same, you start from a console.
It's generally not a good idea to work as root, especially if you do programming, unless you are absolutely sure you know what you do.
In short, don't use the root terminal, use "normal" terminal.

Offline Hirogens

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: initscr() and gdb problem
« Reply #5 on: August 09, 2011, 03:08:51 pm »
Hi,

I'm absolutely sure I know what I do (20 years under linux/minix)^^

and my Debian is under VmWare on my Seven^^

If I start in "normal" terminal I have the same problem.

so, but now I can debug.

B.Regard

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: initscr() and gdb problem
« Reply #6 on: August 10, 2011, 11:56:47 am »
I'm absolutely sure I know what I do (20 years under linux/minix)^^
I start an root terminal and i type "codeblock>nul&"

Why do you use wrong syntax, with that background ?

First: the executable is named codeblocks (surely a typo),
second: nul is not a valid device in linux, but (if I remember correctly) on windows, you write in a file named nul,
third, why do you move C::B in the background, is there any reason for doing so ?

What I can say: if C::B is started from a console (or more exactly: from inside a virtual terminal started by me as normal-user) it is no problem to debug ncurses on my debian machine(s).

And if working as root is absolutely necessary, it's (in most cases) better to run the commands with sudo instead of using a root-terminal, where each command runs with root-privileges, because it's less error-prone.
But that's just my opinion, after (also) 20 years under linux, hp-unx, sinix, dos and windows.