diff options
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/python.c | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/python.exp | 20 |
3 files changed, 26 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index b66ef43..b6a2092 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-05-13 Siva Chandra Reddy <sivachandra@google.com> + + * gdb.python/python.c: Add a new breakpoint comment. + * gdb.python/python.exp: Add tests to test gdb.find_pc_line. + 2011-12-26 Kwok Cheung Yeung <kcy@codesourcery.com> * gdb.base/info-os.exp: New file. diff --git a/gdb/testsuite/gdb.python/python.c b/gdb/testsuite/gdb.python/python.c index d9f02cd..50bee21 100644 --- a/gdb/testsuite/gdb.python/python.c +++ b/gdb/testsuite/gdb.python/python.c @@ -23,6 +23,6 @@ int main (int argc, char *argv[]) { func1 (); - func2 (); + func2 (); /* Break at func2 call site. */ return 0; /* Break to end. */ } diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp index 7333e26..ef0cdcf 100644 --- a/gdb/testsuite/gdb.python/python.exp +++ b/gdb/testsuite/gdb.python/python.exp @@ -367,3 +367,23 @@ gdb_test_multiple "python gdb.prompt_hook = error_prompt" "set the hook" { gdb_py_test_silent_cmd "python gdb.prompt_hook = None" \ "set the hook to default" 1 + +# Start with a fresh gdb. +clean_restart ${testfile} + +# The following tests require execution. + +if ![runto_main] then { + fail "Can't run to main" + return 0 +} + +runto [gdb_get_line_number "Break at func2 call site."] + +gdb_py_test_silent_cmd "python line = gdb.selected_frame().find_sal().line" "Get line number of func2 call site" 1 +gdb_test "python print gdb.find_pc_line(gdb.selected_frame().pc()).line == line" "True" "Test find_pc_line at func2 call site" + +gdb_py_test_silent_cmd "step" "Step into func2" 1 +gdb_py_test_silent_cmd "up" "Step out of func2" 1 + +gdb_test "python print gdb.find_pc_line(gdb.selected_frame().pc()).line > line" "True" "Test find_pc_line with resume address" |