* c-valprint.c (c_value_print): Fix up some formatting. Use
[deliverable/binutils-gdb.git] / gdb / findvar.c
index 94140d6f438eaa494a41671381a8b4b969c0cc16..8c48c934d40568209e0fb489f90a0495050e87b1 100644 (file)
@@ -57,8 +57,8 @@ extract_signed_integer (const void *addr, int len)
   const unsigned char *endaddr = startaddr + len;
 
   if (len > (int) sizeof (LONGEST))
-    error ("\
-That operation is not available on integers of more than %d bytes.",
+    error (_("\
+That operation is not available on integers of more than %d bytes."),
           (int) sizeof (LONGEST));
 
   /* Start at the most significant end of the integer, and work towards
@@ -91,8 +91,8 @@ extract_unsigned_integer (const void *addr, int len)
   const unsigned char *endaddr = startaddr + len;
 
   if (len > (int) sizeof (ULONGEST))
-    error ("\
-That operation is not available on integers of more than %d bytes.",
+    error (_("\
+That operation is not available on integers of more than %d bytes."),
           (int) sizeof (ULONGEST));
 
   /* Start at the most significant end of the integer, and work towards
@@ -169,8 +169,8 @@ extract_typed_address (const void *buf, struct type *type)
   if (TYPE_CODE (type) != TYPE_CODE_PTR
       && TYPE_CODE (type) != TYPE_CODE_REF)
     internal_error (__FILE__, __LINE__,
-                   "extract_typed_address: "
-                   "type is not a pointer or reference");
+                   _("extract_typed_address: "
+                   "type is not a pointer or reference"));
 
   return POINTER_TO_ADDRESS (type, buf);
 }
@@ -238,8 +238,8 @@ store_typed_address (void *buf, struct type *type, CORE_ADDR addr)
   if (TYPE_CODE (type) != TYPE_CODE_PTR
       && TYPE_CODE (type) != TYPE_CODE_REF)
     internal_error (__FILE__, __LINE__,
-                   "store_typed_address: "
-                   "type is not a pointer or reference");
+                   _("store_typed_address: "
+                   "type is not a pointer or reference"));
 
   ADDRESS_TO_POINTER (type, buf, addr);
 }
@@ -287,7 +287,7 @@ value_of_register (int regnum, struct frame_info *frame)
   VALUE_LVAL (reg_val) = lval;
   VALUE_ADDRESS (reg_val) = addr;
   VALUE_REGNUM (reg_val) = regnum;
-  VALUE_OPTIMIZED_OUT (reg_val) = optim;
+  set_value_optimized_out (reg_val, optim);
   VALUE_FRAME_ID (reg_val) = get_frame_id (frame);
   return reg_val;
 }
@@ -385,12 +385,20 @@ read_var_value (struct symbol *var, struct frame_info *frame)
   CORE_ADDR addr;
   int len;
 
-  v = allocate_value (type);
-  VALUE_LVAL (v) = lval_memory;        /* The most likely possibility.  */
+  if (SYMBOL_CLASS (var) == LOC_COMPUTED
+      || SYMBOL_CLASS (var) == LOC_COMPUTED_ARG
+      || SYMBOL_CLASS (var) == LOC_REGISTER
+      || SYMBOL_CLASS (var) == LOC_REGPARM)
+    /* These cases do not use V.  */
+    v = NULL;
+  else
+    {
+      v = allocate_value (type);
+      VALUE_LVAL (v) = lval_memory;    /* The most likely possibility.  */
+    }
 
   len = TYPE_LENGTH (type);
 
-
   /* FIXME drow/2003-09-06: this call to the selected frame should be
      pushed upwards to the callers.  */
   if (frame == NULL)
@@ -445,13 +453,14 @@ read_var_value (struct symbol *var, struct frame_info *frame)
        CORE_ADDR locaddr;
        struct value *loc;
        if (!target_has_execution)
-         error ("\
+         error (_("\
 Attempt to access variable defined in different shared object or load module when\n\
-addresses have not been bound by the dynamic loader. Try again when executable is running.");
+addresses have not been bound by the dynamic loader. Try again when executable is running."));
 
        locaddr = SYMBOL_VALUE_ADDRESS (var);
        loc = value_at (lookup_pointer_type (type), locaddr);
        addr = value_as_address (loc);
+       break;
       }
 
     case LOC_ARG:
@@ -495,14 +504,14 @@ addresses have not been bound by the dynamic loader. Try again when executable i
        regval = value_from_register (lookup_pointer_type (type),
                                      SYMBOL_BASEREG (var), frame);
        if (regval == NULL)
-         error ("Value of base register not available.");
+         error (_("Value of base register not available."));
        addr = value_as_address (regval);
        addr += SYMBOL_VALUE (var);
        break;
       }
 
     case LOC_TYPEDEF:
