* ax-gdb.c (gen_bitfield_ref): Add EXP argument, use expression
authorUlrich Weigand <uweigand@de.ibm.com>
Wed, 17 Jun 2009 18:40:53 +0000 (18:40 +0000)
committerUlrich Weigand <uweigand@de.ibm.com>
Wed, 17 Jun 2009 18:40:53 +0000 (18:40 +0000)
architecture instead of current_gdbarch.
(gen_struct_ref): Add EXP argument, pass to get_bitfield_ref.
(gen_expr): Pass expression to get_struct_ref.

* symtab.h (struct symbol_ops): Add GDBARCH parameter to
tracepoint_var_ref callback.
* ax-gdb.c (gen_var_ref): Pass architecture to tracepoint_var_ref
symbol operation callback.
* dwarf2loc.c (dwarf2_tracepoint_var_ref): Add GDBARCH parameter.
Use it instead of current_gdbarch.
(locexpr_tracepoint_var_ref): Add GDBARCH parameter.  Pass it to
dwarf2_tracepoint_var_ref.
(loclist_tracepoint_var_ref): Likewise.

gdb/ChangeLog
gdb/ax-gdb.c
gdb/dwarf2loc.c
gdb/symtab.h

index 40a6a02b94a6fc19c5322af508c6b159961fff6f..d8ac8300d071e88e7691fae43b01772dbea7f373 100644 (file)
@@ -1,3 +1,20 @@
+2009-06-17  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * ax-gdb.c (gen_bitfield_ref): Add EXP argument, use expression
+       architecture instead of current_gdbarch.
+       (gen_struct_ref): Add EXP argument, pass to get_bitfield_ref.
+       (gen_expr): Pass expression to get_struct_ref.
+
+       * symtab.h (struct symbol_ops): Add GDBARCH parameter to
+       tracepoint_var_ref callback.
+       * ax-gdb.c (gen_var_ref): Pass architecture to tracepoint_var_ref
+       symbol operation callback.
+       * dwarf2loc.c (dwarf2_tracepoint_var_ref): Add GDBARCH parameter.
+       Use it instead of current_gdbarch.
+       (locexpr_tracepoint_var_ref): Add GDBARCH parameter.  Pass it to
+       dwarf2_tracepoint_var_ref.
+       (loclist_tracepoint_var_ref): Likewise.
+
 2009-06-17  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * prologue-value.c (make_pv_area): Add ADDR_BIT argument.
index 05728997e41ed627bbd924f4201d3721c1052e89..5e04b07f5208fcaddb92246e6f025cdd40da57f3 100644 (file)
@@ -124,10 +124,10 @@ static void gen_complement (struct agent_expr *ax, struct axs_value *value);
 static void gen_deref (struct agent_expr *, struct axs_value *);
 static void gen_address_of (struct agent_expr *, struct axs_value *);
 static int find_field (struct type *type, char *name);
-static void gen_bitfield_ref (struct agent_expr *ax,
+static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax,
                              struct axs_value *value,
                              struct type *type, int start, int end);
