diff options
author | Philippe Waroquiers <philippe.waroquiers@skynet.be> | 2019-05-04 23:47:57 +0200 |
---|---|---|
committer | Philippe Waroquiers <philippe.waroquiers@skynet.be> | 2019-07-29 21:42:52 +0200 |
commit | c7e4c0a6482cebcf8b129d1008a2c553a0183aee (patch) | |
tree | c14874c2f45b27236693134c5fa0390ea236ef06 /gdb/testsuite/gdb.python | |
parent | 4b5e8d19afe4accc3dd87aeba58d6704e71c610d (diff) | |
download | gdb-c7e4c0a6482cebcf8b129d1008a2c553a0183aee.zip gdb-c7e4c0a6482cebcf8b129d1008a2c553a0183aee.tar.gz gdb-c7e4c0a6482cebcf8b129d1008a2c553a0183aee.tar.bz2 |
Test 'set print frame-info|frame-arguments presence'.
Updated tests to test the new options and new values.
Test the default for print_what in python frame filtering.
Updated the tests impacted by the default in python frame filtering
which is now consistent with the backtrace command.
gdb/testsuite/ChangeLog
2019-07-29 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* gdb.base/options.exp: Update backtrace - completion to
new option -frame-info.
* gdb.base/frame-args.exp: Test new 'frame-arguments presence'.
Test new 'set print frame-info'. Test backtrace -frame-info
overriding 'set print frame-info'.
* gdb.python/py-framefilter.exp: Test new 'frame-arguments presence'.
Test new 'set print frame-info'.
Verify consistency of backtrace with and without filters, with and
without -no-filters.
* gdb.python/py-framefilter-invalidarg.exp: Update to new print_what
default.
Diffstat (limited to 'gdb/testsuite/gdb.python')
-rw-r--r-- | gdb/testsuite/gdb.python/py-framefilter-invalidarg.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-framefilter.exp | 72 |
2 files changed, 69 insertions, 5 deletions
diff --git a/gdb/testsuite/gdb.python/py-framefilter-invalidarg.exp b/gdb/testsuite/gdb.python/py-framefilter-invalidarg.exp index 8d5fb72..2213bcf 100644 --- a/gdb/testsuite/gdb.python/py-framefilter-invalidarg.exp +++ b/gdb/testsuite/gdb.python/py-framefilter-invalidarg.exp @@ -63,4 +63,4 @@ set remote_python_file [gdb_remote_download host \ ${srcdir}/${subdir}/${testfile}.py] gdb_test_no_output "source ${remote_python_file}" "load python file" -gdb_test "bt" " in niam \\(argc=<error reading variable: dwarf expression stack underflow>, argv=0x\[0-9a-f\]+\\) at py-framefilter-invalidarg.c:\[0-9\]+" "bt full with filters" +gdb_test "bt" "niam \\(argc=<error reading variable: dwarf expression stack underflow>, argv=0x\[0-9a-f\]+\\) at py-framefilter-invalidarg.c:\[0-9\]+" "bt full with filters" diff --git a/gdb/testsuite/gdb.python/py-framefilter.exp b/gdb/testsuite/gdb.python/py-framefilter.exp index a88e37f..e3aed24 100644 --- a/gdb/testsuite/gdb.python/py-framefilter.exp +++ b/gdb/testsuite/gdb.python/py-framefilter.exp @@ -60,11 +60,26 @@ if ![runto_main] then { gdb_test_no_output "set python print-stack full" \ "set python print-stack to full" +# Verify that 'bt', 'bt -no-filters' print the same info +# when there are no filters, no matching filters, or matching filters. +# In particular, no address should be printed, as the default for +# backtrace -frame-info is 'location', and the breakpoint we just hit +# is at the beginning of a line. +# Same tests done again after having loaded the filters. +gdb_test "bt 1" "#0 main .*" "bt 1, no filter loaded" +gdb_test "bt -no-filters 1" "#0 main .*" "bt -no-filters 1, no filter loaded" + + # Load global frame-filters set remote_python_file [gdb_remote_download host \ ${srcdir}/${subdir}/${testfile}.py] gdb_test_no_output "source ${remote_python_file}" "load python file" +# Re-verify the frame-info printed once filters are loaded. +# For the first check, the Reverse filter is matching. +gdb_test "bt 1" "#0 niam .*" "bt 1, filters loaded" +gdb_test "bt -no-filters 1" "#0 main .*" "bt -no-filters 1, filters loaded" + gdb_breakpoint [gdb_get_line_number "Backtrace end breakpoint"] gdb_breakpoint [gdb_get_line_number "Inner test breakpoint"] gdb_continue_to_breakpoint "Inner test breakpoint" @@ -161,6 +176,10 @@ gdb_test "bt full hide" \ ".*#0.*end_func.*str = $hex \"The End\".*st2 = $hex \"Is Near\".*b = 12.*c = 5.*#1.*in funca \\(\\).*#2.*in funcb \\(j=10\\).*bar = \{a = 42, b = 84\}.*#22.*in func1 \\(\\)\[^#\]*#24.*in func3 \\(i=3\\).*" \ "bt full hide with Reverse disabled" +# Re-enable Reverse +gdb_test_no_output "enable frame-filter global Reverse" \ + "re-enable frame-filter global Reverse" + # Test set print frame-arguments # none gdb_test_no_output "set print frame-arguments none" \ @@ -169,7 +188,7 @@ gdb_test "bt no-filter 1" \ "#0.*end_func \\(foo=\.\.\., bar=\.\.\., fb=\.\.\., bf=\.\.\.\\) at .*py-framefilter.c.*" \ "bt no-filter 1 no args" gdb_test "bt 1" \ - "#0.*end_func \\(foo=\.\.\., bar=\.\.\., fb=\.\.\., bf=\.\.\.\\) at .*py-framefilter.c.*" \ + "#0.*cnuf_dneThe End \\(foo=\.\.\., bar=\.\.\., fb=\.\.\., bf=\.\.\.\\) at .*py-framefilter.c.*" \ "bt 1 no args" # scalars @@ -179,9 +198,54 @@ gdb_test "bt no-filter 1" \ "#0.*end_func \\(foo=21, bar=$hex \"Param\", fb=$hex, bf=\.\.\.\\) at .*py-framefilter.c.*" \ "bt no-filter 1 scalars" gdb_test "bt 1" \ - "#0.*end_func \\(foo=21, bar=$hex \"Param\", fb=$hex, bf=\.\.\.\\) at .*py-framefilter.c.*" \ + "#0.*cnuf_dneThe End \\(foo=21, bar=$hex \"Param\", fb=$hex, bf=\.\.\.\\) at .*py-framefilter.c.*" \ "bt 1 scalars" +# presence +gdb_test_no_output "set print frame-arguments presence" \ + "turn frame arguments to presence only" +gdb_test "bt no-filter 1" \ + "#0.*end_func \\(\.\.\.\\) at .*py-framefilter.c.*" \ + "bt no-filter 1 presence" +gdb_test "bt 1" \ + "#0.*cnuf_dneThe End \\(\.\.\.\\) at .*py-framefilter.c.*" \ + "bt 1 presence" + +# Test set print frame-info, with only presence for args. +# short-location +gdb_test_no_output "set print frame-info short-location" \ + "frame-info short-location" +gdb_test "bt no-filter 1" \ + "#0.*end_func \\(\.\.\.\\)\r\n.*" \ + "bt no-filter 1 short-location" +gdb_test "bt 1" \ + "#0.*cnuf_dneThe End \\(\.\.\.\\)\r\n.*" \ + "bt 1 short-location" + +# source-and-location +gdb_test_no_output "set print frame-info source-and-location" \ + "frame-info source-and-location" +gdb_test "bt no-filter 1" \ + "#0.*end_func \\(\.\.\.\\) at .*py-framefilter.c.*\r\n.*\[1-9\]\[0-9\]*.*" \ + "bt no-filter 1 source-and-location" +gdb_test "bt 1" \ + "#0.*cnuf_dneThe End \\(\.\.\.\\) at .*py-framefilter.c.*\r\n.*\[1-9\]\[0-9\]*.*" \ + "bt 1 source-and-location" + +# source-line +gdb_test_no_output "set print frame-info source-line" \ + "frame-info source-line" +gdb_test "bt no-filter 1" \ + "\[1-9\]\[0-9\]*\[ \t\]*return; /\\* Backtrace end breakpoint \\*/.*" \ + "bt no-filter 1 source-line" +gdb_test "bt 1" \ + "\[1-9\]\[0-9\]*\[ \t\]*return; /\\* Backtrace end breakpoint \\*/.*" \ + "bt 1 source-line" + +# set print frame-info back to auto. +gdb_test_no_output "set print frame-info auto" \ + "frame-info auto" + # all gdb_test_no_output "set print frame-arguments all" \ "turn on frame arguments" @@ -189,7 +253,7 @@ gdb_test "bt no-filter 1" \ "#0.*end_func \\(foo=21, bar=$hex \"Param\", fb=$hex, bf=\{nothing = $hex \"Foo Bar\", f = 42, s = 19\}\\) at .*py-framefilter.c.*" \ "bt no-filter 1 all args" gdb_test "bt 1" \ - "#0.*end_func \\(foo=21, bar=$hex \"Param\", fb=$hex, bf=\{nothing = $hex \"Foo Bar\", f = 42, s = 19\}\\) at .*py-framefilter.c.*" \ + "#0.*cnuf_dneThe End \\(foo=21, bar=$hex \"Param\", fb=$hex, bf=\{nothing = $hex \"Foo Bar\", f = 42, s = 19\}\\) at .*py-framefilter.c.*" \ "bt 1 all args" # set print address off @@ -199,7 +263,7 @@ gdb_test "bt no-filter 1" \ "#0 end_func \\(foo=21, bar=\"Param\", fb=, bf=\{nothing = \"Foo Bar\", f = 42, s = 19\}\\) at .*py-framefilter.c.*" \ "bt no-filter 1 no address" gdb_test "bt 1" \ - "#0 end_func \\(foo=21, bar=\"Param\", fb=, bf=\{nothing = \"Foo Bar\", f = 42, s = 19\}\\) at .*py-framefilter.c.*" \ + "#0 cnuf_dneThe End \\(foo=21, bar=\"Param\", fb=, bf=\{nothing = \"Foo Bar\", f = 42, s = 19\}\\) at .*py-framefilter.c.*" \ "bt 1 no addresss" gdb_test_no_output "set python print-stack message" \ |