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 error

Started by thanhbuu, July 31, 2012, 05:37:20 PM

Previous topic - Next topic

thanhbuu

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!

oBFusCATed

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

thanhbuu

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!

oBFusCATed

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

thanhbuu

#4
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?

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

oBFusCATed

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

thanhbuu

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 :(

oBFusCATed

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

Jenna

Quote from: thanhbuu 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 :(
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.

thanhbuu

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!

thanhbuu

Somebody please help me. I think this is the common error in Codeblocks in ubuntu :)

Jenna

Quote from: thanhbuu on August 03, 2012, 01:45:21 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

thanhbuu

Thank you! Problem solved :)

northcamel

How can you slove the warning "warning: GDB: Failed to set controlling terminal: Operation not permitted"?

oBFusCATed

Quote from: northcamel on September 17, 2012, 04:53:21 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!]