This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug python/10826] possibly re-order '^done' message and python script output in MI mode
- From: "pmuldoon at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: 3 Nov 2009 13:45:40 -0000
- Subject: [Bug python/10826] possibly re-order '^done' message and python script output in MI mode
- References: <20091022072135.10826.andre.poenitz@nokia.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From pmuldoon at redhat dot com 2009-11-03 13:45 -------
I submitted a patch for what I thought would the solution here:
http://sourceware.org/ml/archer/2009-q4/msg00023.html
And Tom reviewed it here:
http://sourceware.org/ml/archer/2009-q4/msg00033.html
Tom quite rightly points out that commands are required to flush the buffer or
emit a newline. And that this should be the same for Python scripts. I decided
to write a hello world command and test if the output was sequenced correctly if
there were multiple writes, and one flush:
class HelloWorld (gdb.Command):
"""Greet the whole world."""
def __init__ (self):
super (HelloWorld, self).__init__ ("hello-world", gdb.COMMAND_OBSCURE)
def invoke (self, arg, from_tty):
gdb.write("Hello, World!")
gdb.write("Lovely weather!")
gdb.write("What a nice day for a walk")
gdb.flush()
HelloWorld ()
output:
(gdb)
python execfile("/home/build/helloworld2.py")
&"python execfile(\"/home/build/helloworld2.py\")\n"
^done
(gdb)
hello-world
&"hello-world\n"
~"Hello, World!Lovely weather!What a nice day for a walk"
^done
I also tested the case with just a new line at the end, and no flush:
hello-world
&"hello-world\n"
~"Hello, World!Lovely weather!What a nice day for a walk\n"
^done
(gdb)
So in both cases this works, and no patch is needed. So closing, happily with no
patches needed!
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |INVALID
http://sourceware.org/bugzilla/show_bug.cgi?id=10826
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.