Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Emacs gdb interface
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  15 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Matt McClure  
View profile  
 More options Mar 20 2012, 10:58 pm
Newsgroups: gnu.emacs.help
From: Matt McClure <matthewlmccl...@gmail.com>
Date: Tue, 20 Mar 2012 22:58:48 -0400
Local: Tues, Mar 20 2012 10:58 pm
Subject: Re: Emacs gdb interface

On Tue, Mar 20, 2012 at 4:21 PM, Dani Moncayo <dmonc...@gmail.com> wrote:
> At this point, the *input/output of p1.exe* buffer should show the
> "hello, world!" message written to the standard output, right?  But I
> observe that the buffer remains empty (see attached screenshot).

Just a guess:

There is no newline in the intended output, so perhaps the output isn't
flushed yet. Does it appear if you step through the rest of the program?

--
Matt McClure
http://www.matthewlmcclure.com
http://www.mapmyfitness.com/profile/matthewlmcclure


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dani Moncayo  
View profile  
 More options Mar 21 2012, 3:33 am
Newsgroups: gnu.emacs.help
From: Dani Moncayo <dmonc...@gmail.com>
Date: Wed, 21 Mar 2012 08:33:40 +0100
Local: Wed, Mar 21 2012 3:33 am
Subject: Re: Emacs gdb interface

> There is no newline in the intended output, so perhaps the output isn't
> flushed yet. Does it appear if you step through the rest of the program?

I've tried it and not, it never appears, even after I've reached the
end of the program.

Thanks for answering.

BTW: I did not wrote the compilation command, which was:
   gcc -g --all-warnings -Wall -Wextra -o p1.exe main.c

--
Dani Moncayo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bob Proulx  
View profile  
 More options Mar 21 2012, 3:50 am
Newsgroups: gnu.emacs.help
From: Bob Proulx <b...@proulx.com>
Date: Wed, 21 Mar 2012 01:50:07 -0600
Local: Wed, Mar 21 2012 3:50 am
Subject: Re: Emacs gdb interface

Dani Moncayo wrote:
> > There is no newline in the intended output, so perhaps the output isn't
> > flushed yet. Does it appear if you step through the rest of the program?

> I've tried it and not, it never appears, even after I've reached the
> end of the program.

Please add a newline to the output.  I think that without the newline
the output may be covered by other output.  I think it likely that the
output is actually being output but just covered.

-  printf("hello, world!");
+  printf("hello, world!\n");

Bob


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Dyballa  
View profile  
 More options Mar 21 2012, 4:28 am
Newsgroups: gnu.emacs.help
From: Peter Dyballa <Peter_Dyba...@Web.DE>
Date: Wed, 21 Mar 2012 09:28:45 +0100
Local: Wed, Mar 21 2012 4:28 am
Subject: Re: Emacs gdb interface

Am 21.3.2012 um 08:33 schrieb Dani Moncayo:

>   gcc -g --all-warnings -Wall -Wextra -o p1.exe main.c

-g produces debug information in the default format, maybe you need to use -ggdb to get "debug information in default extended format". (It might also be useful to try the build with the additional switches -feliminate-unused-debug-symbols and -feliminate-unused-debug-types.)

--
Greetings

  Pete

There's no place like 127.0.0.1
                        – origin unknown


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dani Moncayo  
View profile  
 More options Mar 21 2012, 4:39 am
Newsgroups: gnu.emacs.help
From: Dani Moncayo <dmonc...@gmail.com>
Date: Wed, 21 Mar 2012 09:39:27 +0100
Local: Wed, Mar 21 2012 4:39 am
Subject: Re: Emacs gdb interface

> Please add a newline to the output.  I think that without the newline
> the output may be covered by other output.  I think it likely that the
> output is actually being output but just covered.

> -  printf("hello, world!");
> +  printf("hello, world!\n");

If that was the case, it would cause a lot of confusion to users, but
fortunately, that's not the case (I've just tested it and I see no
output either).

Thank you.

--
Dani Moncayo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dani Moncayo  
View profile  
 More options Mar 21 2012, 4:43 am
Newsgroups: gnu.emacs.help
From: Dani Moncayo <dmonc...@gmail.com>
Date: Wed, 21 Mar 2012 09:43:44 +0100
Local: Wed, Mar 21 2012 4:43 am
Subject: Re: Emacs gdb interface

>>   gcc -g --all-warnings -Wall -Wextra -o p1.exe main.c

