diff options
author | Phil Muldoon <pmuldoon@redhat.com> | 2013-08-30 10:12:19 +0000 |
---|---|---|
committer | Phil Muldoon <pmuldoon@redhat.com> | 2013-08-30 10:12:19 +0000 |
commit | 96d9056e29036d7d841e71f60648018f115d808e (patch) | |
tree | 06a57faccd1fc32c944c05e6eeeee02aafefb05f /gdb/testsuite | |
parent | e2668a1a80552dc09c288886591f0be9ecbebd83 (diff) | |
download | gdb-96d9056e29036d7d841e71f60648018f115d808e.zip gdb-96d9056e29036d7d841e71f60648018f115d808e.tar.gz gdb-96d9056e29036d7d841e71f60648018f115d808e.tar.bz2 |
2013-08-30 Phil Muldoon <pmuldoon@redhat.com>
PR python/15461
* python/py-arch.c (ARCHPY_REQUIRE_VALID): New macro.
(archpy_name): Check for valid architecture.
(archpy_disassemble): Ditto.
2013-08-30 Phil Muldoon <pmuldoon@redhat.com>
* gdb.python/py-arch.exp: Tests for invalid architecture.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-arch.exp | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 3b259c7..67dc813 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2013-08-30 Phil Muldoon <pmuldoon@redhat.com> + + * gdb.python/py-arch.exp: Tests for invalid architecture. + 2013-08-29 Sterling Augustine <saugustine@google.com> * boards/remote-stdio-gdbserver.exp: Set rcp_prog and diff --git a/gdb/testsuite/gdb.python/py-arch.exp b/gdb/testsuite/gdb.python/py-arch.exp index 7413b44..174b151 100644 --- a/gdb/testsuite/gdb.python/py-arch.exp +++ b/gdb/testsuite/gdb.python/py-arch.exp @@ -26,6 +26,14 @@ if ![runto_main] { return -1 } +# Test python/15461. Invalid architectures should not trigger an +# internal GDB assert. +gdb_py_test_silent_cmd "python empty = gdb.Architecture()" "get empty arch" 0 +gdb_test "python print(empty.name())" ".*Architecture is invalid.*" \ + "Test empty architecture.name does not trigger an assert" +gdb_test "python print(empty.disassemble())" ".*Architecture is invalid.*" \ + "Test empty architecture.disassemble does not trigger an assert" + gdb_py_test_silent_cmd "python frame = gdb.selected_frame()" "get frame" 0 gdb_py_test_silent_cmd "python arch = frame.architecture()" "get arch" 0 gdb_py_test_silent_cmd "python pc = frame.pc()" "get pc" 0 |