+2003-08-10 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.c (i386_register_to_value): Use get_frame_register
+ instead of frame_read_register.
+ (i386_fetch_pointer_argument): Use get_frame_register_unsigned
+ instead of frame_read_register. Use I386_ESP_REGNUM instead of
+ SP_REGNUM.
+ (i386_frame_prev_register): Use frame_unwind_register_unsigned
+ instead of frame_unwind_unsigned_register. Use
+ I386_EFLAGS_REGISTER instead of PS_REGNUM.
+ (i386_get_longjmp_target): Use regcache_read_unsigned_register
+ instead of read_register. Use builtin_type_void_data_ptr instead
+ of builtin_type_void_func_ptr when extracting the address of the
+ jmp_buf.
+ (i386_extract_return_value, i386_store_return_value,
+ i386_pseudo_register_read, i386_pseudo_register_write): Use
+ register_size instead REGISTER_RAW_SIZE.
+
2003-08-10 Andrew Cagney <cagney@redhat.com>
* infcall.c (call_function_by_hand): Use xstrprintf instead of
* i387-tdep.c (i387_register_to_value): Use get_frame_register
instead of frame_read_register.
+ (i387_print_float_info): Use get_frame_register and
+ get_frame_register_unsigned instead of frame_register_read.
* i386fbsd-nat.c: Include "i386-tdep.h".
(child_resume): Make `eflags' an ULONGEST. Use
ULONGEST val;
/* Clear the direction flag. */
- frame_unwind_unsigned_register (next_frame, PS_REGNUM, &val);
+ val = frame_unwind_register_unsigned (next_frame,
+ I386_EFLAGS_REGNUM);
val &= ~(1 << 10);
store_unsigned_integer (valuep, 4, val);
}
if (jb_pc_offset == -1)
return 0;
- sp = read_register (SP_REGNUM);
+ /* Don't use I386_ESP_REGNUM here, since this function is also used
+ for AMD64. */
+ regcache_cooked_read (current_regcache, SP_REGNUM, buf);
+ sp = extract_typed_address (buf, builtin_type_void_data_ptr);
if (target_read_memory (sp + len, buf, len))
return 0;
- jb_addr = extract_typed_address (buf, builtin_type_void_func_ptr);
+ jb_addr = extract_typed_address (buf, builtin_type_void_data_ptr);
if (target_read_memory (jb_addr + jb_pc_offset, buf, len))
return 0;
}
else
{
- int low_size = REGISTER_RAW_SIZE (LOW_RETURN_REGNUM);
- int high_size = REGISTER_RAW_SIZE (HIGH_RETURN_REGNUM);
+ int low_size = register_size (current_gdbarch, LOW_RETURN_REGNUM);
+ int high_size = register_size (current_gdbarch, HIGH_RETURN_REGNUM);
if (len <= low_size)
{
}
else
{
- int low_size = REGISTER_RAW_SIZE (LOW_RETURN_REGNUM);
- int high_size = REGISTER_RAW_SIZE (HIGH_RETURN_REGNUM);
+ int low_size = register_size (current_gdbarch, LOW_RETURN_REGNUM);
+ int high_size = register_size (current_gdbarch, HIGH_RETURN_REGNUM);
if (len <= low_size)
regcache_raw_write_part (regcache, LOW_RETURN_REGNUM, 0, len, valbuf);
/* Extract (always little endian). */
regcache_raw_read (regcache, fpnum, mmx_buf);
- memcpy (buf, mmx_buf, REGISTER_RAW_SIZE (regnum));
+ memcpy (buf, mmx_buf, register_size (gdbarch, regnum));
}
else
regcache_raw_read (regcache, regnum, buf);
/* Read ... */
regcache_raw_read (regcache, fpnum, mmx_buf);
/* ... Modify ... (always little endian). */
- memcpy (mmx_buf, buf, REGISTER_RAW_SIZE (regnum));
+ memcpy (mmx_buf, buf, register_size (gdbarch, regnum));
/* ... Write. */
regcache_raw_write (regcache, fpnum, mmx_buf);
}
gdb_assert (regnum != -1);
gdb_assert (register_size (current_gdbarch, regnum) == 4);
- frame_read_register (frame, regnum, buf);
+ get_frame_register (frame, regnum, buf);
regnum = i386_next_regnum (regnum);
len -= 4;
buf += 4;
}
\f
-/* Get the ith function argument for the current function. */
+/* Get the ARGIth function argument for the current function. */
+
static CORE_ADDR
i386_fetch_pointer_argument (struct frame_info *frame, int argi,
struct type *type)
{
- CORE_ADDR stack;
- frame_read_register (frame, SP_REGNUM, &stack);
- return read_memory_unsigned_integer (stack + (4 * (argi + 1)), 4);
+ CORE_ADDR sp = get_frame_register_unsigned (frame, I386_ESP_REGNUM);
+ return read_memory_unsigned_integer (sp + (4 * (argi + 1)), 4);
}
\f