all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* a question about gdb in emacs
@ 2014-06-04  8:28 x_uch
  0 siblings, 0 replies; 5+ messages in thread
From: x_uch @ 2014-06-04  8:28 UTC (permalink / raw)
  To: help-gnu-emacs

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......
help me

^ permalink raw reply	[flat|nested] 5+ messages in thread

* a question about gdb in emacs
@ 2014-06-04  8:36 x_uch
  2014-06-04 14:54 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: x_uch @ 2014-06-04  8:36 UTC (permalink / raw)
  To: help-gnu-emacs

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......
Please help me......



^ permalink raw reply	[flat|nested] 5+ messages in thread

* a question about gdb in emacs
@ 2014-06-04 12:45 x_uch
  0 siblings, 0 replies; 5+ messages in thread
From: x_uch @ 2014-06-04 12:45 UTC (permalink / raw)
  To: help-gnu-emacs

Hi List:

  While i debuged application in windows that use emacs, the buffer of gdb can't get the output,but everything is ok while gdb run in windows by direct running. I don't know where the problem 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 which i debuged, 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 another 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, does anyone know where is?






^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: a question about gdb in emacs
  2014-06-04  8:36 a question about gdb in emacs x_uch
@ 2014-06-04 14:54 ` Eli Zaretskii
  2014-06-04 15:26   ` x_uch
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2014-06-04 14:54 UTC (permalink / raw)
  To: help-gnu-emacs

> 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.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re:Re: a question about gdb in emacs
  2014-06-04 14:54 ` Eli Zaretskii
@ 2014-06-04 15:26   ` x_uch
  0 siblings, 0 replies; 5+ messages in thread
From: x_uch @ 2014-06-04 15:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

Because it only have "<br/>SQLite version 3.8.4.3 2014-04-03 16:53:12<br/>Enter ".help" for usage hints.<br/>Connected to a transient in-memory database.<br/>Use ".open FILENAME" to reopen on a persistent database.<br/>sqlite&gt;<br/>" for output while run sqlite3, so i put fflush(stdout) before line 3816,3822,3823,3824 in shell.c,but the problem still have...
At 2014-06-04 10:54:59, "Eli Zaretskii" <eliz@gnu.org> wrote:
>> 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.
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-06-04 15:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-04  8:36 a question about gdb in emacs x_uch
2014-06-04 14:54 ` Eli Zaretskii
2014-06-04 15:26   ` x_uch
  -- strict thread matches above, loose matches on Subject: below --
2014-06-04 12:45 x_uch
2014-06-04  8:28 x_uch

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.