• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修訂b0b4b5019484fbf1dd074527270f193703411498 (tree)
時間2015-10-22 00:26:05
作者Antoine Tremblay <antoine.tremblay@eric...>
CommiterAntoine Tremblay

Log Message

Refactor the breakpoint definitions in linux-arm-low.c.

Before arm_sw_breakpoint_from_kind would use an #ifdef to return the right
arm_breakpoint from the abi or eabi breakpoint type.

arm_breakpoint_at would also check for the arm_breakpoint ||
arm_eabi_breakpoint.

Thus the selected arm_breakpoint would be what arm_sw_breakpoint_from_kind
returned and arm_breakpoint was arm_abi_breakpoint.

This patch makes it more clear by naming those for what they are : 2 separate
entities: arm_abi_breakpoint and arm_eabi_breakpoint and set the current used
one as arm_breakpoint.

This allows a cleaner arm_sw_breakpoint_from_kind as it just returns
arm_breakpoint rather than having the #ifdef in that function.

Any other reference to the arm_breakpoint can now also be clear of #ifdefs...

No regressions on Ubuntu 14.04 on ARMv7 and x86.
With gdbserver-{native,extended} / { -marm -mthumb }

gdb/gdbserver/ChangeLog:

* linux-arm-low.c: Refactor breakpoint definitions.
(arm_breakpoint_at): Adjust for arm_abi_breakpoint.
(arm_sw_breakpoint_from_kind): Adjust for arm_breakpoint.

Change Summary

差異

--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,11 @@
11 2015-10-21 Antoine Tremblay <antoine.tremblay@ericsson.com>
22
3+ * linux-arm-low.c: Refactor breakpoint definitions.
4+ (arm_breakpoint_at): Adjust for arm_abi_breakpoint.
5+ (arm_sw_breakpoint_from_kind): Adjust for arm_breakpoint.
6+
7+2015-10-21 Antoine Tremblay <antoine.tremblay@ericsson.com>
8+
39 * Makefile.in: Add arm.c/o.
410 * configure.srv: Likewise.
511 * linux-arm-low.c (arm_breakpoint_kinds): New enum.
--- a/gdb/gdbserver/linux-arm-low.c
+++ b/gdb/gdbserver/linux-arm-low.c
@@ -244,18 +244,25 @@ arm_set_pc (struct regcache *regcache, CORE_ADDR pc)
244244 }
245245
246246 /* Correct in either endianness. */
247-static const unsigned long arm_breakpoint = 0xef9f0001;
248-#define arm_breakpoint_len 4
249-static const unsigned short thumb_breakpoint = 0xde01;
250-#define thumb_breakpoint_len 2
251-static const unsigned short thumb2_breakpoint[] = { 0xf7f0, 0xa000 };
252-#define thumb2_breakpoint_len 4
247+#define arm_abi_breakpoint 0xef9f0001UL
253248
254249 /* For new EABI binaries. We recognize it regardless of which ABI
255250 is used for gdbserver, so single threaded debugging should work
256251 OK, but for multi-threaded debugging we only insert the current
257252 ABI's breakpoint instruction. For now at least. */
258-static const unsigned long arm_eabi_breakpoint = 0xe7f001f0;
253+#define arm_eabi_breakpoint 0xe7f001f0UL
254+
255+#ifndef __ARM_EABI__
256+static const unsigned long arm_breakpoint = arm_abi_breakpoint;
257+#else
258+static const unsigned long arm_breakpoint = arm_eabi_breakpoint;
259+#endif
260+
261+#define arm_breakpoint_len 4
262+static const unsigned short thumb_breakpoint = 0xde01;
263+#define thumb_breakpoint_len 2
264+static const unsigned short thumb2_breakpoint[] = { 0xf7f0, 0xa000 };
265+#define thumb2_breakpoint_len 4
259266
260267 static int
261268 arm_breakpoint_at (CORE_ADDR where)
@@ -287,7 +294,7 @@ arm_breakpoint_at (CORE_ADDR where)
287294 unsigned long insn;
288295
289296 (*the_target->read_memory) (where, (unsigned char *) &insn, 4);
290- if (insn == arm_breakpoint)
297+ if (insn == arm_abi_breakpoint)
291298 return 1;
292299
293300 if (insn == arm_eabi_breakpoint)
@@ -978,11 +985,7 @@ arm_sw_breakpoint_from_kind (int kind , int *size)
978985 return (gdb_byte *) &thumb2_breakpoint;
979986 case ARM_BP_KIND_ARM:
980987 *size = arm_breakpoint_len;
981-#ifndef __ARM_EABI__
982988 return (const gdb_byte *) &arm_breakpoint;
983-#else
984- return (const gdb_byte *) &arm_eabi_breakpoint;
985-#endif
986989 default:
987990 return NULL;
988991 }