value_allocate_space_in_inferior (int len)
{
struct value *blocklen;
- struct value *val = find_function_in_inferior (NAME_OF_MALLOC);
+ struct value *val = find_function_in_inferior
+ (gdbarch_name_of_malloc (current_gdbarch));
blocklen = value_from_longest (builtin_type_int, (LONGEST) len);
val = call_function_by_hand (val, 1, &blocklen);
{
LONGEST longest;
- /* If target compiled by HP aCC. */
- if (deprecated_hp_som_som_object_present
- && code2 == TYPE_CODE_MEMBERPTR)
- {
- unsigned int *ptr;
- struct value *retvalp;
-
- /* With HP aCC, pointers to data members have a bias. */
- retvalp = value_from_longest (type, value_as_long (arg2));
- /* force evaluation */
- ptr = (unsigned int *) value_contents (retvalp);
- *ptr &= ~0x20000000; /* zap 29th bit to remove bias */
- return retvalp;
- }
-
/* When we cast pointers to integers, we mustn't use
- POINTER_TO_ADDRESS to find the address the pointer
+ gdbarch_pointer_to_address to find the address the pointer
represents, as value_as_long would. GDB should evaluate
expressions just as the compiler would --- and the compiler
sees a cast as a simple reinterpretation of the pointer's
otherwise occur when dealing with a target having two byte
pointers and four byte addresses. */
- int addr_bit = TARGET_ADDR_BIT;
+ int addr_bit = gdbarch_addr_bit (current_gdbarch);
LONGEST longest = value_as_long (arg2);
if (addr_bit < sizeof (LONGEST) * HOST_CHAR_BIT)
/* Since modifying a register can trash the frame chain, and modifying memory
can trash the frame cache, we save the old frame and then restore the new
frame afterwards. */
- old_frame = get_frame_id (deprecated_selected_frame);
+ old_frame = get_frame_id (deprecated_safe_get_selected_frame ());
switch (VALUE_LVAL (toval))
{
if (!frame)
error (_("Value being assigned to is no longer active."));
- if (CONVERT_REGISTER_P (VALUE_REGNUM (toval), type))
+ if (gdbarch_convert_register_p
+ (current_gdbarch, VALUE_REGNUM (toval), type))
{
/* If TOVAL is a special machine register requiring
conversion of program values to a special raw format. */
- VALUE_TO_REGISTER (frame, VALUE_REGNUM (toval),
- type, value_contents (fromval));
+ gdbarch_value_to_register (current_gdbarch,
+ frame, VALUE_REGNUM (toval),
+ type, value_contents (fromval));
}
else
{
struct symbol *func, *sym;
struct block *b;
struct value * ret;
+ struct frame_info *frame;
- if (deprecated_selected_frame == 0)
+ if (complain)
+ frame = get_selected_frame (_("no frame selected"));
+ else
{
- if (complain)
- error (_("no frame selected"));
- else
+ frame = deprecated_safe_get_selected_frame ();
+ if (frame == 0)
return 0;
}
- func = get_frame_function (deprecated_selected_frame);
+ func = get_frame_function (frame);
if (!func)
{
if (complain)
return NULL;
}
- ret = read_var_value (sym, deprecated_selected_frame);
+ ret = read_var_value (sym, frame);
if (ret == 0 && complain)
error (_("`%s' argument unreadable"), name);
return ret;