emacs-devel
[Top][All Lists]
Advanced

[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: Wed, 19 Oct 2011 16:14:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Tom Tromey writes:

>>>>>> "Lluís" == Lluís  <address@hidden> writes:
Lluís> * interpreter-exec mi <command>

Lluís> Execute each command under the MI interpreter, even if the user
Lluís> did not actually set it up in the cmdline.

Lluís> Even if not optimal, the cost of setting the interpreter on a
Lluís> per-command basis (as opposed to setting the current
Lluís> interpreter for all future commands) should not have a
Lluís> noticeable impact on performance.

> I think the drawback is that you don't get MI notifications for commands
> entered by the user.

> What I mean by notifications is, e.g., if the user types "break main",
> the current gdb will inform the MI consumer:

>     &"break main\n"
>     ~"Breakpoint 1 at 0x485fb3: file ../../archer/gdb/gdb.c, line 30.\n"
>     
> =breakpoint-created,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000485fb3",func="main",file="../../archer/gdb/gdb.c",fullname="/home/tromey/gnu/archer/archer/gdb/gdb.c",line="30",times="0",original-location="main"}
>     ^done

Well, there are two command sources:

* emacs
* user

And your comments cleared up my question about how to treat user commands.

The first will always use MI by design, the latter will (by default) use the
current interpreter.

My point is to either:

* Always force the current interpreter to MI. This can be done by transparently
  appending "-i=mi" to the cmdline arguments when starting gdb, as the "-i"
  argument is idempotent and the last one will always prevail.

* Capture user commands and wrap them through "interpreter-exec mi <command>"

I think the former is just simpler and cleaner.


Lluis

-- 
 "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
 Tollbooth



reply via email to

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