unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* gdb "command" broken with -mi
@ 2013-08-20 12:55 Ryan Johnson
  2013-08-20 14:35 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Ryan Johnson @ 2013-08-20 12:55 UTC (permalink / raw)
  To: emacs-devel

Hi all,

I noticed during a recent debug session that gdb's "command" command 
(setting actions to perform when a breakpoint triggers) doesn't work. 
You can start to enter the list of commands, but emacs ignores the "end" 
keyword that should terminate the list, forcing you to cancel the 
attempt with C-c C-c.

Is this a known issue?

Thanks,
Ryan




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

* Re: gdb "command" broken with -mi
  2013-08-20 12:55 gdb "command" broken with -mi Ryan Johnson
@ 2013-08-20 14:35 ` Eli Zaretskii
  2013-08-20 15:03   ` Ryan Johnson
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2013-08-20 14:35 UTC (permalink / raw)
  To: Ryan Johnson; +Cc: emacs-devel

> Date: Tue, 20 Aug 2013 08:55:54 -0400
> From: Ryan Johnson <ryan.johnson@cs.utoronto.ca>
> 
> I noticed during a recent debug session that gdb's "command" command 
> (setting actions to perform when a breakpoint triggers) doesn't work. 
> You can start to enter the list of commands, but emacs ignores the "end" 
> keyword that should terminate the list, forcing you to cancel the 
> attempt with C-c C-c.
> 
> Is this a known issue?

This used to be a problem in older versions of Emacs, but it was fixed
more than a year ago, and all versions of Emacs from 24.3 (inclusive)
onwards should not fail this way.  What version of Emacs are you
using?

FWIW, I've just tried this in yesterday's trunk, and it works for me
in a simple test case.



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

* Re: gdb "command" broken with -mi
  2013-08-20 14:35 ` Eli Zaretskii
@ 2013-08-20 15:03   ` Ryan Johnson
  2013-08-20 15:38     ` Liang Wang
  2013-08-20 15:49     ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: Ryan Johnson @ 2013-08-20 15:03 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

On 20/08/2013 10:35 AM, Eli Zaretskii wrote:
>> Date: Tue, 20 Aug 2013 08:55:54 -0400
>> From: Ryan Johnson <ryan.johnson@cs.utoronto.ca>
>>
>> I noticed during a recent debug session that gdb's "command" command
>> (setting actions to perform when a breakpoint triggers) doesn't work.
>> You can start to enter the list of commands, but emacs ignores the "end"
>> keyword that should terminate the list, forcing you to cancel the
>> attempt with C-c C-c.
>>
>> Is this a known issue?
> This used to be a problem in older versions of Emacs, but it was fixed
> more than a year ago, and all versions of Emacs from 24.3 (inclusive)
> onwards should not fail this way.  What version of Emacs are you
> using?
>
> FWIW, I've just tried this in yesterday's trunk, and it works for me
> in a simple test case.
I'm using 24.3.2 with Ken's cygwin patches.

The STC is:
1. gcc -g -ostc -xc <(echo "int main() { return 0; }")
2. Fire up emacs M-x gdb and point it at stc
3. b main
4. comm 1
> Reading symbols from /home/Ryan/experiments/a.exe...done.
> (gdb) b main
> Breakpoint 1 at 0x1004010dd: file stc.c, line 2.
> (gdb) comm 1
> Type commands for breakpoint(s) 1, one per line.
> End with a line saying just "end".
> >p $pc
> >end
> >
> >
> >  C-c C-cQuit
> (gdb)

If it's fixed in later versions, though, maybe Ken's (hopefully 
soon-arriving) cygwin package update that fixes the stack overflow 
problem will also pick up this fix.

Thanks,
Ryan





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

* Re: gdb "command" broken with -mi
  2013-08-20 15:03   ` Ryan Johnson
@ 2013-08-20 15:38     ` Liang Wang
  2013-08-20 15:54       ` Eli Zaretskii
  2013-08-20 15:49     ` Eli Zaretskii
  1 sibling, 1 reply; 7+ messages in thread
From: Liang Wang @ 2013-08-20 15:38 UTC (permalink / raw)
  To: Ryan Johnson; +Cc: Eli Zaretskii, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1647 bytes --]

On Aug 20, 2013 8:04 AM, "Ryan Johnson" <ryan.johnson@cs.utoronto.ca> wrote:
>
> On 20/08/2013 10:35 AM, Eli Zaretskii wrote:
>>>
>>> Date: Tue, 20 Aug 2013 08:55:54 -0400
>>> From: Ryan Johnson <ryan.johnson@cs.utoronto.ca>
>>>
>>> I noticed during a recent debug session that gdb's "command" command
>>> (setting actions to perform when a breakpoint triggers) doesn't work.
>>> You can start to enter the list of commands, but emacs ignores the "end"
>>> keyword that should terminate the list, forcing you to cancel the
>>> attempt with C-c C-c.
>>>
>>> Is this a known issue?
>>
>> This used to be a problem in older versions of Emacs, but it was fixed
>> more than a year ago, and all versions of Emacs from 24.3 (inclusive)
>> onwards should not fail this way.  What version of Emacs are you
>> using?
>>
>> FWIW, I've just tried this in yesterday's trunk, and it works for me
>> in a simple test case.
>
> I'm using 24.3.2 with Ken's cygwin patches.
>
> The STC is:
> 1. gcc -g -ostc -xc <(echo "int main() { return 0; }")
> 2. Fire up emacs M-x gdb and point it at stc
> 3. b main
> 4. comm 1
>>
>> Reading symbols from /home/Ryan/experiments/a.exe...done.
>> (gdb) b main
>> Breakpoint 1 at 0x1004010dd: file stc.c, line 2.
>> (gdb) comm 1

I'm afraid that you have to type "commands" exactly.

>> Type commands for breakpoint(s) 1, one per line.
>> End with a line saying just "end".
>> >p $pc
>> >end
>> >
>> >
>> >  C-c C-cQuit
>> (gdb)
>
>
> If it's fixed in later versions, though, maybe Ken's (hopefully
soon-arriving) cygwin package update that fixes the stack overflow problem
will also pick up this fix.
>
> Thanks,
> Ryan
>
>
>

[-- Attachment #2: Type: text/html, Size: 2469 bytes --]

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

* Re: gdb "command" broken with -mi
  2013-08-20 15:03   ` Ryan Johnson
  2013-08-20 15:38     ` Liang Wang
@ 2013-08-20 15:49     ` Eli Zaretskii
  1 sibling, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2013-08-20 15:49 UTC (permalink / raw)
  To: Ryan Johnson; +Cc: emacs-devel

