summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.arch
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2010-02-01 16:16:26 +0000
committerDaniel Jacobowitz <dan@debian.org>2010-02-01 16:16:26 +0000
commit7f3f596fcee5e48061e248513e18096ca653620b (patch)
tree4487077a3978dcbbbaa431aa3a50cb1b59e8ce64 /gdb/testsuite/gdb.arch
parentf8893c711c4ee381385d983175cacb786f64774b (diff)
downloadgdb-7f3f596fcee5e48061e248513e18096ca653620b.tar.gz
* 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/gdb.arch')
-rw-r--r--gdb/testsuite/gdb.arch/thumb2-it.S43
-rw-r--r--gdb/testsuite/gdb.arch/thumb2-it.exp17
2 files changed, 60 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.arch/thumb2-it.S b/gdb/testsuite/gdb.arch/thumb2-it.S
index a5aab8cb1be..700c92ad73d 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 5ef8475fde2..5144ac16f2a 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}
+}