public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Problems running gdb in emacs on Windows 8.1
@ 2015-06-17 14:53 William M. (Mike) Miller
  2015-06-18 11:53 ` Jon TURNEY
  0 siblings, 1 reply; 6+ messages in thread
From: William M. (Mike) Miller @ 2015-06-17 14:53 UTC (permalink / raw)
  To: cygwin

I'm having numerous problems recently running gdb inside emacs (both
-w32 and -X11):

1) The stack trace window requires one or two gdb commands to catch up
with the current stack frame.  E.g., I'll hit a breakpoint after "run"
and then type "up"; the frame pointer still points at frame 0.  I'll
type "up" again, so I'm actually looking at frame 2, but the frame
pointer now points at frame 1.  I'll type "p variable_name", and now
the frame pointer correctly points at frame 2.

2) Normally the gdb command window is the upper-left window with the
source displayed in the center-left window.  Occasionally (I haven't
been able to find a pattern), when I execute a gdb command the
upper-left window will switch away from the *gud-xxx.exe* buffer to
display the current source location, leaving the center-left window
also displaying a source window.  If I switch the center-left window
to *gud-xxx.exe", the window configuration appears to be stable, with
the source updating correctly in the upper-left window during the rest
of the debugger session.  (Simply switching the upper-left window back
to *gud-xxx.exe* is generally not stable, with that window likely to
switch back to a source buffer within a couple of gdb commands.)

3) My executable has a number of debugging-output functions that are
intended to print a data structure to stderr and return.  When I call
one of these using "p db_foo(x)", unless it is the first gdb command
after a breakpoint, all my threads will switch from "stopped" to
"running" status so that I can no longer step, etc.

All of these things used to work fine.  I'm not sure exactly when
things changed, as I didn't update my Cygwin installation for quite a
while.  My current installation has gdb 7.9.1-1 and emacs 24.5-1.

Any thoughts on what the problem might be and how to fix it would be
appreciated.

-- 
William M. (Mike) Miller | Edison Design Group
william.m.miller@gmail.com

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Problems running gdb in emacs on Windows 8.1
  2015-06-17 14:53 Problems running gdb in emacs on Windows 8.1 William M. (Mike) Miller
@ 2015-06-18 11:53 ` Jon TURNEY
  2015-06-18 12:10   ` William M. (Mike) Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Jon TURNEY @ 2015-06-18 11:53 UTC (permalink / raw)
  To: William M. (Mike) Miller, cygwin

On 17/06/2015 15:53, William M. (Mike) Miller wrote:
> I'm having numerous problems recently running gdb inside emacs (both
> -w32 and -X11):
[...]
> All of these things used to work fine.  I'm not sure exactly when
> things changed, as I didn't update my Cygwin installation for quite a
> while.  My current installation has gdb 7.9.1-1 and emacs 24.5-1.
>
> Any thoughts on what the problem might be and how to fix it would be
> appreciated.

gdb 7.9.1-1 is supposed to be marked as a test release, so I am not sure 
how you come to be running it without explicitly asking for it.

In any case, you might try downgrading to gdb 7.8-2 to see if that 
changes anything.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Problems running gdb in emacs on Windows 8.1
  2015-06-18 11:53 ` Jon TURNEY
@ 2015-06-18 12:10   ` William M. (Mike) Miller
  2015-06-18 14:29     ` Ken Brown
  0 siblings, 1 reply; 6+ messages in thread
From: William M. (Mike) Miller @ 2015-06-18 12:10 UTC (permalink / raw)
  To: cygwin

On Thu, Jun 18, 2015 at 7:53 AM, Jon TURNEY <jon.turney@dronecode.org.uk> wrote:
> On 17/06/2015 15:53, William M. (Mike) Miller wrote:
>>
>> I'm having numerous problems recently running gdb inside emacs (both
>> -w32 and -X11):
>
> [...]
>>
>> All of these things used to work fine.  I'm not sure exactly when
>> things changed, as I didn't update my Cygwin installation for quite a
>> while.  My current installation has gdb 7.9.1-1 and emacs 24.5-1.
>>
>> Any thoughts on what the problem might be and how to fix it would be
>> appreciated.
>
>
> gdb 7.9.1-1 is supposed to be marked as a test release, so I am not sure how
> you come to be running it without explicitly asking for it.
>
> In any case, you might try downgrading to gdb 7.8-2 to see if that changes
> anything.

