#include "regcache.h"
#include "block.h"
#include "dfp.h"
+#include "objfiles.h"
/* Prototypes for exported functions. */
short regnum;
/* If zero, contents of this value are in the contents field. If
- nonzero, contents are in inferior memory at address in the
- location.address field plus the offset field (and the lval field
- should be lval_memory).
+ nonzero, contents are in inferior. If the lval field is lval_memory,
+ the contents are in inferior memory at location.address plus offset.
+ The lval field may also be lval_register.
WARNING: This field is used by the code which handles watchpoints
(see breakpoint.c) to decide whether a particular value can be
}
/* Allocate a value that has the correct length
- for COUNT repetitions type TYPE. */
+ for COUNT repetitions of type TYPE. */
struct value *
allocate_repeat_value (struct type *type, int count)
/* FIXME-type-allocation: need a way to free this type when we are
done with it. */
struct type *range_type
- = create_range_type ((struct type *) NULL, builtin_type_int,
+ = create_range_type ((struct type *) NULL, builtin_type_int32,
low_bound, count + low_bound - 1);
/* FIXME-type-allocation: need a way to free this type when we are
done with it. */
if (num_exp)
{
- /* "info history +" should print from the stored position.
- "info history <exp>" should print around value number <exp>. */
+ /* "show values +" should print from the stored position.
+ "show values <exp>" should print around value number <exp>. */
if (num_exp[0] != '+' || num_exp[1] != '\0')
num = parse_and_eval_long (num_exp) - 5;
}
else
{
- /* "info history" means print the last 10 values. */
+ /* "show values" means print the last 10 values. */
num = value_history_count - 9;
}
printf_filtered (("\n"));
}
- /* The next "info history +" should start after what we just printed. */
+ /* The next "show values +" should start after what we just printed. */
num += 10;
/* Hitting just return after this command should do the same thing as
- "info history +". If num_exp is null, this is unnecessary, since
- "info history +" is not useful after "info history". */
+ "show values +". If num_exp is null, this is unnecessary, since
+ "show values +" is not useful after "show values". */
if (from_tty && num_exp)
{
num_exp[0] = '+';
{
struct value *retval;
- if (TYPE_FIELD_STATIC_HAS_ADDR (type, fieldno))
+ if (TYPE_FIELD_LOC_KIND (type, fieldno) == FIELD_LOC_KIND_PHYSADDR)
{
retval = value_at (TYPE_FIELD_TYPE (type, fieldno),
TYPE_FIELD_STATIC_PHYSADDR (type, fieldno));
else
{
char *phys_name = TYPE_FIELD_STATIC_PHYSNAME (type, fieldno);
- struct symbol *sym = lookup_symbol (phys_name, 0, VAR_DOMAIN, 0, NULL);
+ struct symbol *sym = lookup_symbol (phys_name, 0, VAR_DOMAIN, 0);
if (sym == NULL)
{
/* With some compilers, e.g. HP aCC, static data members are reported
bases, etc. */
v = allocate_value (value_enclosing_type (arg1));
v->type = type;
+
+ /* Lazy register values with offsets are not supported. */
+ if (VALUE_LVAL (arg1) == lval_register && value_lazy (arg1))
+ value_fetch_lazy (arg1);
+
if (value_lazy (arg1))
set_value_lazy (v, 1);
else
/* Plain old data member */
offset += TYPE_FIELD_BITPOS (arg_type, fieldno) / 8;
v = allocate_value (type);
+
+ /* Lazy register values with offsets are not supported. */
+ if (VALUE_LVAL (arg1) == lval_register && value_lazy (arg1))
+ value_fetch_lazy (arg1);
+
if (value_lazy (arg1))
set_value_lazy (v, 1);
else
struct symbol *sym;
struct minimal_symbol *msym;
- sym = lookup_symbol (physname, 0, VAR_DOMAIN, 0, NULL);
+ sym = lookup_symbol (physname, 0, VAR_DOMAIN, 0);
if (sym != NULL)
{
msym = NULL;
}
else
{
- VALUE_ADDRESS (v) = SYMBOL_VALUE_ADDRESS (msym);
+ /* The minimal symbol might point to a function descriptor;
+ resolve it to the actual code address instead. */
+ struct objfile *objfile = msymbol_objfile (msym);
+ struct gdbarch *gdbarch = get_objfile_arch (objfile);
+
+ VALUE_ADDRESS (v)
+ = gdbarch_convert_from_func_ptr_addr
+ (gdbarch, SYMBOL_VALUE_ADDRESS (msym), ¤t_target);
}
if (arg1p)
struct type *stringtype;
rangetype = create_range_type ((struct type *) NULL,
- builtin_type_int,
+ builtin_type_int32,
lowbound, len + lowbound - 1);
string_char_type = language_string_char_type (current_language,
current_gdbarch);
arg = value_coerce_function (arg);
return arg;
}
-
-struct value *
-coerce_number (struct value *arg)
-{
- arg = coerce_array (arg);
- arg = coerce_enum (arg);
- return arg;
-}
-
-struct value *
-coerce_enum (struct value *arg)
-{
- if (TYPE_CODE (check_typedef (value_type (arg))) == TYPE_CODE_ENUM)
- arg = value_cast (builtin_type_unsigned_int, arg);
- return arg;
-}
\f
/* Return true if the function returning the specified type is using
address as a hidden first parameter). */
int
-using_struct_return (struct type *value_type)
+using_struct_return (struct type *func_type, struct type *value_type)
{
enum type_code code = TYPE_CODE (value_type);
return 0;
/* Probe the architecture for the return-value convention. */
- return (gdbarch_return_value (current_gdbarch, value_type,
+ return (gdbarch_return_value (current_gdbarch, func_type, value_type,
NULL, NULL, NULL)
!= RETURN_VALUE_REGISTER_CONVENTION);
}