> -g produces debug information in the default format, maybe you need to use -ggdb to get "debug information in default extended format". (It might also be useful to try the build with the additional switches -feliminate-unused-debug-symbols and -feliminate-unused-debug-types.)

I've just tried to compile like this:
  gcc -ggdb --all-warnings -Wall -Wextra
-feliminate-unused-debug-symbols -feliminate-unused-debug-types -o
p1.exe main.c

But that does not help.  Same result.

Thank you.

--
Dani Moncayo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alberto Luaces  
View profile  
 More options Mar 21 2012, 4:54 am
Newsgroups: gnu.emacs.help
From: Alberto Luaces <alua...@udc.es>
Date: Wed, 21 Mar 2012 09:54:33 +0100
Local: Wed, Mar 21 2012 4:54 am
Subject: Re: Emacs gdb interface

Dani Moncayo writes:
>> Please add a newline to the output.  I think that without the newline
>> the output may be covered by other output.  I think it likely that the
>> output is actually being output but just covered.

>> -  printf("hello, world!");
>> +  printf("hello, world!\n");

> If that was the case, it would cause a lot of confusion to users, but
> fortunately, that's not the case (I've just tested it and I see no
> output either).

I also think it's a buffering issue. For me, it makes a difference to
put the \n or not. It also happens if I put a fflush(0) statement after
the printf().

Your unmodified example works for me if I run the program into gdb with
the 'r' command.

--
Alberto


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bob Proulx  
View profile  
 More options Mar 21 2012, 5:28 am
Newsgroups: gnu.emacs.help
From: Bob Proulx <b...@proulx.com>
Date: Wed, 21 Mar 2012 03:28:43 -0600
Local: Wed, Mar 21 2012 5:28 am
Subject: Re: Emacs gdb interface

Dani Moncayo wrote:
> > Please add a newline to the output.  I think that without the newline
> > the output may be covered by other output.  I think it likely that the
> > output is actually being output but just covered.

> > -  printf("hello, world!");
> > +  printf("hello, world!\n");

> If that was the case, it would cause a lot of confusion to users, but
> fortunately, that's not the case (I've just tested it and I see no
> output either).

It may be confusing but it is no different from having this case:

  rwp@discord:~$ printf "Hello" ; printf "\r"
  rwp@discord:~$

Question: Where did the output go?  Answer: It was printed but then it
was covered by the prompt and effectively hidden.  Here I am using two
printf statements because your program didn't include one but in the
operation of gdm and emacs there is almost certainly one, which is
represented here by the second printf.

But since you say it didn't make any difference then this point isn't
relevant.  But at least you can see why I asked for the newline.

At this point I do not have any more information.  Good luck!

Bob


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dani Moncayo  
View profile  
 More options Mar 21 2012, 6:26 am
Newsgroups: gnu.emacs.help
From: Dani Moncayo <dmonc...@gmail.com>
Date: Wed, 21 Mar 2012 11:26:23 +0100
Local: Wed, Mar 21 2012 6:26 am
Subject: Re: Emacs gdb interface

>> If that was the case, it would cause a lot of confusion to users, but
>> fortunately, that's not the case (I've just tested it and I see no
>> output either).

> It may be confusing but it is no different from having this case:

>  rwp@discord:~$ printf "Hello" ; printf "\r"
>  rwp@discord:~$

> Question: Where did the output go?  Answer: It was printed but then it
> was covered by the prompt and effectively hidden.  Here I am using two
> printf statements because your program didn't include one but in the
> operation of gdm and emacs there is almost certainly one, which is
> represented here by the second printf.

Thanks for the explanation, but what I wanted to say is that the users
expect that the "input/output" buffer in Emacs contains _exclusively_
the input/output text sent to/taken from the process, and in this
case, the process does not write any "\r" character.

In any case, as you said, this doesn't seem to be the origin of the problem.

Thanks.

--
Dani Moncayo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sergei Organov  
View profile  
 More options Mar 21 2012, 6:53 am
Newsgroups: gnu.emacs.help
From: Sergei Organov <o...@javad.com>
Date: Wed, 21 Mar 2012 14:53:59 +0400
Local: Wed, Mar 21 2012 6:53 am
Subject: Re: Emacs gdb interface

Did you try to run it under bare gdb (without Emacs)? If the problem
remains, it's gdb issue rather than Emacs one.

-- Sergei.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dani Moncayo  
View profile  
 More options Mar 21 2012, 8:11 am