Thanks for the reply.  Unfortunately, I was having the same problems
with gdb 7.8-2 and installed the latest to see if it helped.  It
didn't.

-- 
William M. (Mike) Miller | Edison Design Group
william.m.miller@gmail.com

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Problems running gdb in emacs on Windows 8.1
  2015-06-18 12:10   ` William M. (Mike) Miller
@ 2015-06-18 14:29     ` Ken Brown
  2015-06-18 15:39       ` Rockefeller, Harry
  2015-06-18 16:01       ` William M. (Mike) Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Ken Brown @ 2015-06-18 14:29 UTC (permalink / raw)
  To: cygwin

On 6/18/2015 8:09 AM, William M. (Mike) Miller wrote:
> On Thu, Jun 18, 2015 at 7:53 AM, Jon TURNEY <jon.turney@dronecode.org.uk> wrote:
>> On 17/06/2015 15:53, William M. (Mike) Miller wrote:
>>>
>>> I'm having numerous problems recently running gdb inside emacs (both
>>> -w32 and -X11):
>>
>> [...]
>>>
>>> All of these things used to work fine.  I'm not sure exactly when
>>> things changed, as I didn't update my Cygwin installation for quite a
>>> while.  My current installation has gdb 7.9.1-1 and emacs 24.5-1.
>>>
>>> Any thoughts on what the problem might be and how to fix it would be
>>> appreciated.
>>
>>
>> gdb 7.9.1-1 is supposed to be marked as a test release, so I am not sure how
>> you come to be running it without explicitly asking for it.
>>
>> In any case, you might try downgrading to gdb 7.8-2 to see if that changes
>> anything.
>
> Thanks for the reply.  Unfortunately, I was having the same problems
> with gdb 7.8-2 and installed the latest to see if it helped.  It
> didn't.

Can you give a detailed recipe for reproducing the problem (preferably 
starting from 'emacs -Q' and using gdb 7.8-2)?

Ken


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* RE: Problems running gdb in emacs on Windows 8.1
  2015-06-18 14:29     ` Ken Brown
@ 2015-06-18 15:39       ` Rockefeller, Harry
  2015-06-18 16:01       ` William M. (Mike) Miller
  1 sibling, 0 replies; 6+ messages in thread
From: Rockefeller, Harry @ 2015-06-18 15:39 UTC (permalink / raw)
  To: cygwin

>Subject: Re: Problems running gdb in emacs on Windows 8.1
>
>On 6/18/2015 8:09 AM, William M. (Mike) Miller wrote:
>> On Thu, Jun 18, 2015 at 7:53 AM, Jon TURNEY <jon.turney@dronecode.org.uk> wrote:
>>> On 17/06/2015 15:53, William M. (Mike) Miller wrote:
>>>>
>>>> I'm having numerous problems recently running gdb inside emacs (both
>>>> -w32 and -X11):
>>>
>>> [...]
>
>Can you give a detailed recipe for reproducing the problem (preferably starting from 'emacs -Q' and using gdb 7.8-2)?

FWIW On Win 7, not Win 8.1, with (as of today) emacs(-x11) 24.5-1 and gdb 7.8-2,
I was having the same problem (guessing starting about 4-6 months ago until a week or 2
ago) of *gud-main.exe* buffer being replaced by the source file
where I set a breakpoint.  But now I do not have that problem.

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

* Re: Problems running gdb in emacs on Windows 8.1
  2015-06-18 14:29     ` Ken Brown
  2015-06-18 15:39       ` Rockefeller, Harry
@ 2015-06-18 16:01       ` William M. (Mike) Miller
  1 sibling, 0 replies; 6+ messages in thread
From: William M. (Mike) Miller @ 2015-06-18 16:01 UTC (permalink / raw)
  To: cygwin