-      error ("Cannot look up value of a typedef");
+      error (_("Cannot look up value of a typedef"));
       break;
 
     case LOC_BLOCK:
@@ -532,7 +541,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i
                                          frame);
 
            if (regval == NULL)
-             error ("Value of register variable not available.");
+             error (_("Value of register variable not available."));
 
            addr = value_as_address (regval);
            VALUE_LVAL (v) = lval_memory;
@@ -542,7 +551,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i
            regval = value_from_register (type, regno, frame);
 
            if (regval == NULL)
-             error ("Value of register variable not available.");
+             error (_("Value of register variable not available."));
            return regval;
          }
       }
@@ -576,16 +585,16 @@ addresses have not been bound by the dynamic loader. Try again when executable i
 
     case LOC_OPTIMIZED_OUT:
       VALUE_LVAL (v) = not_lval;
-      VALUE_OPTIMIZED_OUT (v) = 1;
+      set_value_optimized_out (v, 1);
       return v;
 
     default:
-      error ("Cannot look up value of a botched symbol.");
+      error (_("Cannot look up value of a botched symbol."));
       break;
     }
 
   VALUE_ADDRESS (v) = addr;
-  VALUE_LAZY (v) = 1;
+  set_value_lazy (v, 1);
   return v;
 }
 
@@ -701,7 +710,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
          VALUE_REGNUM (v) = regnum;
        }
       
-      VALUE_OPTIMIZED_OUT (v) = optimized;
+      set_value_optimized_out (v, optimized);
       
       /* Any structure stored in more than one register will always be
          an integral number of registers.  Otherwise, you need to do
@@ -710,9 +719,9 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
       if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
          && len < register_size (current_gdbarch, regnum))
        /* Big-endian, and we want less than full size.  */
-       v->offset = register_size (current_gdbarch, regnum) - len;
+       set_value_offset (v, register_size (current_gdbarch, regnum) - len);
       else
-       v->offset = 0;
+       set_value_offset (v, 0);
       memcpy (value_contents_raw (v), value_bytes + value_offset (v), len);
     }
   return v;
@@ -736,7 +745,7 @@ locate_var_value (struct symbol *var, struct frame_info *frame)
 
   lazy_value = read_var_value (var, frame);
   if (lazy_value == 0)
-    error ("Address of \"%s\" is unknown.", SYMBOL_PRINT_NAME (var));
+    error (_("Address of \"%s\" is unknown."), SYMBOL_PRINT_NAME (var));
 
   if (value_lazy (lazy_value)
       || TYPE_CODE (type) == TYPE_CODE_FUNC)
@@ -754,14 +763,14 @@ locate_var_value (struct symbol *var, struct frame_info *frame)
     case lval_register:
       gdb_assert (REGISTER_NAME (VALUE_REGNUM (lazy_value)) != NULL
                  && *REGISTER_NAME (VALUE_REGNUM (lazy_value)) != '\0');
-      error("Address requested for identifier "
-           "\"%s\" which is in register $%s",
+      error (_("Address requested for identifier "
+              "\"%s\" which is in register $%s"),
             SYMBOL_PRINT_NAME (var), 
            REGISTER_NAME (VALUE_REGNUM (lazy_value)));
       break;
 
     default:
-      error ("Can't take address of \"%s\" which isn't an lvalue.",
+      error (_("Can't take address of \"%s\" which isn't an lvalue."),
             SYMBOL_PRINT_NAME (var));
       break;
     }
This page took 0.027678 seconds and 4 git commands to generate.