Recent

Author Topic: Ubuntu no console window with gdb on no debug if gdb off  (Read 2469 times)

Sohen

  • New member
  • *
  • Posts: 5
Ubuntu no console window with gdb on no debug if gdb off
« on: November 05, 2021, 04:43:14 am »
I'm trying to get Lazarus configured correctly on my linux box and I've run into a snag. I can't get both debugging and the output console windows to run at the same time.  If I enable debugging (gdb) under Tools->Options->Debugging->General. I don't get a console window on Ubuntu.  It "seems" to be debugging but I can't see the console.  If i turn off debugging the console window appears but now i can't debug.

I guess i should say I'm writing just console applications using the template in lazarus and I've enabled debugging on project options as well its set to automatic.

Any pointers in the right direction?  Just trying to get the ide working like i know it can (have used in windows).
« Last Edit: November 06, 2021, 12:15:36 am by Sohen »

dbannon

  • Hero Member
  • *****
  • Posts: 1792
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Ubuntu no console window with gdb on no debug if gdb off
« Reply #1 on: November 05, 2021, 06:00:03 am »
Just to be clear here.

In the IDE, you click View->Debug Windows->ConsoleIn/Out and the console window does not open ?  Or it opens but you don't see any output in it ?

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

Sohen

  • New member
  • *
  • Posts: 5
Re: Ubuntu no console window with gdb on no debug if gdb off
« Reply #2 on: November 05, 2021, 07:31:51 am »
Just to be clear here.

In the IDE, you click View->Debug Windows->ConsoleIn/Out and the console window does not open ?  Or it opens but you don't see any output in it ?

Davo


THANK YOU! !!!!

When I follow your process with gdb running I do indeed get the console output. 

You have no idea how hard this has been to debug!

Well I am an idiot, didn't even know that existed. I was expecting lazarus to open my normal terminal like it did in windows.  This works just fine. 

Cheers!
« Last Edit: November 05, 2021, 07:34:54 am by Sohen »

dbannon

  • Hero Member
  • *****
  • Posts: 1792
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Ubuntu no console window with gdb on no debug if gdb off
« Reply #3 on: November 05, 2021, 11:54:32 am »
Welcome to Linux, a little bit different !

You will soon come to love it !

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

MarkMLl

  • Hero Member
  • *****
  • Posts: 3658
Re: Ubuntu no console window with gdb on no debug if gdb off
« Reply #4 on: November 05, 2021, 12:02:56 pm »
When I follow your process with gdb running I do indeed get the console output. 

You have no idea how hard this has been to debug!

Well I am an idiot, didn't even know that existed. I was expecting lazarus to open my normal terminal like it did in windows.  This works just fine. 

An alternative is to start the program in a normal shell session, and then use the IDE's Run -> Attach ro program... facility. In both cases be careful about reading too much into spurious line breaks: the IDE is very much at the mercy of how gdb behaves.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

jujibo

  • Jr. Member
  • **
  • Posts: 99
Re: Ubuntu no console window with gdb on no debug if gdb off
« Reply #5 on: November 05, 2021, 12:46:09 pm »
You also can press Ctrl+Alt+o  to show the input/output console

PascalDragon

  • Hero Member
  • *****
  • Posts: 3639
  • Compiler Developer
Re: Ubuntu no console window with gdb on no debug if gdb off
« Reply #6 on: November 05, 2021, 01:12:08 pm »
I was expecting lazarus to open my normal terminal like it did in windows.

On Windows this works, because there the executable has a flag that tells the OS whether a console is required or not (and Windows will then open a console window if necessary). For other operating systems there is no such flag and thus Lazarus doesn't automatically open its own console window, because it can't tell whether it's necessary or not.

 

TinyPortal © 2005-2018