aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2010-02-01 16:16:30 +0000
committerDaniel Jacobowitz <drow@false.org>2010-02-01 16:16:30 +0000
commitf9d67f435f5d5dc575f02697e03f19996fa5db6b (patch)
treed0b057e14eab611b95ad5d934e608bb704c9189c /gdb/testsuite
parent177321bd85d5a3d4ca05d320696d8af43bc0fc05 (diff)
downloadgdb-f9d67f435f5d5dc575f02697e03f19996fa5db6b.zip
gdb-f9d67f435f5d5dc575f02697e03f19996fa5db6b.tar.gz
gdb-f9d67f435f5d5dc575f02697e03f19996fa5db6b.tar.bz2
* arm-tdep.c (arm_find_mapping_symbol): New function, from
arm_pc_is_thumb. (arm_pc_is_thumb): Use arm_find_mapping_symbol. (extend_buffer_earlier): New function. (MAX_IT_BLOCK_PREFIX, IT_SCAN_THRESHOLD): New constants. (arm_adjust_breakpoint_address): New function. (arm_gdbarch_init): Register arm_adjust_breakpoint_address. testsuite/ * gdb.arch/thumb2-it.S (it_breakpoints): New function. * gdb.arch/thumb2-it.exp (test_it_break): New function. (Top level): Call it.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.arch/thumb2-it.S43
-rw-r--r--gdb/testsuite/gdb.arch/thumb2-it.exp17
3 files changed, 66 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 05ecd88..00f4aec 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2010-02-01 Daniel Jacobowitz <dan@codesourcery.com>
+ * gdb.arch/thumb2-it.S (it_breakpoints): New function.
+ * gdb.arch/thumb2-it.exp (test_it_break): New function.
+ (Top level): Call it.
+
+2010-02-01 Daniel Jacobowitz <dan@codesourcery.com>
+
* gdb.arch/thumb2-it.S, gdb.arch/thumb2-it.exp: New files.
2010-01-29 Daniel Jacobowitz <dan@codesourcery.com>
diff --git a/gdb/testsuite/gdb.arch/thumb2-it.S b/gdb/testsuite/gdb.arch/thumb2-it.S
index a5aab8c..700c92a 100644
--- a/gdb/testsuite/gdb.arch/thumb2-it.S
+++ b/gdb/testsuite/gdb.arch/thumb2-it.S
@@ -136,4 +136,47 @@ it_8:
addlt r0, #8 @ Not reached
bx lr @ Done, Check $r0 == 1
+ .type it_breakpoints,%function
+ .thumb_func
+it_breakpoints:
+ mov r0, #0
+ cmp r0, #0
+ it eq @ Location 1 @ Break 1
+ moveq r0, #0
+
+ it eq @ Location 2
+ moveq r0, #0 @ Break 2
+
+ it ne @ Location 3
+ movne r0, #0 @ Break 3
+
+ @ An IT block of maximum size.
+ itttt eq @ Location 4
+ moveq.w r0, #0
+ moveq.w r0, #0
+ moveq.w r0, #0
+ moveq.w r0, #0 @ Break 4
+
+ @ Just outside an IT block.
+ it eq
+ moveq r0, #0
+ mov r0, #0 @ Location 5 @ Break 5
+
+ @ After something that looks like an IT block, but
+ @ is the second half of an instruction.
+ .p2align 6
+ cmp r0, r0
+ b 1f
+ b.w .+0xe14 @ 0xf000 0xbf08 -> second half is IT EQ
+1: mov r0, #0 @ Location 6 @ Break 6
+
+ @ After something that looks like an IT block, but
+ @ is data.
+ .p2align 6
+ b 1f
+ .short 0xbf08
+1: mov r0, #0 @ Location 7 @ Break 7
+
+ bx lr
+
#endif /* __thumb2__ */
diff --git a/gdb/testsuite/gdb.arch/thumb2-it.exp b/gdb/testsuite/gdb.arch/thumb2-it.exp
index 5ef8475..5144ac1 100644
--- a/gdb/testsuite/gdb.arch/thumb2-it.exp
+++ b/gdb/testsuite/gdb.arch/thumb2-it.exp
@@ -125,6 +125,17 @@ proc test_it_block { func } {
return
}
+proc test_it_break { ndx } {
+ set line [gdb_get_line_number "@ Break ${ndx}"]
+
+ if { ! [gdb_breakpoint "${line}"] } {
+ unresolved "continue to breakpoint: test ${ndx}"
+ return
+ }
+
+ gdb_continue_to_breakpoint "test ${ndx}" ".*@ Location ${ndx}.*"
+}
+
# If we are using software single-stepping in GDB, then GDB will not
# stop at conditional instructions with a false predicate during stepi.
# If we are using a simulator or debug interface with hardware single
@@ -138,3 +149,9 @@ if { [istarget arm*-linux*] } {
for { set i 1 } { $i <= 8 } { incr i } {
test_it_block it_${i}
}
+
+gdb_breakpoint "*it_breakpoints"
+gdb_test "call it_breakpoints()" "Breakpoint.*"
+for { set i 1 } { $i <= 7 } { incr i } {
+ test_it_break ${i}
+}