Newsgroups: gnu.emacs.help
From: Dani Moncayo <dmonc...@gmail.com>
Date: Wed, 21 Mar 2012 13:11:02 +0100
Local: Wed, Mar 21 2012 8:11 am
Subject: Re: [h-e-w] Emacs gdb interface

> Did you try to run it under bare gdb (without Emacs)? If the problem
> remains, it's gdb issue rather than Emacs one.

Good question.  I've just debugged the program directly under gdb
(invoked from a cmd.exe console) and everything looks fine (I see the
"hello, world" message).

I'm beginning to consider sending an bug report.

Thanks.

--
Dani Moncayo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Doug Lewan  
View profile  
 More options Mar 21 2012, 9:32 am
Newsgroups: gnu.emacs.help
From: Doug Lewan <do...@shubertticketing.com>
Date: Wed, 21 Mar 2012 13:32:33 +0000
Local: Wed, Mar 21 2012 9:32 am
Subject: RE: [h-e-w] Emacs gdb interface
I don't think this will be regarded as a bug.

Debugger mode is derived from comint mode which, by design, doesn't display output until it gets to the end of a line.

A few details, if you care:

>From the other side, gdb doesn't see anything you type until you type <ENTER>, invoking (comint-send-input) and as a consequence calls the comint-input-filter-functions.

I think the corresponding function for output is (comint-output-filter).
These things usually do good things for you, like hide passwords.

An experiment (under *NIX), if you want an example of what comint doesn't show you:

Get a shell buffer and type 'stty sane'. (This cooks the terminal. Comint intentionally makes it raw to control I/O.
Now type a command like 'echo Your name here.'
You will also see the command since the terminal now echoes its input too.
(No, I don't know how to do this on Windows and I don't know something that corresponds for gdb. Sorry.)

I hope this helps.

,Doug


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eli Zaretskii  
View profile  
 More options Mar 21 2012, 2:51 pm
Newsgroups: gnu.emacs.help
From: Eli Zaretskii <e...@gnu.org>
Date: Wed, 21 Mar 2012 20:51:21 +0200
Local: Wed, Mar 21 2012 2:51 pm
Subject: Re: [h-e-w] Emacs gdb interface

> Date: Wed, 21 Mar 2012 08:33:40 +0100
> From: Dani Moncayo <dmonc...@gmail.com>
> Cc: help-emacs-wind...@gnu.org, help-gnu-em...@gnu.org

> > There is no newline in the intended output, so perhaps the output isn't
> > flushed yet. Does it appear if you step through the rest of the program?

> I've tried it and not, it never appears, even after I've reached the
> end of the program.

If you add the newline, the output appears at the end, but not in the
input/output buffer.

If there's no newline, I wouldn't expect the output to appear at all,
in such a short program, since standard output redirected to pipes is
fully-buffered on Windows, not line-buffered as on Posix systems.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dani Moncayo  
View profile  
 More options Mar 21 2012, 4:09 pm
Newsgroups: gnu.emacs.help
From: Dani Moncayo <dmonc...@gmail.com>
Date: Wed, 21 Mar 2012 21:09:52 +0100
Local: Wed, Mar 21 2012 4:09 pm
Subject: Re: [h-e-w] Emacs gdb interface

> If you add the newline, the output appears at the end, but not in the
> input/output buffer.

> If there's no newline, I wouldn't expect the output to appear at all,
> in such a short program, since standard output redirected to pipes is
> fully-buffered on Windows, not line-buffered as on Posix systems.

Ok, I understand that Emacs can't show the output until it is flushed,
but when it is, as (for example) in this case:

-------- main.c -------------
#include <stdio.h>

int main(void)
{
   printf("hello, world!\n");
   fflush(stdout);
   return 0;

}

-----------------------------

The output should not be shown in the *gud* buffer (as happens now),
but in the *input/output* one, no?  If not, what's that *input/output*
buffer for?

--
Dani Moncayo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eli Zaretskii  
View profile  
 More options Mar 21 2012, 5:30 pm
Newsgroups: gnu.emacs.help
From: Eli Zaretskii <e...@gnu.org>
Date: Wed, 21 Mar 2012 23:30:33 +0200
Local: Wed, Mar 21 2012 5:30 pm
Subject: Re: [h-e-w] Emacs gdb interface

I suspect that whatever tricks gdb-mi.el uses to separate the
program's output from GDB's simply doesn't work on Windows.  But
that's a guess, I didn't have time to dig into this.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »