[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.cdt] Re: Debugging MinGW applications

Hi Derek,
mmmh, no, the problem is always there.

If I step into the code at the flush instruction I get a
Test163*stopped,reason="end-stepping-range",thread-id="1",frame={addr="0x00401336",func="main",args=[],file="../cip.c",line="7"}

If I execute the whole code the sequence input/output in the console is 
always the same with all the output when the appl quit:
A
TestA


"Derek Morris" <dmsubs@xxxxxxxxxxxxxxxxxxxx> wrote in message 
news:f97fch$g0s$1@xxxxxxxxxxxxxxxxxxxx
>I think you need the fflush(stdout) after the first printf().
>
> See:
> http://www.thinkage.ca/english/gcos/expl/c/lib/fflush.html
>
> -- 
> Derek
>
>
> Tiziano Leidi wrote:
>> Hi LR,
>> I installed TDM but the problem is still there.
>>
>> if I run the application:
>>
>> #include <stdio.h>
>>
>> #include <stdlib.h>
>>
>>
>> int main(void) {
>>
>> printf("Test");
>>
>> char t = getchar();
>>
>> printf("%c\n", t);
>>
>> return EXIT_SUCCESS;
>>
>> }
>>
>> I'm able to interact with the application (put values in input), but not 
>> able to read printf.
>> The whole output appears at the end when the application quit:
>>
>> A
>> TestA
>>
>> many thaks
>> Tiziano
>>
>>
>> "LR" <my@xxxxxxxxx> wrote in message 
>> news:f8o25d$nd3$1@xxxxxxxxxxxxxxxxxxxx
>>> Tiziano Leidi skrev:
>>>> Hi all,
>>>>
>>>> I've got a C application compiled with MinGW on a winXP PC that do not 
>>>> have a GUI. It instead works with text based user interaction in a 
>>>> shell.
>>>> If I debug the C application by starting it with "Debug As - Local 
>>>> C/C++ Application",
>>>> I'm not able to interact with the application. Started outside Eclipse 
>>>> the application runs without problems.
>>>> From CDT 4.0 no external console is started (happened in previous 
>>>> version of CDT) and the Eclipse console remain silent.
>>>>
>>>> Furthermore, If I try to stop the application from Eclipse an error 
>>>> message "Terminate failed" appears and both the gdb.exe and the 
>>>> application remains alive.
>>>> It is the possible to kill gdb from the Widows Task Manager, but it is 
>>>> not possible to kill the application. A reboot of the computer is 
>>>> required to stop the application.
>>>>
>>>> -What do I need to do to have a console to interact with the 
>>>> application during GDB debug?
>>>> -What do I have to do to stop an application debugged with GDB from 
>>>> Eclipse?
>>>>
>>>> I'm using last version of MinGW and GDB (links found in the preface to 
>>>> CDT documentation).
>>>>
>>>> many thaks
>>>> Tiz
>>> Have no problem interacting with build-in console...
>>> this runs nicely
>>> #include <stdio.h>
>>> #include <stdlib.h>
>>>
>>>
>>> int main(void){
>>> char t = getchar();
>>> printf("%c\n",t);
>>> return EXIT_SUCCESS;
>>> }
>>> but I use these builds instead of original MinGW
>>> http://www.tdragon.net/recentgcc/
>>