~ubuntu-branches/ubuntu/raring/cell-gdb/raring

« back to all changes in this revision

Viewing changes to debian/patches/spu/diff-spu-gdb-interrupt

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-09-19 11:14:05 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070919111405-o1mwupec9d5e0waj
Tags: 6.6.50cvs20070623-1
* Update to SDK 3.0 earlyRel.
* Change cross-prefix to /usr/lib/cell/toolchain.  Do not change sysroot.
* debian/rules: Support parallel=<n> in DEB_BUILD_OPTIONS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
diff -ur gdb-orig/gdb/spu-tdep.c gdb-6.6/gdb/spu-tdep.c
2
 
--- gdb-orig/gdb/spu-tdep.c     2007-02-23 20:57:25.774954000 +0100
3
 
+++ gdb-6.6/gdb/spu-tdep.c      2007-02-23 21:39:41.265946040 +0100
4
 
@@ -844,7 +844,9 @@
5
 
 static CORE_ADDR
6
 
 spu_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
7
 
 {
8
 
-  return frame_unwind_register_unsigned (next_frame, SPU_PC_REGNUM);
9
 
+  CORE_ADDR pc = frame_unwind_register_unsigned (next_frame, SPU_PC_REGNUM);
10
 
+  /* Mask off interrupt enable bit.  */
11
 
+  return pc & -4;
12
 
 }
13
 
 
14
 
 static CORE_ADDR
15
 
@@ -853,6 +855,22 @@
16
 
   return frame_unwind_register_unsigned (next_frame, SPU_SP_REGNUM);
17
 
 }
18
 
 
19
 
+static CORE_ADDR
20
 
+spu_read_pc (ptid_t ptid)
21
 
+{
22
 
+  CORE_ADDR pc = read_register_pid (SPU_PC_REGNUM, ptid);
23
 
+  /* Mask off interrupt enable bit.  */
24
 
+  return pc & -4;
25
 
+}
26
 
+
27
 
+static void
28
 
+spu_write_pc (CORE_ADDR pc, ptid_t ptid)
29
 
+{
30
 
+  /* Keep interrupt enabled state unchanged.  */
31
 
+  CORE_ADDR old_pc = read_register_pid (SPU_PC_REGNUM, ptid);
32
 
+  write_register_pid (SPU_PC_REGNUM, (pc & -4) | (old_pc & 3), ptid);
33
 
+}
34
 
+
35
 
 
36
 
 /* Function calling convention.  */
37
 
 
38
 
@@ -1088,7 +1106,8 @@
39
 
       gdb_byte buf[4];
40
 
 
41
 
       regcache_cooked_read (current_regcache, SPU_PC_REGNUM, buf);
42
 
-      pc = extract_unsigned_integer (buf, 4);
43
 
+      /* Mask off interrupt enable bit.  */
44
 
+      pc = extract_unsigned_integer (buf, 4) & -4;
45
 
 
46
 
       if (target_read_memory (pc, buf, 4))
47
 
        return;
48
 
@@ -1098,9 +1117,9 @@
49
 
          instruction is a PPE-assisted call, in which case it is at PC + 8.
50
 
          Wrap around LS limit to be on the safe side.  */
51
 
       if ((insn & 0xffffff00) == 0x00002100)
52
 
-       next_pc = (pc + 8) & (SPU_LS_SIZE - 1) & -4;
53
 
+       next_pc = (pc + 8) & (SPU_LS_SIZE - 1);
54
 
       else
55
 
-       next_pc = (pc + 4) & (SPU_LS_SIZE - 1) & -4;
56
 
+       next_pc = (pc + 4) & (SPU_LS_SIZE - 1);
57
 
 
58
 
       insert_single_step_breakpoint (next_pc);
59
 
 
60
 
@@ -1113,10 +1132,10 @@
61
 
          else if (reg != -1)
62
 
            {
63
 
              regcache_cooked_read_part (current_regcache, reg, 0, 4, buf);
64
 
-             target += extract_unsigned_integer (buf, 4);
65
 
+             target += extract_unsigned_integer (buf, 4) & -4;
66
 
            }
67
 
 
68
 
-         target = target & (SPU_LS_SIZE - 1) & -4;
69
 
+         target = target & (SPU_LS_SIZE - 1);
70
 
          if (target != next_pc)
71
 
            insert_single_step_breakpoint (target);
72
 
        }
73
 
@@ -1856,6 +1875,8 @@
74
 
   set_gdbarch_num_pseudo_regs (gdbarch, SPU_NUM_PSEUDO_REGS);
75
 
   set_gdbarch_sp_regnum (gdbarch, SPU_SP_REGNUM);
76
 
   set_gdbarch_pc_regnum (gdbarch, SPU_PC_REGNUM);
77
 
+  set_gdbarch_read_pc (gdbarch, spu_read_pc);
78
 
+  set_gdbarch_write_pc (gdbarch, spu_write_pc);
79
 
   set_gdbarch_register_name (gdbarch, spu_register_name);
80
 
   set_gdbarch_register_type (gdbarch, spu_register_type);
81
 
   set_gdbarch_pseudo_register_read (gdbarch, spu_pseudo_register_read);