-static void gen_struct_ref (struct agent_expr *ax,
+static void gen_struct_ref (struct expression *exp, struct agent_expr *ax,
                            struct axs_value *value,
                            char *field,
                            char *operator_name, char *operand_name);
@@ -623,7 +623,7 @@ gen_var_ref (struct gdbarch *gdbarch, struct agent_expr *ax,
         Unfortunately DWARF 2 stores the frame-base (instead of the
         function) location in a function's symbol.  Oops!  For the
         moment enable this when/where applicable.  */
-      SYMBOL_COMPUTED_OPS (var)->tracepoint_var_ref (var, ax, value);
+      SYMBOL_COMPUTED_OPS (var)->tracepoint_var_ref (var, gdbarch, ax, value);
       break;
 
     case LOC_OPTIMIZED_OUT:
@@ -1147,8 +1147,9 @@ find_field (struct type *type, char *name)
    starting and one-past-ending *bit* numbers of the field within the
    structure.  */
 static void
-gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value,
-                 struct type *type, int start, int end)
+gen_bitfield_ref (struct expression *exp, struct agent_expr *ax,
+                 struct axs_value *value, struct type *type,
+                 int start, int end)
 {
   /* Note that ops[i] fetches 8 << i bits.  */
   static enum agent_op ops[]
@@ -1274,7 +1275,7 @@ gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value,
             the sign/zero extension will wipe them out.
             - If we're in the interior of the word, then there is no garbage
             on either end, because the ref operators zero-extend.  */
-         if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+         if (gdbarch_byte_order (exp->gdbarch) == BFD_ENDIAN_BIG)
            gen_left_shift (ax, end - (offset + op_size));
          else
            gen_left_shift (ax, offset - start);
@@ -1308,7 +1309,8 @@ gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value,
    the operator being compiled, and OPERAND_NAME is the kind of thing
    it operates on; we use them in error messages.  */
 static void
-gen_struct_ref (struct agent_expr *ax, struct axs_value *value, char *field,
+gen_struct_ref (struct expression *exp, struct agent_expr *ax,
+               struct axs_value *value, char *field,
                char *operator_name, char *operand_name)
 {
   struct type *type;
@@ -1339,7 +1341,7 @@ gen_struct_ref (struct agent_expr *ax, struct axs_value *value, char *field,
 
   /* Is this a bitfield?  */
   if (TYPE_FIELD_PACKED (type, i))
-    gen_bitfield_ref (ax, value, TYPE_FIELD_TYPE (type, i),
+    gen_bitfield_ref (exp, ax, value, TYPE_FIELD_TYPE (type, i),
                      TYPE_FIELD_BITPOS (type, i),
                      (TYPE_FIELD_BITPOS (type, i)
                       + TYPE_FIELD_BITSIZE (type, i)));
@@ -1698,9 +1700,9 @@ gen_expr (struct expression *exp, union exp_element **pc,
        (*pc) += 4 + BYTES_TO_EXP_ELEM (length + 1);
        gen_expr (exp, pc, ax, value);
        if (op == STRUCTOP_STRUCT)
-         gen_struct_ref (ax, value, name, ".", "structure or union");
+         gen_struct_ref (exp, ax, value, name, ".", "structure or union");
        else if (op == STRUCTOP_PTR)
-         gen_struct_ref (ax, value, name, "->",
+         gen_struct_ref (exp, ax, value, name, "->",
                          "pointer to a structure or union");
        else
          /* If this `if' chain doesn't handle it, then the case list
index 4cd77304b9f105f9b2677e5792136eb707eea1dc..16d8ceed057c724e16180cedf76fdf191a7647af 100644 (file)
@@ -366,9 +366,9 @@ dwarf2_loc_desc_needs_frame (gdb_byte *data, unsigned short size,
 }
 
 static void
-dwarf2_tracepoint_var_ref (struct symbol *symbol, struct agent_expr *ax,
-                          struct axs_value *value, gdb_byte *data,
-                          int size)
+dwarf2_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch,
+                          struct agent_expr *ax, struct axs_value *value,
+                          gdb_byte *data, int size)
 {
   if (size == 0)
     error (_("Symbol \"%s\" has been optimized out."),
@@ -401,7 +401,7 @@ dwarf2_tracepoint_var_ref (struct symbol *symbol, struct agent_expr *ax,
        error (_("Unexpected opcode after DW_OP_fbreg for symbol \"%s\"."),
               SYMBOL_PRINT_NAME (symbol));
 
-      gdbarch_virtual_frame_pointer (current_gdbarch, 
+      gdbarch_virtual_frame_pointer (gdbarch,
                                     ax->scope, &frame_reg, &frame_offset);
       ax_reg (ax, frame_reg);
       ax_const_l (ax, frame_offset);
@@ -522,12 +522,13 @@ locexpr_describe_location (struct symbol *symbol, struct ui_file *stream)
    against.  When there is one this function should be revisited.  */
 
 static void
-locexpr_tracepoint_var_ref (struct symbol * symbol, struct agent_expr * ax,
-                           struct axs_value * value)
+locexpr_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch,
+                           struct agent_expr *ax, struct axs_value *value)
 {
   struct dwarf2_locexpr_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol);
 
-  dwarf2_tracepoint_var_ref (symbol, ax, value, dlbaton->data, dlbaton->size);
+  dwarf2_tracepoint_var_ref (symbol, gdbarch, ax, value,
+                            dlbaton->data, dlbaton->size);
 }
 
 /* The set of location functions used with the DWARF-2 expression
@@ -594,8 +595,8 @@ loclist_describe_location (struct symbol *symbol, struct ui_file *stream)
 /* Describe the location of SYMBOL as an agent value in VALUE, generating
    any necessary bytecode in AX.  */
 static void
-loclist_tracepoint_var_ref (struct symbol * symbol, struct agent_expr * ax,
-                           struct axs_value * value)
+loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch,
+                           struct agent_expr *ax, struct axs_value *value)
 {
   struct dwarf2_loclist_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol);
   gdb_byte *data;
@@ -605,7 +606,7 @@ loclist_tracepoint_var_ref (struct symbol * symbol, struct agent_expr * ax,
   if (data == NULL)
     error (_("Variable \"%s\" is not available."), SYMBOL_NATURAL_NAME (symbol));
 
-  dwarf2_tracepoint_var_ref (symbol, ax, value, data, size);
+  dwarf2_tracepoint_var_ref (symbol, gdbarch, ax, value, data, size);
 }
 
 /* The set of location functions used with the DWARF-2 expression
index 18304b30c4682a198288e655df6ac1c8891ce313..b126c16361e0741ba2b9c2e3789009dc08fcd9d9 100644 (file)
@@ -527,8 +527,8 @@ struct symbol_computed_ops
      the caller will generate the right code in the process of
      treating this as an lvalue or rvalue.  */
 
-  void (*tracepoint_var_ref) (struct symbol * symbol, struct agent_expr * ax,
-                             struct axs_value * value);
+  void (*tracepoint_var_ref) (struct symbol *symbol, struct gdbarch *gdbarch,
+                             struct agent_expr *ax, struct axs_value *value);
 };
 
 /* Functions used with LOC_REGISTER and LOC_REGPARM_ADDR.  */
This page took 0.032606 seconds and 4 git commands to generate.