Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Linux terminal as Debug console(How to use linux terminal as debug console)
Linux terminal as Debug console [message #1835737] Fri, 11 December 2020 06:50 Go to next message
Neeraj Chimwal is currently offline Neeraj ChimwalFriend
Messages: 2
Registered: December 2020
Junior Member
Hello. I am new to eclipse and I want my linux terminal to display input/output while debugging my C code.
I couldn't find the solution anywhere.
Any help is appreciated
Re: Linux terminal as Debug console [message #1835749 is a reply to message #1835737] Fri, 11 December 2020 12:38 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
You probably want to start it in a terminal then attach to it.
The program's output will go to wherever it was originally directed.
It's possible to change this (in Linux anyway) but that's a different topic.
You should understand what that means when running gdb.

https://sourceware.org/gdb/onlinedocs/gdb/Input_002fOutput.html
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/developer_guide/debugging-running-application
for more: google gdb attach to running process stdout example

In Eclipse there is a run/debug configuration called: C/C++ Attach to Application
It's similar the C/C++ Application but obviously doesn't have the Arguments and Environment tabs.
Here's the eclipse wiki on debugging: https://wiki.eclipse.org/CDT/User/FAQ#Debugging_C.2FC.2B.2B_Projects

Note: the program will run until you attach so unless your code takes this into account by waiting until you attach you can't debug from its start.


Previous Topic:Debugging issue
Next Topic:Writing data into a txt file, C
Goto Forum:
  


Current Time: Tue Oct 08 00:05:05 GMT 2024

Powered by FUDForum. Page generated in 0.03640 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top