[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: a question about gdb in emacs
From: |
Eli Zaretskii |
Subject: |
Re: a question about gdb in emacs |
Date: |
Wed, 04 Jun 2014 17:54:59 +0300 |
> Date: Wed, 4 Jun 2014 16:36:31 +0800 (CST)
> From: x_uch <x_uch@163.com>
>
> While i debuged the application in windows that use emacs, the buffer of
> emacs can't get the output,but in system, everything is ok. I don't know
> where the error is in me or the emacs.
> in windows , prommpt can get the output like this:
>
>
> and in emacs ,gdb buffer like this:
>
> Here is the application, i download from sqlite site,web address
> http://www.sqlite.org/2014/sqlite-amalgamation-3080403.zip .In windows ,i
> compiled it using mingw,
> using "gcc -g -o sqlite3 shell.c sqlite3.c" to build sqlite3.exe
>
> I tried other app, source code:
> #include <stdio.h>
> typedef struct {
> float a;
> float b;
> } substruct;
>
> struct {
> int i;
> substruct r;
> } c;
>
> myproc(n)
> {
> int p;
> p = 2*n;
> printf("Two times %d is %d\n", n, p);
> }
>
> main() {
> int n = 4;
> int m[10] = {0,1,4,9,16,25,36,49,64,81};
> n = 5;
> myproc(n);
> c.i = 1;
> c.r.a = 0.5;
> c.r.b = 0.25;
> }
> saved it to test.c,build by gcc -o test test.c -g
> in windows and emacs gdb all can get the output "Two times 5 is 10"
> so i think the problem in emacs,but i have not enough time to read the source
> code......
Try adding
fflush (stdout);
after each printf call. This might well be a buffering issue.