~ubuntu-branches/ubuntu/saucy/cell-gdb/saucy

« back to all changes in this revision

Viewing changes to debian/oldp/ppu/diff-spu-gdb-regtype

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-09-24 09:56:11 UTC
  • Revision ID: james.westby@ubuntu.com-20070924095611-n3moal4rh1vhx221
Tags: 6.6.50cvs20070623-1ubuntu1
Fix build dependencies for powerpc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
diff -urN gdb-orig/gdb/findvar.c gdb-6.6/gdb/findvar.c
2
 
--- gdb-orig/gdb/findvar.c      2006-11-24 20:59:57.000000000 +0100
3
 
+++ gdb-6.6/gdb/findvar.c       2006-12-13 19:40:48.191514192 +0100
4
 
@@ -648,6 +648,7 @@
5
 
       VALUE_LVAL (v) = lval_register;
6
 
       VALUE_FRAME_ID (v) = get_frame_id (frame);
7
 
       VALUE_REGNUM (v) = regnum;
8
 
+      VALUE_REGTYPE (v) = type;
9
 
     }
10
 
   else
11
 
     {
12
 
diff -urN gdb-orig/gdb/valarith.c gdb-6.6/gdb/valarith.c
13
 
--- gdb-orig/gdb/valarith.c     2006-01-24 22:21:12.000000000 +0100
14
 
+++ gdb-6.6/gdb/valarith.c      2006-12-13 19:40:48.197513280 +0100
15
 
@@ -280,6 +280,7 @@
16
 
     VALUE_LVAL (v) = VALUE_LVAL (array);
17
 
   VALUE_ADDRESS (v) = VALUE_ADDRESS (array);
18
 
   VALUE_REGNUM (v) = VALUE_REGNUM (array);
19
 
+  VALUE_REGTYPE (v) = VALUE_REGTYPE (array);
20
 
   VALUE_FRAME_ID (v) = VALUE_FRAME_ID (array);
21
 
   set_value_offset (v, value_offset (array) + elt_offs);
22
 
   return v;
23
 
diff -urN gdb-orig/gdb/valops.c gdb-6.6/gdb/valops.c
24
 
--- gdb-orig/gdb/valops.c       2006-10-09 21:28:14.000000000 +0200
25
 
+++ gdb-6.6/gdb/valops.c        2006-12-13 19:40:48.245505984 +0100
26
 
@@ -643,12 +643,31 @@
27
 
          error (_("Value being assigned to is no longer active."));
28
 
        
29
 
        if (VALUE_LVAL (toval) == lval_register
30
 
-           && CONVERT_REGISTER_P (VALUE_REGNUM (toval), type))
31
 
+           && VALUE_REGTYPE (toval) != NULL
32
 
+           && CONVERT_REGISTER_P (value_reg, VALUE_REGTYPE (toval)))
33
 
          {
34
 
-           /* If TOVAL is a special machine register requiring
35
 
+           /* TOVAL is a special machine register requiring
36
 
               conversion of program values to a special raw format.  */
37
 
-           VALUE_TO_REGISTER (frame, VALUE_REGNUM (toval),
38
 
-                              type, value_contents (fromval));
39
 
+
40
 
+           /* Determine type of full register contents.  Note that TOVAL
41
 
+              may refer to a subfield of the full register.  */
42
 
+           struct type *regtype = VALUE_REGTYPE (toval);
43
 
+           gdb_byte *buffer = alloca (TYPE_LENGTH (regtype));
44
 
+
45
 
+           /* Copy in old register contents.  */
46
 
+           REGISTER_TO_VALUE (frame, value_reg, regtype, buffer);
47
 
+
48
 
+           /* Modify what needs to be modified.  */
49
 
+           if (value_bitsize (toval))
50
 
+             modify_field (buffer + value_offset (toval),
51
 
+                           value_as_long (fromval),
52
 
+                           value_bitpos (toval), value_bitsize (toval));
53
 
+           else
54
 
+             memcpy (buffer + value_offset (toval),
55
 
+                     value_contents (fromval), TYPE_LENGTH (type));
56
 
+
57
 
+           /* Write back the new register contents.  */
58
 
+           VALUE_TO_REGISTER (frame, value_reg, regtype, buffer);
59
 
          }
60
 
        else
61
 
          {
62
 
diff -urN gdb-orig/gdb/value.c gdb-6.6/gdb/value.c
63
 
--- gdb-orig/gdb/value.c        2006-03-31 12:36:18.000000000 +0200
64
 
+++ gdb-6.6/gdb/value.c 2006-12-13 19:40:48.291498992 +0100
65
 
@@ -135,6 +135,9 @@
66
 
      list.  */
67
 
   struct value *next;
68
 
 
69
 
+  /* Full type of register contents if the value is from a register.  */
70
 
+  struct type *regtype;
71
 
+
72
 
   /* Register number if the value is from a register.  */
73
 
   short regnum;
74
 
 
75
 
@@ -444,6 +447,12 @@
76
 
   return &value->regnum;
77
 
 }
78
 
 
79
 
+struct type **
80
 
+deprecated_value_regtype_hack (struct value *value)
81
 
+{
82
 
+  return &value->regtype;
83
 
+}
84
 
+
85
 
 int
86
 
 deprecated_value_modifiable (struct value *value)
87
 
 {
88
 
@@ -557,6 +566,7 @@
89
 
   val->bitsize = arg->bitsize;
90
 
   VALUE_FRAME_ID (val) = VALUE_FRAME_ID (arg);
91
 
   VALUE_REGNUM (val) = VALUE_REGNUM (arg);
92
 
+  VALUE_REGTYPE (val) = VALUE_REGTYPE (arg);
93
 
   val->lazy = arg->lazy;
94
 
   val->optimized_out = arg->optimized_out;
95
 
   val->embedded_offset = value_embedded_offset (arg);
96
 
@@ -1347,6 +1357,7 @@
97
 
     VALUE_LVAL (v) = lval_internalvar_component;
98
 
   VALUE_ADDRESS (v) = VALUE_ADDRESS (arg1);
99
 
   VALUE_REGNUM (v) = VALUE_REGNUM (arg1);
100
 
+  VALUE_REGTYPE (v) = VALUE_REGTYPE (arg1);
101
 
   VALUE_FRAME_ID (v) = VALUE_FRAME_ID (arg1);
102
 
 /*  VALUE_OFFSET (v) = VALUE_OFFSET (arg1) + offset
103
 
    + TYPE_FIELD_BITPOS (arg_type, fieldno) / 8; */
104
 
diff -urN gdb-orig/gdb/value.h gdb-6.6/gdb/value.h
105
 
--- gdb-orig/gdb/value.h        2006-11-24 20:59:57.000000000 +0100
106
 
+++ gdb-6.6/gdb/value.h 2006-12-13 19:40:48.333492608 +0100
107
 
@@ -220,6 +220,10 @@
108
 
 extern short *deprecated_value_regnum_hack (struct value *);
109
 
 #define VALUE_REGNUM(val) (*deprecated_value_regnum_hack (val))
110
 
 
111
 
+/* Full type of register contents if the value is from a register.  */
112
 
+extern struct type **deprecated_value_regtype_hack (struct value *);
113
 
+#define VALUE_REGTYPE(val) (*deprecated_value_regtype_hack (val))
114
 
+
115
 
 /* Convert a REF to the object referenced.  */
116
 
 
117
 
 extern struct value *coerce_ref (struct value *value);