> Date: Tue, 20 Aug 2013 11:03:51 -0400
> From: Ryan Johnson <ryan.johnson@cs.utoronto.ca>
> CC: emacs-devel@gnu.org
> 
> The STC is:
> 1. gcc -g -ostc -xc <(echo "int main() { return 0; }")
> 2. Fire up emacs M-x gdb and point it at stc
> 3. b main
> 4. comm 1
> > Reading symbols from /home/Ryan/experiments/a.exe...done.
> > (gdb) b main
> > Breakpoint 1 at 0x1004010dd: file stc.c, line 2.
> > (gdb) comm 1
> > Type commands for breakpoint(s) 1, one per line.
> > End with a line saying just "end".
> > >p $pc
> > >end
> > >
> > >
> > >  C-c C-cQuit
> > (gdb)
> 
> If it's fixed in later versions, though, maybe Ken's (hopefully 
> soon-arriving) cygwin package update that fixes the stack overflow 
> problem will also pick up this fix.

v24.3 should have the fix.  This works for me on Windows (in a native
build) and on GNU/Linux, so this could be something specific to Cygwin
or to your system.

Some things to try:

  . Once you enter GDB, type "set interactive-mode off" before any
    other GDB command, and see if that solves the problem.

  . Try a different version of GDB, especially if you are using some
    development snapshot.

  . Make sure your gdb-mi.el has a variable named gdb-control-level
    (this was part of solving the problem).  Also, make sure you don't
    have some old gdb-mi.el shadowing the one in v24.3.



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

* Re: gdb "command" broken with -mi
  2013-08-20 15:38     ` Liang Wang
@ 2013-08-20 15:54       ` Eli Zaretskii
  2013-08-20 15:58         ` Ryan Johnson
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2013-08-20 15:54 UTC (permalink / raw)
  To: Liang Wang; +Cc: ryan.johnson, emacs-devel

> Date: Tue, 20 Aug 2013 08:38:13 -0700
> From: Liang Wang <netcasper@gmail.com>
> Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
> 
> >> Breakpoint 1 at 0x1004010dd: file stc.c, line 2.
> >> (gdb) comm 1
> 
> I'm afraid that you have to type "commands" exactly.

Ah, yes, I remember now.  (I always type "com TAB", so completion does
that for me.)  You can hack gdb-control-commands-regexp to include
abbreviations as well.



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

* Re: gdb "command" broken with -mi
  2013-08-20 15:54       ` Eli Zaretskii
@ 2013-08-20 15:58         ` Ryan Johnson
  0 siblings, 0 replies; 7+ messages in thread
From: Ryan Johnson @ 2013-08-20 15:58 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Liang Wang, emacs-devel

On 20/08/2013 11:54 AM, Eli Zaretskii wrote:
>> Date: Tue, 20 Aug 2013 08:38:13 -0700
>> From: Liang Wang <netcasper@gmail.com>
>> Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
>>
>>>> Breakpoint 1 at 0x1004010dd: file stc.c, line 2.
>>>> (gdb) comm 1
>> I'm afraid that you have to type "commands" exactly.
> Ah, yes, I remember now.  (I always type "com TAB", so completion does
> that for me.)  You can hack gdb-control-commands-regexp to include
> abbreviations as well.
Ah! I have to type "comm [TAB]" because otherwise there are three 
completions to choose from, but it does work.

Thanks,
Ryan




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

end of thread, other threads:[~2013-08-20 15:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-20 12:55 gdb "command" broken with -mi Ryan Johnson
2013-08-20 14:35 ` Eli Zaretskii
2013-08-20 15:03   ` Ryan Johnson
2013-08-20 15:38     ` Liang Wang
2013-08-20 15:54       ` Eli Zaretskii
2013-08-20 15:58         ` Ryan Johnson
2013-08-20 15:49     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

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