From: Jan Vrany Date: Mon, 27 Aug 2018 20:52:44 +0000 (+0100) Subject: MI: Fix printing of frame architecture with Python frame filters enabled X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3bf9c013e4a7b72aaa7e242e163a776ad7347c26;p=binutils-gdb.git MI: Fix printing of frame architecture with Python frame filters enabled Commit 6d52907e226a (MI: Print frame architecture when printing frames on an MI channel) added frame's architecture to MI frame output. However the frame architecture was not correctly printed in the output of "-stack-list-frames" with frame filters enabled (via "-enable-frame-filters"). This was because with frame filters enabled, the actual frame printing is done in "py_print_frame" rather than "print_frame". This issue is now fixed. gdb/Changelog: 2018-08-27 Jan Vrany * python/py-framefilter.c (py_print_frame): Print frame architecture when printing on an MI output. gdb/testsuite/Changelog: 2018-08-27 Jan Vrany * gdb.python/py-framefilter-mi.exp: Update regexp to check for "arch" field in frame output. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4ef1765286a..a3f8620af69 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2018-08-27 Jan Vrany + + * python/py-framefilter.c (py_print_frame): Print frame architecture + when printing on an MI output. + 2018-08-27 Tom Tromey PR build/23087: diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c index 4edefd48f9d..fe17b70f53d 100644 --- a/gdb/python/py-framefilter.c +++ b/gdb/python/py-framefilter.c @@ -958,6 +958,9 @@ py_print_frame (PyObject *filter, frame_filter_flags flags, out->field_int ("line", line); } } + if (out->is_mi_like_p ()) + out->field_string ("arch", + (gdbarch_bfd_arch_info (gdbarch))->printable_name); } /* For MI we need to deal with the "children" list population of diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 6b5275a4cb3..03b36afbe0e 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-08-27 Jan Vrany + + * gdb.python/py-framefilter-mi.exp: Update regexp to + check for "arch" field in frame output. + 2018-08-23 Kevin Buettner * gdb.dwarf2/dw2-ranges-func.c: New file. diff --git a/gdb/testsuite/gdb.python/py-framefilter-mi.exp b/gdb/testsuite/gdb.python/py-framefilter-mi.exp index 2ee8216bf0e..6765f5c67da 100644 --- a/gdb/testsuite/gdb.python/py-framefilter-mi.exp +++ b/gdb/testsuite/gdb.python/py-framefilter-mi.exp @@ -64,14 +64,16 @@ mi_gdb_test "-stack-list-locals --all-values" \ mi_continue_to_line [gdb_get_line_number {Backtrace end breakpoint} ${srcfile}] \ "step to breakpoint" +set any "\[^\"\]+" + mi_gdb_test "-stack-list-frames" \ - "\\^done,stack=\\\[frame={level=\"0\",addr=\"$hex\",func=\"cnuf_dne.*\".*},frame={level=\"1\",addr=\"$hex\",func=\"acnuf\".*},frame={level=\"2\",addr=\"$hex\",func=\"bcnuf\".*},frame={level=\"3\",addr=\"$hex\",func=\"acnuf\".*},frame={level=\"22\",addr=\"$hex\",func=\"1cnuf\".*,children=\\\[frame={level=\"23\",addr=\"$hex\",func=\"func2\".*}\\\]},frame={level=\"24\",addr=\"$hex\",func=\"3cnuf\".*},frame={level=\"27\",addr=\"$hex\",func=\"niam\".*}\\\].*" \ + "\\^done,stack=\\\[frame={level=\"0\",addr=\"$hex\",func=\"cnuf_dne.*\".*,arch=\"$any\"},frame={level=\"1\",addr=\"$hex\",func=\"acnuf\".*,arch=\"$any\"},frame={level=\"2\",addr=\"$hex\",func=\"bcnuf\".*,arch=\"$any\"},frame={level=\"3\",addr=\"$hex\",func=\"acnuf\".*,arch=\"$any\"},frame={level=\"22\",addr=\"$hex\",func=\"1cnuf\".*,arch=\"$any\",children=\\\[frame={level=\"23\",addr=\"$hex\",func=\"func2\".*,arch=\"$any\"}\\\]},frame={level=\"24\",addr=\"$hex\",func=\"3cnuf\".*,arch=\"$any\"},frame={level=\"27\",addr=\"$hex\",func=\"niam\".*,arch=\"$any\"}\\\].*" \ "filtered stack listing" mi_gdb_test "-stack-list-frames 0 3" \ - "\\^done,stack=\\\[frame={level=\"0\",addr=\"$hex\",func=\"cnuf_dne.*\".*},frame={level=\"1\",addr=\"$hex\",func=\"acnuf\".*},frame={level=\"2\",addr=\"$hex\",func=\"bcnuf\".*},frame={level=\"3\",addr=\"$hex\",func=\"acnuf\".*}\\\]" \ + "\\^done,stack=\\\[frame={level=\"0\",addr=\"$hex\",func=\"cnuf_dne.*\".*,arch=\"$any\"},frame={level=\"1\",addr=\"$hex\",func=\"acnuf\".*,arch=\"$any\"},frame={level=\"2\",addr=\"$hex\",func=\"bcnuf\".*,arch=\"$any\"},frame={level=\"3\",addr=\"$hex\",func=\"acnuf\".*,arch=\"$any\"}\\\]" \ "filtered stack list 0 3" mi_gdb_test "-stack-list-frames 22 24" \ - "\\^done,stack=\\\[frame={level=\"22\",addr=\"$hex\",func=\"1cnuf\".*,children=\\\[frame={level=\"23\",addr=\"$hex\",func=\"func2\".*}\\\]},frame={level=\"24\",addr=\"$hex\",func=\"3cnuf\".*}\\\]" \ + "\\^done,stack=\\\[frame={level=\"22\",addr=\"$hex\",func=\"1cnuf\".*,arch=\"$any\",children=\\\[frame={level=\"23\",addr=\"$hex\",func=\"func2\".*,arch=\"$any\"}\\\]},frame={level=\"24\",addr=\"$hex\",func=\"3cnuf\".*,arch=\"$any\"}\\\]" \ "filtered stack list 22 24" #stack list arguments