This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: linux native async mode support


 > > ? ? send_gdb "start\n"
 > > ? ? gdb_expect {
 > > ????????-re ".*\\^running\r\n\\^done\r\n$mi_gdb_prompt" {
 > 
 > I don't think this is right. MI is (supposed to be) extensible. In particular, new async
 > notification may be added. The above will break if any notification will be emitted
 > between ^running and ^done and the prompt.

I try to make Emacs (the frontend) as tolerant as possible to changes in MI
output, in the hope that future changes, e.g., new fields don't break released
versions of Emacs.  This is a test, however, and it's purpose *is* to detect
changes in Gdb output.  If they are undesirable changes then it's done its job
and detected a regression.  If the changes are deliberate, we update the test.
There's no way to know, in advance, which type the change is and the danger of
making the regexp too general is that we miss a real failure.

 > > ...
 > > ? ? send_gdb "next\n"
 > > ? ? gdb_expect {
 > > ????????-re "\\^running\r\n\\^done\r\n$mi_gdb_prompt" {
 > > ???????? ? ?gdb_expect {
 > > ????????????????-re "\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"$line_main_next\"\}\r\n$mi_gdb_prompt$"
 > {
 > > ???????????????? ? ?pass "Asynchronous response after next command"
 > > ????????????????}
 > > ????????????????-re ".*$mi_gdb_prompt$" {
 > > ???????????????? ? ?fail "Asynchronous response after next command (2)"
 > > ????????????????}
 > > ????????????????timeout {
 > > ???????????????? ? ?fail "Asynchronous response after next command (timeout 2)"
 > > ????????????????}
 > > ???????? ? ?}
 > > ????????}
 > 
 > It appears there's a lot of duplicated logic above. Can we please have
 > factor it out into a helper function? This is not for the sake of abstract
 > clarify -- I've already spend hours updating the current MI testsuite for
 > non-stop mode.

The helper functions that you have written for common sequences are a good
idea as they need only be updated in one place but the three here are the
only ones of their kind (they output an extra "^done" over MI commands like
-exec-next).  Not really worth a dedicated helper function do you agree?

-- 
Nick                                           http://www.inet.net.nz/~nickrob


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]