This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Bugfixes in x86-64 target
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: Jiri Smid <smid at suse dot cz>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Sat, 19 Jan 2002 13:13:14 -0500
- Subject: Re: [RFA] Bugfixes in x86-64 target
- References: <s8vitb2b6y5.fsf@naga.suse.cz>
> Index: ChangeLog
> from Jiri Smid <smid@suse.cz>
>
> * x86-64-tdep.c (value.h): Delete.
> (gdb_assert.h): Include.
> (x86_64_register_convert_to_virtual,
> x86_64_register_convert_to_raw ): Add check whitch caouse that
tipo.
> only floating-point values are converted.
> (value_push): Delete.
> (x86_64_push_arguments): Order of arguments pushed on stack fixed.
> (i386_gdbarch_init): Number of register_bytes fixed.
>
> ! /* Convert to TYPE. This should be a no-op, if TYPE is equivalent
> ! to the extended floating-point format used by the FPU. */
> ! d = extract_floating (buf, sizeof buf);
> ! store_floating (to, TYPE_LENGTH (type), d);
Use extract/store typed_floating() or better yet Mark K's
convert_typed_floating().
> }
>
> /* Convert data from virtual format with type TYPE in buffer FROM to
> *************** void
> *** 127,132 ****
> --- 143,152 ----
> x86_64_register_convert_to_raw (struct type *type, int regnum,
> char *from, char *to)
> {
> + gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT
> + && TYPE_LENGTH (type) == 12);
> +
> + /* Simply omit the two unused bytes. */
> memcpy (to, from, FPU_REG_RAW_SIZE);
> }
Same here.
I suspect you also need to update the register virtual type function so
that they are more explicit (don't rely on sizeof(int) et.al.) vis:
> /* Return the GDB type object for the "standard" data type of data in
> register N. */
> static struct type *
> x86_64_register_virtual_type (int regno)
> {
> if (regno == PC_REGNUM || regno == SP_REGNUM)
> return lookup_pointer_type (builtin_type_void);
builtin_type_void_func_ptr
> if (IS_FP_REGNUM (regno))
> return builtin_type_long_double;
builtin_type_i386_ext. Changing this and the above should magically fix
some of the FP conversion problems I suspect you're seeing.
> if (IS_SSE_REGNUM (regno))
> return builtin_type_v4sf;
> if (IS_FPU_CTRL_REGNUM (regno) || regno == MXCSR_REGNUM
> || regno == EFLAGS_REGNUM)
> return builtin_type_int;
builtin_type_int32 or int64?
> return builtin_type_long;
builtin_type_int64?
> }
> CORE_ADDR
> x86_64_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
> int struct_return, CORE_ADDR struct_addr)
> + int stack_values[nargs];
You'll need to use something like xmalloc() or alloca() as the above is
a GCC extension.
otherwize ok.
Andrew