[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#3794: Several other problems in gdb-mi [RE: bug#3794: Error in json
From: |
Dmitry Dzhus |
Subject: |
bug#3794: Several other problems in gdb-mi [RE: bug#3794: Error in json from gdb-ui] |
Date: |
Tue, 14 Jul 2009 17:46:28 +0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
Herbert Euler wrote:
>> > I tried M-x gdb to run emacs under gdb. The command line was
>> >
>> > gdb -i=mi ~/src/emacs/src/emacs
>> >
>> > and I got the error '(json-object-format ":" 44). Here is the backtrace:
>>
>> I could reproduce your problem and I wrote a workaround which fixes the
>> bug for me. Could you please try the attached patch for gdb-mi.el?
>
> That patch works for me, too. Thanks.
It's in the trunk now.
> 2. The command "shell" is broken: In M-x gdb,
>
> shell ps aux | grep emacs
>
> results in no output; but in a "real" gdb, the output looks like this:
>
> shell ps aux | grep emacs
> &"shell ps aux | grep emacs\n"
> xgp 4886 1.3 0.1 80796 25900 pts/1 T 09:38 0:08 emacs
> xgp 4936 0.3 0.1 77688 22568 pts/10 T+ 09:39 0:02 ./emacs
> xgp 5209 0.0 0.1 28128 16548 pts/6 Ss+ 09:46 0:00
> /usr/local/bin/gdb -i=mi emacs
> xgp 5353 0.4 0.1 28184 16584 pts/1 S+ 09:49 0:00 gdb -i=mi
> emacs
> xgp 5354 0.0 0.0 52800 976 pts/1 S+ 09:49 0:00 bash -c ps
> aux | grep emacs
> xgp 5356 0.0 0.0 51124 688 pts/1 S+ 09:49 0:00 grep emacs
> ^done
Output of GDB's shell command goes as is straight to the terminal
without being prefixed by stream identifier (~, @, & etc.) Thus it's
harder to distinguish where this output should go (to GUD buffer, to MI
parser etc.) I managed to produce a small patch which does the trick for
simple shell commands like yours, but don't expect it to work with
`top(1)` for example. I've attached the patch. Let me know if you notice
that it breaks something.
gdb-shell.patch
Description: Print shell command output in GUD buffer
> 3. Previously, typing directly RET at the M-x gdb prompt repeats the
> last command in history. This is also what a "real" gdb does. But in
> the new implementation, this does nothing now.
I've fixed the code which mimicks RET behaviour for GUD buffer.
gdb-send-ret.patch
Description: Repeat last command on RET properly
> As Nick said, this implementation is still in developing. Should I
> wait then?
It's GSoC project, see http://emacswiki.org/emacs/GDB-MI/ for some
details. Don't wait, report bugs of Emacs trunk version as soon as you
encounter them, but _please_ file *different* reports for different
bugs.
I first put really bleeding changes to my Mercurial repo, then commit
them to Emacs upstream for further testing. Non-stop debugging support
will hit the trunk by the end of this week.
--
Happy Hacking.
http://sphinx.net.ru
む