[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gdb in emacs 24

From: Lluís
Subject: Re: Gdb in emacs 24
Date: Thu, 20 Oct 2011 18:11:11 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Stefan Monnier writes:

>>>> Pretty much any MI command will do that, e.g., "-list-features".
>>> Then could someone patch gdb-mi.el to use this as a test and send
>>> a clear error message to the user about the need for "-i=mi"?
>>> I think it's too late to use "interpreter exec" for 24.1, but such
>>> a test would at least address some of the bug reports I've seen where
>>> users had used "--annotate=3".
>> As I said, if the use of annotate is the only problem, it can be disabled 
>> with a
>> simple gdb command just after gdb-mi.el starts gdb:

>> set annotate 0

>> This trivial change should address all the bugs you referred to.

> I don't think so: those users had "--annotate=3" *instead* of "-i=mi",
> so setting annotation to 0 would probably not help much, since M-x gdb
> would still hang, waiting for the MI-style answers which gdb wouldn't give.

>> Then the check you say is just to cover the case of the user starting gdb 
>> with
>> "-i=tui", which will probably never happen.

> No it's also to cover the case where "-i=mi" is missing.

Right, both were assuming the use of the "interpreter-exec" command.

I've been looking into it, and just starting gdb should be enough to know if
we're under GDB/MI. The possible cases I've looked into are:

* console
* console + annotate
* mi
* tui

GDB/MI gives us a unique greeting format:

    ~"GNU gdb (GDB) 7.3-debian\n"

What I've done is use a new gud marker filter during initialization
(gud-common-init) to establish whether the correct interpreter is being
used. After that check, the original filter (gud-gdbmi-marker-filter) is used.

The problem is that my poor elisp knowledge isn't enough to find a way to
communicate the result back into the main emacs process (as the filter seems to
be running on a separate process, I'm unable to simply set a variable to tell
whether the test is ok).

Any hints on how to communicate the result back to the 'gdb' function?


 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom

reply via email to

[Prev in Thread] Current Thread [Next in Thread]