From: Jason Molenda Date: Fri, 6 Feb 1998 23:27:06 +0000 (+0000) Subject: Sun Jul 6 02:44:28 1997 Philippe De Muyter X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4434e2dc4e40db337406e6aabea3588fb9bd7961;p=binutils-gdb.git Sun Jul 6 02:44:28 1997 Philippe De Muyter * m68k/tm-delta68.h (CPLUS_MARKER): Macro deleted. (EXTRACT_STRUCT_VALUE_ADDRESS): Macro defined. (EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE): Macros modified because floating-point values return via %fp0. (CLEAR_INSN_CACHE): New macro. * m68k/tm-m68k.h (REGISTER_CONVERT_TO_VIRTUAL): Macro fixed to use DOUBLEST. (REGISTER_CONVERT_TO_RAW): Ditto. * infptrace.c (child_xfer_memory): If CLEAR_INSN_CACHE is defined, call it after having written in child process's memory. * inflow.c (PROCESS_GROUP_TYPE): Macro defined if HAVE_TERMIO. (gdb_has_a_terminal, terminal_ours_1): Functions fixed for HAVE_TERMIO. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 51e38dbd847..61a14151fa0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,18 @@ +Sun Jul 6 02:44:28 1997 Philippe De Muyter + + * m68k/tm-delta68.h (CPLUS_MARKER): Macro deleted. + (EXTRACT_STRUCT_VALUE_ADDRESS): Macro defined. + (EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE): Macros modified + because floating-point values return via %fp0. + (CLEAR_INSN_CACHE): New macro. + * m68k/tm-m68k.h (REGISTER_CONVERT_TO_VIRTUAL): Macro fixed + to use DOUBLEST. + (REGISTER_CONVERT_TO_RAW): Ditto. + * infptrace.c (child_xfer_memory): If CLEAR_INSN_CACHE is defined, + call it after having written in child process's memory. + * inflow.c (PROCESS_GROUP_TYPE): Macro defined if HAVE_TERMIO. + (gdb_has_a_terminal, terminal_ours_1): Functions fixed for HAVE_TERMIO. + Fri Feb 6 16:17:30 1998 Jeffrey A Law (law@cygnus.com) * config/mips/tm-mips64.h (TARGET_LONG_BIT): Allow final target to diff --git a/gdb/config/m68k/tm-delta68.h b/gdb/config/m68k/tm-delta68.h index 7c5cdec72b9..7bd48238dc9 100644 --- a/gdb/config/m68k/tm-delta68.h +++ b/gdb/config/m68k/tm-delta68.h @@ -1,5 +1,5 @@ /* Target definitions for delta68. - Copyright 1993, 1994 Free Software Foundation, Inc. + Copyright 1993, 1994, 1998 Free Software Foundation, Inc. This file is part of GDB. @@ -22,9 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define BPT_VECTOR 0x1 -#undef CPLUS_MARKER -#define CPLUS_MARKER '%' - #define GCC_COMPILED_FLAG_SYMBOL "gcc_compiled%" #define GCC2_COMPILED_FLAG_SYMBOL "gcc2_compiled%" @@ -42,23 +39,51 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ a function return value of type TYPE, and copy that, in virtual format, into VALBUF. */ +/* When it returns a float/double value, use fp0 in sysV68. */ /* When it returns a pointer value, use a0 in sysV68. */ -#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ - memcpy ((VALBUF), \ - (char *) ((REGBUF) + \ - (TYPE_CODE(TYPE) == TYPE_CODE_PTR ? 8 * 4 : \ - (TYPE_LENGTH(TYPE) >= 4 ? 0 : 4 - TYPE_LENGTH(TYPE)))), \ - TYPE_LENGTH(TYPE)) +#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ + if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \ + REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, \ + REGISTER_VIRTUAL_TYPE (FP0_REGNUM), \ + ®BUF[REGISTER_BYTE (FP0_REGNUM)], \ + VALBUF); \ + else \ + memcpy ((VALBUF), \ + (char *) ((REGBUF) + \ + (TYPE_CODE(TYPE) == TYPE_CODE_PTR ? 8 * 4 : \ + (TYPE_LENGTH(TYPE) >= 4 ? 0 : 4 - TYPE_LENGTH(TYPE)))), \ + TYPE_LENGTH(TYPE)) /* Write into appropriate registers a function return value of type TYPE, given in virtual format. */ +/* When it returns a float/double value, use fp0 in sysV68. */ /* When it returns a pointer value, use a0 in sysV68. */ #define STORE_RETURN_VALUE(TYPE,VALBUF) \ - write_register_bytes ((TYPE_CODE(TYPE) == TYPE_CODE_PTR ? 8 * 4 : 0), \ - VALBUF, TYPE_LENGTH (TYPE)) - + if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \ + { \ + char raw_buf[REGISTER_RAW_SIZE (FP0_REGNUM)]; \ + REGISTER_CONVERT_TO_RAW (REGISTER_VIRTUAL_TYPE (FP0_REGNUM), \ + FP0_REGNUM, VALBUF, raw_buf); \ + write_register_bytes (FP0_REGNUM, \ + raw_buf, REGISTER_RAW_SIZE (FP0_REGNUM)); \ + } \ + else \ + write_register_bytes ((TYPE_CODE(TYPE) == TYPE_CODE_PTR ? 8 * 4 : 0), \ + VALBUF, TYPE_LENGTH (TYPE)) + +/* On M68040 versions of sysV68 R3V7.1, ptrace(PT_WRITE_I) does not clear + the processor's instruction cache as it should. */ +#define CLEAR_INSN_CACHE() clear_insn_cache() #include "m68k/tm-m68k.h" + +/* Extract from an array REGBUF containing the (raw) register state + the address in which a function should return its structure value, + as a CORE_ADDR (or an expression that can be used as one). */ + +#undef EXTRACT_STRUCT_VALUE_ADDRESS +#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF)\ + (*(CORE_ADDR *)((char*)(REGBUF) + 8 * 4)) diff --git a/gdb/config/m68k/tm-m68k.h b/gdb/config/m68k/tm-m68k.h index ec7f4e8b709..1e7e8e21a50 100644 --- a/gdb/config/m68k/tm-m68k.h +++ b/gdb/config/m68k/tm-m68k.h @@ -161,20 +161,23 @@ extern void m68k_find_saved_regs PARAMS ((struct frame_info *, struct frame_save to virtual format with type TYPE in buffer TO. */ #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \ -{ \ - double dbl_tmp_val; \ - floatformat_to_double (&floatformat_m68881_ext, (FROM), &dbl_tmp_val); \ - store_floating ((TO), TYPE_LENGTH (TYPE), dbl_tmp_val); \ -} +do \ + { \ + DOUBLEST dbl_tmp_val; \ + floatformat_to_doublest (&floatformat_m68881_ext, (FROM), &dbl_tmp_val); \ + store_floating ((TO), TYPE_LENGTH (TYPE), dbl_tmp_val); \ + } while (0) /* Convert data from virtual format with type TYPE in buffer FROM to raw format for register REGNUM in buffer TO. */ #define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \ -{ \ - double dbl_tmp_val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \ - floatformat_from_double (&floatformat_m68881_ext, &dbl_tmp_val, (TO)); \ -} +do \ + { \ + DOUBLEST dbl_tmp_val; \ + dbl_tmp_val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \ + floatformat_from_doublest (&floatformat_m68881_ext, &dbl_tmp_val, (TO)); \ + } while (0) /* Return the GDB type object for the "standard" data type of data in register N. This should be int for D0-D7, double for FP0-FP7,