2015-05-18 5 views
9

मैं कंसोल एप्लिकेशन लिखने के लिए क्लियन का उपयोग कर रहा हूं। यदि मैं बस प्रोग्राम चलाता हूं, तो मैं अपने cout कॉल के परिणाम देख सकता हूं। लेकिन अगर मैं इसे डीबग करता हूं, तो मेरे एक्सई के नाम और Process finished with exit code 0 के अलावा डीबग कंसोल टैब के तहत कोई आउटपुट नहीं होता है। क्या क्लोन में डीबग के तहत दिखाने के लिए कंसोल आउटपुट प्राप्त करने के लिए कोई अतिरिक्त कदम है?आप क्लियन में डीबग के तहत कंसोल आउटपुट कैप्चर कैसे करते हैं?

या यह भी क्लियर विशिष्ट नहीं है और यह एक सामान्य बात है जो जीडीबी का उपयोग कर रहे हैं पहले से ही जानते हैं?

उत्तर

-3

जीडीबी एक प्रोग्राम चलाने की प्रक्रिया में हेरफेर करता है।

GDB सत्र का एक उदाहरण:

% cat hello.c 
#include<stdio.h> 

main() { 
    int count; 

    for (count=0;count<10;count++) 
     printf("Hello from CETS!\n"); 
} 

% gcc -g hello.c 
% gdb ./a.out 
GDB is free software and you are welcome to distribute copies of it 
under certain conditions; type "show copying" to see the conditions. 
There is absolutely no warranty for GDB; type "show warranty" for details. 
GDB 4.13 (sparc-sun-solaris2.3), 
Copyright 1994 Free Software Foundation, Inc... 
(gdb) b main 
Breakpoint 1 at 0x10784: file hello.c, line 6. 
(gdb) r 
Starting program: /home1/b/bozo/./a.out 


Breakpoint 1, main() at hello.c:6 
6   for (count=0;count<10;count++) 
(gdb) s 
7    printf("Hello from CETS!\n"); 
(gdb) p count 
$1 = 0 
(gdb) disp count 
1: count = 0 
(gdb) set count=8 
(gdb) s 
Hello from CETS! 
6   for (count=0;count<10;count++) 
1: count = 8 
(gdb) 
7    printf("Hello from CETS!\n"); 
1: count = 9 
(gdb) c 
Continuing. 
Hello from CETS! 

Program exited with code 01. 
(gdb) q 
% 

सामग्री है कि आप के लिए उपयोगी हो सकता है:

http://www.cs.swarthmore.edu/~newhall/unixhelp/howto_gdb.html

http://www.ifp.illinois.edu/~nakazato/tips/xgcc.html#GDB

http://www.seas.upenn.edu/cets/answers/gcc.html

+0

मुझे डर है कि मैं डॉन 'कर रहा हूँ टी वास्तव में नहीं देखते कि यह सवाल का जवाब कैसे देता है। जब आप क्लियन का उपयोग कर रहे हों तो आप जीडीबी के साथ सीधे बातचीत नहीं करते हैं। यह एक आईडीई है। – jep

+0

@jep, क्षमा करें तो। बस मदद करने की कोशिश की (: – Alex29954

+0

यह ठीक है, बस यह सुनिश्चित करना कि मुझे कुछ याद नहीं है या मेरे प्रश्न में पर्याप्त स्पष्ट नहीं है। – jep

संबंधित मुद्दे