Author Topic: Ubuntu Mate console debugger doesn't print  (Read 7224 times)

Offline rbksouls

  • Multiple posting newcomer
  • *
  • Posts: 12
Ubuntu Mate console debugger doesn't print
« on: May 23, 2017, 01:27:34 pm »
I'm new at Linux and i recently installed codeblocks, i'm programming a new project in c (console program) but when i open the debugger it opens the console window and show the watches and everything but by pressing F7 to run a step it doesn't print the line (for example a printf...)  in the console.
someone help me please. (sorry for my english).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Ubuntu Mate console debugger doesn't print
« Reply #1 on: May 23, 2017, 08:15:41 pm »
What do you mean by console?
My guess is you're talking about the debug log window inside codeblocks, aren't you?
(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 rbksouls

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Ubuntu Mate console debugger doesn't print
« Reply #2 on: May 23, 2017, 09:07:04 pm »
i mean the shell that's displayed when u press F8 (debug),
the black console which shows the execution of the lines
The problem is that it doesn't show the execution, it just remains black but i can continue running into next step and see the watches.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Ubuntu Mate console debugger doesn't print
« Reply #3 on: May 23, 2017, 09:29:56 pm »
Can you show the full debugger log then?
You have to enable it in the debugger settings.
Which terminal are you using?
(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 rbksouls

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Ubuntu Mate console debugger doesn't print
« Reply #4 on: May 23, 2017, 10:10:50 pm »


theese two images show the problem, i can press F7 but nothing is displayed in the console




theese are the debugger settings

And i'm using xterm but i've tried to use gnome or konsole but they don't open any shell to see the execution.

« Last Edit: May 23, 2017, 10:16:03 pm by rbksouls »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Ubuntu Mate console debugger doesn't print
« Reply #5 on: May 23, 2017, 11:08:25 pm »
I don't see the debugger log! Please copy paste it inside code tags or pastebin link.
The log can be found in the "Logs & others" panel.

Also does printing to the terminal works if you run the program (Build -> Run menu) instead of trying to debug 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!]

Offline rbksouls

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Ubuntu Mate console debugger doesn't print
« Reply #6 on: May 23, 2017, 11:21:53 pm »
Code
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: /home/luis/Escritorio/programacion/taller/
Adding source dir: /home/luis/Escritorio/programacion/taller/
Adding file: /home/luis/Escritorio/programacion/taller/bin/Debug/taller
Changing directory to: /home/luis/Escritorio/programacion/taller/.
Set variable: LD_LIBRARY_PATH=.:

[debug]Command-line: /usr/bin/gdb -nx -fullname -quiet  -args /home/luis/Escritorio/programacion/taller/bin/Debug/taller
[debug]Working dir : /home/luis/Escritorio/programacion/taller

Starting debugger: /usr/bin/gdb -nx -fullname -quiet  -args /home/luis/Escritorio/programacion/taller/bin/Debug/taller
done

[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints

[debug]Using terminal's PID as console PID 3400, TTY /dev/pts/0
[debug]Queued:[tty /dev/pts/0]
[debug]Leyendo símbolos desde /home/luis/Escritorio/programacion/taller/bin/Debug/taller...
[debug]hecho.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (Ubuntu 7.12.50.20170314-0ubuntu1) 7.12.50.20170314-git
[debug]Copyright (C) 2017 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "i686-linux-gnu".
[debug]Type "show configuration" for configuration details.
[debug]Para las instrucciones de informe de errores, vea:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]<http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (Ubuntu 7.12.50.20170314-0ubuntu1) 7.12.50.20170314-git

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor intel
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Punto de captura 1 (lanzar)
[debug]>>>>>>cb_gdb:
[debug]> source /usr/share/codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory /home/luis/Escritorio/programacion/taller/
[debug]Source directories searched: /home/luis/Escritorio/programacion/taller:$cdir:$cwd
[debug]>>>>>>cb_gdb:
[debug]> break "/home/luis/Escritorio/programacion/taller/main.c:219"
[debug]Punto de interrupción 2 at 0x8048eca: file /home/luis/Escritorio/programacion/taller/main.c, line 219.
[debug]>>>>>>cb_gdb:

Punto de interrupción 2 at 0x8048eca: file /home/luis/Escritorio/programacion/taller/main.c, line 219.

[debug]> break "/home/luis/Escritorio/programacion/taller/main.c:142"
[debug]Punto de interrupción 3 at 0x8048ab8: file /home/luis/Escritorio/programacion/taller/main.c, line 142.
[debug]>>>>>>cb_gdb:

Punto de interrupción 3 at 0x8048ab8: file /home/luis/Escritorio/programacion/taller/main.c, line 142.

[debug]> break "/home/luis/Escritorio/programacion/taller/main.c:141"
[debug]Punto de interrupción 4 at 0x8048a9e: file /home/luis/Escritorio/programacion/taller/main.c, line 141.
[debug]>>>>>>cb_gdb:

Punto de interrupción 4 at 0x8048a9e: file /home/luis/Escritorio/programacion/taller/main.c, line 141.

[debug]> break "/home/luis/Escritorio/programacion/taller/main.c:130"
[debug]Punto de interrupción 5 at 0x8048a37: file /home/luis/Escritorio/programacion/taller/main.c, line 130.
[debug]>>>>>>cb_gdb:

Punto de interrupción 5 at 0x8048a37: file /home/luis/Escritorio/programacion/taller/main.c, line 130.

[debug]> break "/home/luis/Escritorio/programacion/taller/main.c:129"
[debug]Punto de interrupción 6 at 0x8048a28: file /home/luis/Escritorio/programacion/taller/main.c, line 129.
[debug]>>>>>>cb_gdb:

Punto de interrupción 6 at 0x8048a28: file /home/luis/Escritorio/programacion/taller/main.c, line 129.

[debug]> break "/home/luis/Escritorio/programacion/taller/main.c:120"
[debug]Punto de interrupción 7 at 0x80489ed: file /home/luis/Escritorio/programacion/taller/main.c, line 120.
[debug]>>>>>>cb_gdb:

Punto de interrupción 7 at 0x80489ed: file /home/luis/Escritorio/programacion/taller/main.c, line 120.

[debug]> break "/home/luis/Escritorio/programacion/taller/main.c:119"
[debug]Punto de interrupción 8 at 0x80489de: file /home/luis/Escritorio/programacion/taller/main.c, line 119.
[debug]>>>>>>cb_gdb:

Punto de interrupción 8 at 0x80489de: file /home/luis/Escritorio/programacion/taller/main.c, line 119.

[debug]> break "/home/luis/Escritorio/programacion/taller/main.c:115"
[debug]Punto de interrupción 9 at 0x80489bc: file /home/luis/Escritorio/programacion/taller/main.c, line 115.
[debug]>>>>>>cb_gdb:

Punto de interrupción 9 at 0x80489bc: file /home/luis/Escritorio/programacion/taller/main.c, line 115.

[debug]> break "/home/luis/Escritorio/programacion/taller/main.c:114"
[debug]Punto de interrupción 10 at 0x80489b1: file /home/luis/Escritorio/programacion/taller/main.c, line 114.
[debug]>>>>>>cb_gdb:

Punto de interrupción 10 at 0x80489b1: file /home/luis/Escritorio/programacion/taller/main.c, line 114.

[debug]> break "/home/luis/Escritorio/programacion/taller/main.c:103"
[debug]Punto de interrupción 11 at 0x804894b: file /home/luis/Escritorio/programacion/taller/main.c, line 103.
[debug]>>>>>>cb_gdb:

Punto de interrupción 11 at 0x804894b: file /home/luis/Escritorio/programacion/taller/main.c, line 103.

[debug]> break "/home/luis/Escritorio/programacion/taller/main.c:102"
[debug]Punto de interrupción 12 at 0x8048941: file /home/luis/Escritorio/programacion/taller/main.c, line 102.
[debug]>>>>>>cb_gdb:

Punto de interrupción 12 at 0x8048941: file /home/luis/Escritorio/programacion/taller/main.c, line 102.

[debug]> break "/home/luis/Escritorio/programacion/taller/main.c:76"
[debug]Punto de interrupción 13 at 0x8048830: file /home/luis/Escritorio/programacion/taller/main.c, line 76.
[debug]>>>>>>cb_gdb:

Punto de interrupción 13 at 0x8048830: file /home/luis/Escritorio/programacion/taller/main.c, line 76.

[debug]> break "/home/luis/Escritorio/programacion/taller/main.c:75"
[debug]Punto de interrupción 14 at 0x8048828: file /home/luis/Escritorio/programacion/taller/main.c, line 75.
[debug]>>>>>>cb_gdb:

Punto de interrupción 14 at 0x8048828: file /home/luis/Escritorio/programacion/taller/main.c, line 75.

[debug]> break "/home/luis/Escritorio/programacion/taller/main.c:70"
[debug]Punto de interrupción 15 at 0x8048809: file /home/luis/Escritorio/programacion/taller/main.c, line 70.
[debug]>>>>>>cb_gdb:

Punto de interrupción 15 at 0x8048809: file /home/luis/Escritorio/programacion/taller/main.c, line 70.

[debug]> break "/home/luis/Escritorio/programacion/taller/main.c:69"
[debug]Punto de interrupción 16 at 0x8048800: file /home/luis/Escritorio/programacion/taller/main.c, line 69.
[debug]>>>>>>cb_gdb:

Punto de interrupción 16 at 0x8048800: file /home/luis/Escritorio/programacion/taller/main.c, line 69.

[debug]> break "/home/luis/Escritorio/programacion/taller/main.c:62"
[debug]Punto de interrupción 17 at 0x80487e4: file /home/luis/Escritorio/programacion/taller/main.c, line 62.
[debug]>>>>>>cb_gdb:

Punto de interrupción 17 at 0x80487e4: file /home/luis/Escritorio/programacion/taller/main.c, line 62.

[debug]> break "/home/luis/Escritorio/programacion/taller/main.c:60"
[debug]Punto de interrupción 18 at 0x80487db: file /home/luis/Escritorio/programacion/taller/main.c, line 60.
[debug]>>>>>>cb_gdb:

Punto de interrupción 18 at 0x80487db: file /home/luis/Escritorio/programacion/taller/main.c, line 60.

[debug]> break "/home/luis/Escritorio/programacion/taller/main.c:52"
[debug]Punto de interrupción 19 at 0x804879b: file /home/luis/Escritorio/programacion/taller/main.c, line 52.
[debug]>>>>>>cb_gdb:

Punto de interrupción 19 at 0x804879b: file /home/luis/Escritorio/programacion/taller/main.c, line 52.

[debug]> break "/home/luis/Escritorio/programacion/taller/main.c:51"
[debug]Punto de interrupción 20 at 0x804877c: file /home/luis/Escritorio/programacion/taller/main.c, line 51.
[debug]>>>>>>cb_gdb:

Punto de interrupción 20 at 0x804877c: file /home/luis/Escritorio/programacion/taller/main.c, line 51.

[debug]> break "/home/luis/Escritorio/programacion/taller/main.c:16"
[debug]Punto de interrupción 21 at 0x804865c: file /home/luis/Escritorio/programacion/taller/main.c, line 16.
[debug]>>>>>>cb_gdb:

Punto de interrupción 21 at 0x804865c: file /home/luis/Escritorio/programacion/taller/main.c, line 16.

[debug]> tty /dev/pts/0
[debug]orden indefinida: «tty». Intente con «help»
[debug]>>>>>>cb_gdb:

orden indefinida: «tty». Intente con «help»

[debug]> run
[debug]Starting program: /home/luis/Escritorio/programacion/taller/bin/Debug/taller
[debug]Breakpoint 21, main () at /home/luis/Escritorio/programacion/taller/main.c:17
[debug]/home/luis/Escritorio/programacion/taller/main.c:17:391:beg:0x804865c
[debug]>>>>>>cb_gdb:

At /home/luis/Escritorio/programacion/taller/main.c:17

[debug]> info locals
[debug]op = -1208250368
[debug]cent = -1207964416
[debug]y = 524288
[debug]adivina = "\377\377\002\000\000\000\200\033\343\267\033\217\004\b\001\000\000\000\344\367\377\277\354\367\377\277"
[debug]actual = "\377\377\002\000\000\000\200\033\343\267\033\217\004\b\001\000\000\000\344\367\377\277\354\367\377\277"
[debug]dichas = "\377\377\002\000\000\000\200\033\343\267\033\217\004\b\001\000\000\000\344\367\377\277\354\367\377\277"
[debug]>>>>>>cb_gdb:
[debug]> info args
[debug]No hay argumentos.
[debug]>>>>>>cb_gdb:
[debug]> next
[debug]/home/luis/Escritorio/programacion/taller/main.c:18:393:beg:0x8048667
[debug]>>>>>>cb_gdb:

At /home/luis/Escritorio/programacion/taller/main.c:18

[debug]> info locals
[debug]op = -1208250368
[debug]cent = -1207964416
[debug]y = 524288
[debug]adivina = "\377\377\002\000\000\000\200\033\343\267\033\217\004\b\001\000\000\000\344\367\377\277\354\367\377\277"
[debug]actual = "\377\377\002\000\000\000\200\033\343\267\033\217\004\b\001\000\000\000\344\367\377\277\354\367\377\277"
[debug]dichas = "\377\377\002\000\000\000\200\033\343\267\033\217\004\b\001\000\000\000\344\367\377\277\354\367\377\277"
[debug]>>>>>>cb_gdb:
[debug]> info args
[debug]No hay argumentos.
[debug]>>>>>>cb_gdb:
[debug]> next
[debug]/home/luis/Escritorio/programacion/taller/main.c:24:572:beg:0x804866e
[debug]>>>>>>cb_gdb:

At /home/luis/Escritorio/programacion/taller/main.c:24

[debug]> info locals
[debug]op = -1208250368
[debug]cent = 0
[debug]y = 524288
[debug]adivina = "\377\377\002\000\000\000\200\033\343\267\033\217\004\b\001\000\000\000\344\367\377\277\354\367\377\277"
[debug]actual = "\377\377\002\000\000\000\200\033\343\267\033\217\004\b\001\000\000\000\344\367\377\277\354\367\377\277"
[debug]dichas = "\377\377\002\000\000\000\200\033\343\267\033\217\004\b\001\000\000\000\344\367\377\277\354\367\377\277"
[debug]>>>>>>cb_gdb:
[debug]> info args
[debug]No hay argumentos.
[debug]>>>>>>cb_gdb:
[debug]> next
[debug]/home/luis/Escritorio/programacion/taller/main.c:25:596:beg:0x8048687
[debug]>>>>>>cb_gdb:

At /home/luis/Escritorio/programacion/taller/main.c:25

[debug]> info locals
[debug]op = -1208250368
[debug]cent = 0
[debug]y = 524288
[debug]adivina = "\377\377\002\000\000\000\200\033\343\267\033\217\004\b\001\000\000\000\344\367\377\277\354\367\377\277"
[debug]actual = "\377\377\002\000\000\000\200\033\343\267\033\217\004\b\001\000\000\000\344\367\377\277\354\367\377\277"
[debug]dichas = "\377\377\002\000\000\000\200\033\343\267\033\217\004\b\001\000\000\000\344\367\377\277\354\367\377\277"
[debug]>>>>>>cb_gdb:
[debug]> info args
[debug]No hay argumentos.
[debug]>>>>>>cb_gdb:
[debug]> next
[debug]Breakpoint 19, cabecera () at /home/luis/Escritorio/programacion/taller/main.c:54
[debug]/home/luis/Escritorio/programacion/taller/main.c:54:1173:beg:0x804879b
[debug]>>>>>>cb_gdb:

At /home/luis/Escritorio/programacion/taller/main.c:54

[debug]> info locals
[debug]No locales.
[debug]>>>>>>cb_gdb:
[debug]> info args
[debug]No hay argumentos.
[debug]>>>>>>cb_gdb:
[debug]> next
[debug]/home/luis/Escritorio/programacion/taller/main.c:55:1230:beg:0x80487ab
[debug]>>>>>>cb_gdb:

At /home/luis/Escritorio/programacion/taller/main.c:55

[debug]> info locals
[debug]No locales.
[debug]>>>>>>cb_gdb:
[debug]> info args
[debug]No hay argumentos.
[debug]>>>>>>cb_gdb:
[debug]> next
[debug]/home/luis/Escritorio/programacion/taller/main.c:56:1264:beg:0x80487bb
[debug]>>>>>>cb_gdb:

At /home/luis/Escritorio/programacion/taller/main.c:56

[debug]> info locals
[debug]No locales.
[debug]>>>>>>cb_gdb:
[debug]> info args
[debug]No hay argumentos.
[debug]>>>>>>cb_gdb:

Offline rbksouls

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Ubuntu Mate console debugger doesn't print
« Reply #7 on: May 23, 2017, 11:23:39 pm »
is this what you mean?
I know i can build it and run it but i want to see where is my code failing and i'm used to use codeblocks' debugger
It's not very important beacause i have other computers but this is my only laptop and i use it at college library so when i have problems with code and i dunno where it is failing i try to find the error with the debugger.
that's why this is annoying, without the console i can't find out where the error is.
Thank you for helping me by the way.. :)
« Last Edit: May 23, 2017, 11:46:46 pm by rbksouls »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Ubuntu Mate console debugger doesn't print
« Reply #8 on: May 24, 2017, 01:54:25 am »
The problem is that you're using non English locale and C::B expects that output from GDB to be in English.

