aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2011-02-02 18:03:35 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2011-02-02 18:03:35 +0000
commit2e9e421ffe805e5a582decffbb811c05ae6f8ccd (patch)
tree52d6e6f6b3670b3f76554e72f5006ea0f31e5115 /gdb
parent580688f393b43a7456e3bf2857da9c5401e8954f (diff)
downloadgdb-2e9e421ffe805e5a582decffbb811c05ae6f8ccd.zip
gdb-2e9e421ffe805e5a582decffbb811c05ae6f8ccd.tar.gz
gdb-2e9e421ffe805e5a582decffbb811c05ae6f8ccd.tar.bz2
* arm-tdep.c (arm_analyze_load_stack_chk_guard): Avoid build break
due to accessing uninitialized variable. Fix indentation.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/arm-tdep.c41
2 files changed, 26 insertions, 20 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b57bbdf..a830b30 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2011-02-02 Ulrich Weigand <ulrich.weigand@linaro.org>
+
+ * arm-tdep.c (arm_analyze_load_stack_chk_guard): Avoid build break
+ due to accessing uninitialized variable. Fix indentation.
+
2011-02-02 Pedro Alves <pedro@codesourcery.com>
* c-valprint.c (c_value_print): When doing virtual base pointer
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index e24a6d9..0b5f079 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -1198,29 +1198,30 @@ arm_analyze_load_stack_chk_guard(CORE_ADDR pc, struct gdbarch *gdbarch,
}
else
{
- unsigned int insn
- = read_memory_unsigned_integer (pc, 4, byte_order_for_code);
-
- if ((insn & 0x0e5f0000) == 0x041f0000) /* ldr Rd, #immed */
- {
- address = bits (insn, 0, 11);
- *destreg = bits (insn, 12, 15);
- *offset = 4;
- }
- else if ((insn & 0x0ff00000) == 0x03000000) /* movw Rd, #const */
- {
- low = EXTRACT_MOVW_MOVT_IMM_A (insn);
+ unsigned int insn
+ = read_memory_unsigned_integer (pc, 4, byte_order_for_code);
- insn
- = read_memory_unsigned_integer (pc + 4, 4, byte_order_for_code);
+ if ((insn & 0x0e5f0000) == 0x041f0000) /* ldr Rd, #immed */
+ {
+ address = bits (insn, 0, 11);
+ *destreg = bits (insn, 12, 15);
+ *offset = 4;
+ }
+ else if ((insn & 0x0ff00000) == 0x03000000) /* movw Rd, #const */
+ {
+ low = EXTRACT_MOVW_MOVT_IMM_A (insn);
- if ((insn & 0x0ff00000) == 0x03400000) /* movt Rd, #const */
- high = EXTRACT_MOVW_MOVT_IMM_A (insn);
+ insn
+ = read_memory_unsigned_integer (pc + 4, 4, byte_order_for_code);
- address = (high << 16 | low);
- *destreg = bits (insn, 12, 15);
- *offset = 8;
- }
+ if ((insn & 0x0ff00000) == 0x03400000) /* movt Rd, #const */
+ {
+ high = EXTRACT_MOVW_MOVT_IMM_A (insn);
+ *destreg = bits (insn, 12, 15);
+ *offset = 8;
+ address = (high << 16 | low);
+ }
+ }
}
return address;