Author Topic: Debugging error  (Read 10814 times)

Offline thanhbuu

  • Multiple posting newcomer
  • *
  • Posts: 24
Debugging error
« on: July 31, 2012, 05:37:20 pm »
http://www.flickr.com/photos/50914177@N02/7684695908/in/photostream
As you can see in the picture in the link. I have run to line 44, it must output number in line 43 but I can't see it, I think it is because the error above: "warning: GDB: Failed to set controlling terminal: Operation not permitted".
I have searched google for this error but I found there is no topic can solve this :( Could somebody help me with this problem?
Your help is appreciated !!! Thank you!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugging error
« Reply #1 on: July 31, 2012, 05:47:57 pm »
Read this please: http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks

Also keep in mind that the warning is quite harmless, it is something else causing you problems.
(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 thanhbuu

  • Multiple posting newcomer
  • *
  • Posts: 24
Re: Debugging error
« Reply #2 on: August 01, 2012, 05:53:48 am »
Thanks for replying,
I'm still stuck with this problem. I just have installed ubuntu on my system and then codeblocks is the first one I installed on ubuntu so I think your "something else" is not possible :( Can you suggest more solution, thank you!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugging error
« Reply #3 on: August 01, 2012, 09:09:22 am »
How can I give you sollution without the log from the debugger?
Does it work from the command line?
Are you sure you have not optimizations or the stripping options enabled?
(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 thanhbuu

  • Multiple posting newcomer
  • *
  • Posts: 24
Re: Debugging error
« Reply #4 on: August 01, 2012, 05:28:18 pm »
1. Here is the best I can do. Is it the log file that you want or can you show me how to do it?
Code
-------------- Clean: Debug in CodeBlocks_U (compiler: GNU GCC Compiler)---------------
-------------- Build: Debug in CodeBlocks_U (compiler: GNU GCC Compiler)---------------
g++ -Wall -g -fexceptions  -g     -c /media/DATA1/CodeBlocks_U/PTREE.cpp -o obj/Debug/PTREE.o
g++  -o bin/Debug/CodeBlocks_U obj/Debug/PTREE.o    
Output size is 54.40 KB
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings (0 minutes, 0 seconds)
-------------- Build: Debug in CodeBlocks_U (compiler: GNU GCC Compiler)---------------
Target is up to date.
Nothing to be done (all items are up-to-date).

2. I don't understand what you mean. Do you mean this? http://wiki.codeblocks.org/index.php?title=Code::Blocks_command_line_arguments If yes then it also warned the same and didn't show anything.
3. I'm sure about this.
« Last Edit: August 01, 2012, 05:30:45 pm by thanhbuu »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugging error
« Reply #5 on: August 01, 2012, 07:28:36 pm »
1. This is not the log from the debugger, but the compiler
2. Start a terminal and run gdb your_app, then put breakpoints and see if the problem is the same.
3. Yes, it seems there are no optimizations.
(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 thanhbuu

  • Multiple posting newcomer
  • *
  • Posts: 24
Re: Debugging error
« Reply #6 on: August 01, 2012, 08:12:39 pm »
http://www.flickr.com/photos/50914177@N02/7692625838/in/photostream
Sorry but as in the picture in the given link but no it didn't show anything :(

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugging error
« Reply #7 on: August 01, 2012, 10:23:35 pm »
Cannot compute...
(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: Debugging error
« Reply #8 on: August 01, 2012, 11:33:37 pm »
http://www.flickr.com/photos/50914177@N02/7692625838/in/photostream
Sorry but as in the picture in the given link but no it didn't show anything :(
Why do you expect C::B's debug log to show anything, if you run gdb from commandline ?

The picture in your first post shows the Debugger's log and it shows clearly some output there.

And don't forget to check the option "Full (Debug) Log" in the debugger settings.

Offline thanhbuu

  • Multiple posting newcomer
  • *
  • Posts: 24
Re: Debugging error
« Reply #9 on: August 02, 2012, 04:35:35 am »
Fortunately, when I look around, I changed to "printf("%d\n", u)", it works. But printf("%d', u) it doesn't work. Maybe this is the whole problem. Could you explain me or how to fix it? Thank you!

Offline thanhbuu

  • Multiple posting newcomer
  • *
  • Posts: 24
Re: Debugging error
« Reply #10 on: August 03, 2012, 01:45:21 pm »
Somebody please help me. I think this is the common error in Codeblocks in ubuntu :)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Debugging error
« Reply #11 on: August 03, 2012, 02:19:33 pm »
Somebody please help me. I think this is the common error in Codeblocks in ubuntu :)
No it's not, it's the compiler and not C::B.

Read (e.g.) this:
http://stackoverflow.com/questions/1716296/why-does-printf-not-flush-after-the-call-unless-a-newline-is-in-the-format-strin

Offline thanhbuu

  • Multiple posting newcomer
  • *
  • Posts: 24
Re: Debugging error
« Reply #12 on: August 03, 2012, 05:45:12 pm »
Thank you! Problem solved :)

northcamel

  • Guest
Re: Debugging error
« Reply #13 on: September 17, 2012, 04:53:21 pm »
How can you slove the warning "warning: GDB: Failed to set controlling terminal: Operation not permitted"?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugging error
« Reply #14 on: September 17, 2012, 07:49:31 pm »
How can you slove the warning "warning: GDB: Failed to set controlling terminal: Operation not permitted"?
Modify the source of gdb and recompile it. Or the best options - just ignore it.
(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!]