On Thu, Jun 18, 2015 at 10:29 AM, Ken Brown <kbrown@cornell.edu> wrote:
> On 6/18/2015 8:09 AM, William M. (Mike) Miller wrote:
>>
>> On Thu, Jun 18, 2015 at 7:53 AM, Jon TURNEY <jon.turney@dronecode.org.uk>
>> wrote:
>>>
>>> On 17/06/2015 15:53, William M. (Mike) Miller wrote:
>>>>
>>>>
>>>> I'm having numerous problems recently running gdb inside emacs (both
>>>> -w32 and -X11):
>>>
>>>
>>> [...]
>>>>
>>>>
>>>> All of these things used to work fine.  I'm not sure exactly when
>>>> things changed, as I didn't update my Cygwin installation for quite a
>>>> while.  My current installation has gdb 7.9.1-1 and emacs 24.5-1.
>>>>
>>>> Any thoughts on what the problem might be and how to fix it would be
>>>> appreciated.
>>>
>>>
>>>
>>> gdb 7.9.1-1 is supposed to be marked as a test release, so I am not sure
>>> how
>>> you come to be running it without explicitly asking for it.
>>>
>>> In any case, you might try downgrading to gdb 7.8-2 to see if that
>>> changes
>>> anything.
>>
>>
>> Thanks for the reply.  Unfortunately, I was having the same problems
>> with gdb 7.8-2 and installed the latest to see if it helped.  It
>> didn't.
>
>
> Can you give a detailed recipe for reproducing the problem (preferably
> starting from 'emacs -Q' and using gdb 7.8-2)?

Here's what I did, after reinstalling gdb 7.8-2.  ("emacs" is "emacs-X11".)

1) emacs -Q somefile.c&
2) M-x eval-expression (setq gdb-many-windows t)
3) M-x eval-expression (setq gdb-show-threads-by-default t)
4) M-x gdb
5) I edited the path of the executable so that it named a symlink to
the executable in the directory in which I wanted to run the program
6) In the *gud-xxx.exe* window: b foo
7) In the *gud-xxx.exe* window: run <cmd-line-arguments>

The breakpoint was hit and the source window updated to the breakpoint
location; however, all the other windows (locals, stack frames,
threads) were empty.

8) In the *gud-xxx.exe* window: up

At this point, the source window (middle-left) is still showing the
breakpoint location, not the calling function; the stack frame window
has the stack trace but points to frame 0; the locals window shows the
variables for frame 0; and the threads windows shows the program
threads as "stopped".

9) In the *gud-xxx.exe* window: up

Windows shift to displaying information for frame 1.

10) In the *gud-xxx.exe* window: p 0

The source and locals windows shift to frame 2 information, but the
stack frames window still indicates frame 1.

11) In the *gud-xxx.exe* window: p 0

Now the stack frames window updates to point to frame 2.

12) In the *gud-xxx.exe* window: fr 0

The source window updates to show the breakpoint location again, but
the locals and stack frames windows still reflect frame 2.

13) In the *gud-xxx.exe* window: n

Locals and stack frames windows update to frame 0.  Source window is
correctly indicating execution point.

14) In the *gud-xxx.exe* window: p db_foo(x)

Output from debugging function db_foo (to stderr) appears in the
input/output window correctly, but all threads in the thread window
now indicate "running" instead of "stopped".  All other windows
unchanged; in particular, the source window still shows the execution
point where it was.

15) In the *gud-xxx.exe* window: n

Bell rings, no changes to any window.  At this point I have to "run"
again to get back to the breakpoint.

I'm not able to reliably reproduce the replacement of the
*gud-xxx.exe* window with a source window; as I said originally, it
seems unpredictable when it will happen.

-- 
William M. (Mike) Miller | Edison Design Group
william.m.miller@gmail.com

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

end of thread, other threads:[~2015-06-18 16:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-17 14:53 Problems running gdb in emacs on Windows 8.1 William M. (Mike) Miller
2015-06-18 11:53 ` Jon TURNEY
2015-06-18 12:10   ` William M. (Mike) Miller
2015-06-18 14:29     ` Ken Brown
2015-06-18 15:39       ` Rockefeller, Harry
2015-06-18 16:01       ` William M. (Mike) Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).