See past discussion about the problem: http://forums.codeblocks.org/index.php/topic,16062.msg108541.html#msg108541
The fix is to use the env vars plugin to reset the locale.
(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 BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Ubuntu Mate console debugger doesn't print
« Reply #9 on: May 24, 2017, 09:36:54 am »
@dev: since the localization problem will only get worse  (more and more linux distris are localized by default now), wouldn't it be the best to set the locale to C by default in the debugger plugin call? Would this also affect the running user program? The best solution would be to switch to gdb/mi, but this will not gonna happen in the near future ;)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Ubuntu Mate console debugger doesn't print
« Reply #10 on: May 24, 2017, 10:06:13 am »
Yes, this is something that needs to be done. We can use "set environment" to restore the locale if we have parsed it. But this is a bit error prone. :(
(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 rbksouls

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Ubuntu Mate console debugger doesn't print
« Reply #11 on: May 24, 2017, 12:27:51 pm »
sooo , if i try to change my locale LANG and everything to English  by default would it works?
i mean modify everything shown if i execute in the shell $ locale
(not manually)---> language support allows me to do it

Offline rbksouls

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Ubuntu Mate console debugger doesn't print
« Reply #12 on: May 24, 2017, 01:36:25 pm »
well i have uninstalled codeblocks -> sudo apt-get --purge remove codeblocks and i've modified  all configuration to set by default english language, then i installed codeblocks again sudo apt-get install codeblocks but it still does the same... i tried LC_ALL=C too but seems it does nothing

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Ubuntu Mate console debugger doesn't print
« Reply #13 on: May 24, 2017, 01:54:30 pm »
well i have uninstalled codeblocks -> sudo apt-get --purge remove codeblocks and i've modified  all configuration to set by default english language, then i installed codeblocks again sudo apt-get install codeblocks but it still does the same... i tried LC_ALL=C too but seems it does nothing
Install the contrib-plugins package, go to "Settings -> Environment -> Environment variables" and add "LC_ALL" with value "C" to the default env-var set.

Offline rbksouls

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Ubuntu Mate console debugger doesn't print
« Reply #14 on: May 24, 2017, 10:46:03 pm »
where are the contrib-plugins package? maybe here ? http://forums.codeblocks.org/index.php/board,14.0.html
and i presume i can install it from manage plugins once it's downloaded or not?
one more thing (sorry i'm noob) when i go to "Settings -> Environment  where are the environment variables?

« Last Edit: May 24, 2017, 10:47:37 pm by rbksouls »