diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-05-01 23:21:08 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-05-01 23:21:08 +0000 |
commit | 2b6fd0d87d374675c1cba32ce24cf5c34870d956 (patch) | |
tree | d28b9349d909b93bea920879f580b1509332dddd /gdb/testsuite | |
parent | 13e10c0a01bb77b60670a217609241b554f82349 (diff) | |
download | gdb-2b6fd0d87d374675c1cba32ce24cf5c34870d956.zip gdb-2b6fd0d87d374675c1cba32ce24cf5c34870d956.tar.gz gdb-2b6fd0d87d374675c1cba32ce24cf5c34870d956.tar.bz2 |
2003-05-01 Andrew Cagney <cagney@redhat.com>
* disasm.c (gdb_disassemble_from_exec): Delete global variable.
(gdb_disassembly): Make "di" non static, always initialize and
cleanup. Always use dis_asm_read_memory.
(gdb_dis_asm_read_memory): Delete function.
2003-05-01 Andrew Cagney <cagney@redhat.com>
* gdb.asm/asm-source.exp: Check that "disassm" and "x/i" of a
variable do not give memory errors.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.asm/asm-source.exp | 28 |
2 files changed, 31 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index edecb73..6dc760e 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-05-01 Andrew Cagney <cagney@redhat.com> + + * gdb.asm/asm-source.exp: Check that "disassm" and "x/i" of a + variable do not give memory errors. + 2003-04-30 Adam Fedor <fedor@gnu.org> * Makefile.in (ALL_SUBDIRS): Add gdb.objc diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp index ac1bcd2..96b7991 100644 --- a/gdb/testsuite/gdb.asm/asm-source.exp +++ b/gdb/testsuite/gdb.asm/asm-source.exp @@ -293,11 +293,35 @@ gdb_test "next" "17\[ \t\]+gdbasm_leave" "next over foo3" gdb_test "return" "\#0 main .*37\[ \t\]+gdbasm_exit0" "return from foo2" \ "Make (foo2|selected stack frame) return now\?.*" "y" -# See if we can look at a global variable +# Disassemble something, check the output +proc test_dis { command var } { + global gdb_prompt + send_gdb "${command}\n" + gdb_expect { + -re "${var}.*:.*Cannot access" { + # The "disassembler" was only accessing the local + # executable and that would cause attempts to disassemble + # variables to fail (memory not valid). + fail "${command} (memory read error)" + } + -re "${var}.*:.*${gdb_prompt}" { + pass "${command}" + } + timeout { + fail "${command} (timeout)" + } + } +} + +# See if we can look at a global variable, three ways gdb_test "print globalvar" ".* = 11" "look at global variable" +test_dis "x/i globalvar" "globalvar" +test_dis "disassem &globalvar &globalvar+1" "globalvar" -# See if we can look at a static variable +# See if we can look at a static variable, three ways gdb_test "print staticvar" ".* = 5" "look at static variable" +test_dis "x/i &staticvar" "staticvar" +test_dis "disassem &staticvar &staticvar+1" "staticvar" # See if we can look at a static function gdb_test "disassem foostatic" ".*<foostatic\\+0>:.*End of assembler dump." \ |