Re: [RFA] New bitflags type and eflags on i386/x86-64

Michal Ludvig
2002-08-30T13:52:37Z

[-- Attachment #1: Type: text/plain, Size: 711 bytes --]

Andrew Cagney wrote:
> Is there any immediate technical problem stopping x86-64 linking in
> i386-tdep.c? (Yes scary, multi-arch).

Yes, if both are linked, the gdbarch initialisation is attempted to be
done twice and gdb crashes. I could add an #ifdef to optionally ignore
some parts of i386-tdep, but IMHO it's better to introduce a new file as
DanielJ proposed. See the patch. I've moved both new builtin types and
their initialisation to i386-common-tdep.c and modified all
config/i386/*.mt files to require it. This approach shouldn't harm
MarkK's effort at all.
Any objections or can I commit it?

Michal Ludvig
--
* SuSE CR, s.r.o * mludvig@suse.cz
* +420 2 9654 5373 * http://www.suse.cz

[-- Attachment #2: flags-5.diff --]
[-- Type: text/plain, Size: 34573 bytes --]

2002-08-29 Michal Ludvig <mludvig@suse.cz>

* gdbtypes.c (add_flag_ignore, add_flag_name, init_flags_type): Added.
(is_integral_type, rank_one_type, recursive_dump_type): Added
TYPE_CODE_FLAGS handling.
* gdbtypes.h (type_code): Added TYPE_CODE_FLAGS.
* valprint.c (val_print_type_code_flags): Added.
* valprint.h (val_print_type_code_flags): Added.
* values.c (unpack_long): Added TYPE_CODE_FLAGS handling.
* i386-common-tdep.o: New file.
(builtin_type_i386_eflags): Added.
(builtin_type_simd_mxcsr): Added.
(_initialize_i386_common_tdep): Perform builtin_type_i386_eflags
and builtin_type_simd_mxcsr initialization.
* i386-common-tdep.h: New file.
(builtin_type_i386_eflags): Added.
(builtin_type_simd_mxcsr): Added.
* i386-tdep.c (i386_register_virtual_type): Added eflags and
mxcsr registers handling.
* x86-64-tdep.c (x86_64_register_info_table): Changed type
of eflags and mxcsr registers.
* ada-valprint.c (ada_val_print_1): Added TYPE_CODE_FLAGS case.
* c-valprint.c (c_val_print): Ditto.
* f-valprint.c (f_val_print): Ditto.
* jv-valprint.c (java_val_print): Ditto.
* p-valprint.c (pascal_val_print): Ditto.
* config/i386/x86-64linux.mt: Added i386-common-tdep.o
* config/i386/i386aix.mt: Ditto.
* config/i386/i386aout.mt: Ditto.
* config/i386/i386bsd.mt: Ditto.
* config/i386/i386gnu.mt: Ditto.
* config/i386/i386lynx.mt: Ditto.
* config/i386/i386m3.mt: Ditto.
* config/i386/i386mk.mt: Ditto.
* config/i386/i386nw.mt: Ditto.
* config/i386/i386os9k.mt: Ditto.
* config/i386/i386sco5.mt: Ditto.
* config/i386/i386sol2.mt: Ditto.
* config/i386/i386v.mt: Ditto.
* config/i386/i386v4.mt: Ditto.
* config/i386/i386v42mp.mt: Ditto.
* config/i386/linux.mt: Ditto.
* config/i386/cygwin.mt: Ditto.
* config/i386/embed.mt: Ditto.
* config/i386/fbsd.mt: Ditto.
* config/i386/go32.mt: Ditto.
* config/i386/nbsdaout.mt: Ditto.
* config/i386/nbsdelf.mt: Ditto.
* config/i386/ncr3000.mt: Ditto.
* config/i386/ptx.mt: Ditto.
* config/i386/ptx4.mt: Ditto.
* config/i386/symmetry.mt: Ditto.
* config/i386/vxworks.mt: Ditto.

Index: gdbtypes.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.c,v
retrieving revision 1.56
diff -u -p -r1.56 gdbtypes.c
--- gdbtypes.c 20 Aug 2002 19:57:32 -0000 1.56
+++ gdbtypes.c 30 Aug 2002 13:42:50 -0000
@@ -782,6 +782,61 @@ create_set_type (struct type *result_typ
return (result_type);
}

+/*
+ * - The following three functions are intended to be used for BitFlags
+ * types (e.g. i386's EFLAGS register).
+ * - A BitFlags type is an integer where bits may have a symbolic name
+ * to be printed when the bit is set.
+ * - Printing is done in <lang>_val_print() under a TYPE_CODE_FLAGS label.
+ * - Add symbolic names for relevant bits using add_flag_name() after
+ * initializing the BitFlags type.
+ */
+void
+add_flag_ignore (struct type *type, int bitpos)
+{
+ TYPE_FIELD_BITPOS (type, bitpos) = -1;
+}
+
+void
+add_flag_name (struct type *type, int bitpos, char *name)
+{
+ int namelen;
+
+ gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLAGS);
+ gdb_assert (bitpos < TYPE_NFIELDS (type));
+ gdb_assert (bitpos >= 0);
+
+ namelen=strlen(name)+1;
+ TYPE_FIELD_NAME (type, bitpos) = xmalloc (namelen);
+ snprintf(TYPE_FIELD_NAME (type, bitpos), namelen, "%s", name);
+
+ TYPE_FIELD_BITPOS (type, bitpos) = bitpos;
+}
+
+struct type *
+init_flags_type (int bitlength, char *name, struct objfile *objfile)
+{
+ register struct type *type;
+
+ type = alloc_type (objfile);
+
+ TYPE_CODE (type) = TYPE_CODE_FLAGS;
+ TYPE_LENGTH (type) = (bitlength + TARGET_CHAR_BIT - 1) / TARGET_CHAR_BIT;
+ TYPE_FLAGS (type) = TYPE_FLAG_UNSIGNED;
+ TYPE_NFIELDS (type) = bitlength;
+ TYPE_FIELDS (type) = (struct field *)
+ TYPE_ALLOC (type, bitlength * sizeof (struct field));
+ memset (TYPE_FIELDS (type), 0, sizeof (struct field));
+
+ if ((name != NULL) && (objfile != NULL))
+ TYPE_NAME (type) =
+ obsavestring (name, strlen (name), &objfile->type_obstack);
+ else
+ TYPE_NAME (type) = name;
+
+ return (type);
+}
+
/* Construct and return a type of the form:
struct NAME { ELT_TYPE ELT_NAME[N]; }
We use these types for SIMD registers. For example, the type of
@@ -1946,6 +2001,7 @@ is_integral_type (struct type *t)
return
((t != NULL)
&& ((TYPE_CODE (t) == TYPE_CODE_INT)
+ || (TYPE_CODE (t) == TYPE_CODE_FLAGS)
|| (TYPE_CODE (t) == TYPE_CODE_ENUM)
|| (TYPE_CODE (t) == TYPE_CODE_CHAR)
|| (TYPE_CODE (t) == TYPE_CODE_RANGE)
@@ -2479,6 +2535,7 @@ rank_one_type (struct type *parm, struct
case TYPE_CODE_FUNC:
return rank_one_type (TYPE_TARGET_TYPE (parm), arg);
case TYPE_CODE_INT:
+ case TYPE_CODE_FLAGS:
case TYPE_CODE_ENUM:
case TYPE_CODE_CHAR:
case TYPE_CODE_RANGE:
@@ -2555,6 +2612,7 @@ rank_one_type (struct type *parm, struct
return INTEGER_PROMOTION_BADNESS;
else
return INTEGER_COERCION_BADNESS;
+ case TYPE_CODE_FLAGS:
case TYPE_CODE_ENUM:
case TYPE_CODE_CHAR:
case TYPE_CODE_RANGE:
@@ -2999,6 +3057,9 @@ recursive_dump_type (struct type *type,
break;
case TYPE_CODE_INT:
printf_filtered ("(TYPE_CODE_INT)");
+ break;
+ case TYPE_CODE_FLAGS:
+ printf_filtered ("(TYPE_CODE_FLAGS)");
break;
case TYPE_CODE_FLT:
printf_filtered ("(TYPE_CODE_FLT)");
Index: gdbtypes.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.h,v
retrieving revision 1.35
diff -u -p -r1.35 gdbtypes.h
--- gdbtypes.h 10 Aug 2002 05:12:40 -0000 1.35
+++ gdbtypes.h 30 Aug 2002 13:42:51 -0000
@@ -85,6 +85,7 @@ enum type_code
TYPE_CODE_ENUM, /* Enumeration type */
TYPE_CODE_FUNC, /* Function type */
TYPE_CODE_INT, /* Integer type */
+ TYPE_CODE_FLAGS, /* BitFlags type */

/* Floating type. This is *NOT* a complex type. Beware, there are parts
of GDB which bogusly assume that TYPE_CODE_FLT can mean complex. */
@@ -926,6 +927,7 @@ extern struct type *builtin_type_void_fu

/* The target CPU's address type. This is the ISA address size. */
extern struct type *builtin_type_CORE_ADDR;
+
/* The symbol table address type. Some object file formats have a 32
bit address type even though the TARGET has a 64 bit pointer type
(cf MIPS). */
@@ -1054,6 +1056,14 @@ extern struct type *alloc_type (struct o

extern struct type *init_type (enum type_code, int, int, char *,
struct objfile *);
+
+/* Helper functions to construct BitField type.
+ See description in gdbarch.c for details. */
+
+struct type *init_flags_type (int bitlength, char *name,
+ struct objfile *objfile);
+void add_flag_ignore (struct type *type, int bitpos);
+void add_flag_name (struct type *type, int bitpos, char *name);

/* Helper functions to construct a struct or record type. An
initially empty type is created using init_composite_type().
Index: i386-common-tdep.c
===================================================================
RCS file: i386-common-tdep.c
diff -N i386-common-tdep.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ i386-common-tdep.c 30 Aug 2002 13:42:51 -0000
@@ -0,0 +1,75 @@
+/* Target-dependent code common for both i386 and x86-64 archs.
+
+ Copyright 2002 Free Software Foundation, Inc.
+
+ Contributed by Michal Ludvig, SuSE Labs.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "gdbtypes.h"
+
+struct type *builtin_type_i386_eflags;
+struct type *builtin_type_simd_mxcsr;
+
+void
+_initialize_i386_common_tdep (void)
+{
+ builtin_type_i386_eflags =
+ init_flags_type (32 /* EFLAGS_LENGTH */,
+ "__i386_eflags", (struct objfile *) NULL);
+ add_flag_name (builtin_type_i386_eflags, 0, "CF");
+ add_flag_ignore (builtin_type_i386_eflags, 1);
+ add_flag_name (builtin_type_i386_eflags, 2, "PF");
+ add_flag_name (builtin_type_i386_eflags, 4, "AF");
+ add_flag_name (builtin_type_i386_eflags, 6, "ZF");
+ add_flag_name (builtin_type_i386_eflags, 7, "SF");
+ add_flag_name (builtin_type_i386_eflags, 8, "TF");
+ add_flag_name (builtin_type_i386_eflags, 9, "IF");
+ add_flag_name (builtin_type_i386_eflags, 10, "DF");
+ add_flag_name (builtin_type_i386_eflags, 11, "OF");
+ add_flag_ignore (builtin_type_i386_eflags, 12);
+ add_flag_ignore (builtin_type_i386_eflags, 13);
+ add_flag_name (builtin_type_i386_eflags, 14, "NT");
+ add_flag_name (builtin_type_i386_eflags, 16, "RF");
+ add_flag_name (builtin_type_i386_eflags, 17, "VM");
+ add_flag_name (builtin_type_i386_eflags, 18, "AC");
+ add_flag_name (builtin_type_i386_eflags, 19, "VIF");
+ add_flag_name (builtin_type_i386_eflags, 20, "VIP");
+ add_flag_name (builtin_type_i386_eflags, 21, "ID");
+
+ builtin_type_simd_mxcsr =
+ init_flags_type (32 /* MXCSR_LENGTH */,
+ "__simd_mxcsr", (struct objfile *) NULL);
+ add_flag_name (builtin_type_simd_mxcsr, 0, "IE");
+ add_flag_name (builtin_type_simd_mxcsr, 1, "DE");
+ add_flag_name (builtin_type_simd_mxcsr, 2, "ZE");
+ add_flag_name (builtin_type_simd_mxcsr, 3, "OE");
+ add_flag_name (builtin_type_simd_mxcsr, 4, "UE");
+ add_flag_name (builtin_type_simd_mxcsr, 5, "PE");
+ add_flag_name (builtin_type_simd_mxcsr, 6, "DAZ");
+ add_flag_name (builtin_type_simd_mxcsr, 7, "IM");
+ add_flag_name (builtin_type_simd_mxcsr, 8, "DM");
+ add_flag_name (builtin_type_simd_mxcsr, 9, "ZM");
+ add_flag_name (builtin_type_simd_mxcsr, 10, "OM");
+ add_flag_name (builtin_type_simd_mxcsr, 11, "UM");
+ add_flag_name (builtin_type_simd_mxcsr, 12, "PM");
+ add_flag_name (builtin_type_simd_mxcsr, 13, "RC1");
+ add_flag_name (builtin_type_simd_mxcsr, 14, "RC2");
+ add_flag_name (builtin_type_simd_mxcsr, 15, "FZ");
+}
Index: i386-common-tdep.h
===================================================================
RCS file: i386-common-tdep.h
diff -N i386-common-tdep.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ i386-common-tdep.h 30 Aug 2002 13:42:51 -0000
@@ -0,0 +1,32 @@
+/* Target-dependent code common for both i386 and x86-64 archs.
+
+ Copyright 2002 Free Software Foundation, Inc.
+
+ Contributed by Michal Ludvig, SuSE Labs.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef I386_COMMON_TDEP_H
+#define I386_COMMON_TDEP_H
+
+#include "gdbtypes.h"
+
+extern struct type *builtin_type_i386_eflags;
+extern struct type *builtin_type_simd_mxcsr;
+
+#endif
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.85
diff -u -p -r1.85 i386-tdep.c
--- i386-tdep.c 26 Aug 2002 18:35:25 -0000 1.85
+++ i386-tdep.c 30 Aug 2002 13:42:51 -0000
@@ -40,6 +40,7 @@

#include "i386-tdep.h"
#include "i387-tdep.h"
+#include "i386-common-tdep.h"

/* Names of the registers. The first 10 registers match the register
numbering scheme used by GCC for stabs and DWARF. */
@@ -1101,6 +1102,12 @@ i386_register_virtual_type (int regnum)
{
if (regnum == PC_REGNUM || regnum == FP_REGNUM || regnum == SP_REGNUM)
return lookup_pointer_type (builtin_type_void);
+
+ if (regnum == PS_REGNUM)
+ return builtin_type_i386_eflags;
+
+ if (regnum == MXCSR_REGNUM)
+ return builtin_type_simd_mxcsr;

if (IS_FP_REGNUM (regnum))
return builtin_type_i387_ext;
Index: valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/valprint.c,v
retrieving revision 1.28
diff -u -p -r1.28 valprint.c
--- valprint.c 24 Aug 2002 00:40:59 -0000 1.28
+++ valprint.c 30 Aug 2002 13:42:51 -0000
@@ -1183,6 +1183,39 @@ val_print_string (CORE_ADDR addr, int le
}
\f

+void
+val_print_type_code_flags (char *valaddr, struct type *type,
+ int format, int size,
+ struct ui_file *stream)
+{
+ unsigned int len;
+ int i;
+ LONGEST val;
+
+ if (format)
+ print_scalar_formatted (valaddr, type, format, 0, stream);
+ else
+ {
+ len = TYPE_NFIELDS (type);
+ val = unpack_long (type, valaddr);
+ fputs_filtered("[", stream);
+ for (i = len-1; i >= 0; i--)
+ {
+ QUIT;
+ if (TYPE_FIELD_BITPOS (type, i) != -1 && val & (1 << i))
+ if (val & (1 << i))
+ {
+ if(TYPE_FIELD_NAME (type, i))
+ fprintf_filtered (stream, " %s", TYPE_FIELD_NAME (type, i));
+ else
+ fprintf_filtered (stream, " #%d", i);
+
+ }
+ }
+ fputs_filtered(" ]", stream);
+ }
+}
+
/* Validate an input or output radix setting, and make sure the user
knows what they really did here. Radix setting is confusing, e.g.
setting the input radix to "10" never changes it! */
Index: valprint.h
===================================================================
RCS file: /cvs/src/src/gdb/valprint.h,v
retrieving revision 1.3
diff -u -p -r1.3 valprint.h
--- valprint.h 21 Oct 2001 19:20:30 -0000 1.3
+++ valprint.h 30 Aug 2002 13:42:51 -0000
@@ -49,6 +49,10 @@ extern void val_print_array_elements (st
extern void val_print_type_code_int (struct type *, char *,
struct ui_file *);

+extern void val_print_type_code_flags (char *valaddr, struct type *type,
+ int format, int size,
+ struct ui_file *stream);
+
extern void print_binary_chars (struct ui_file *, unsigned char *,
unsigned int);

Index: values.c
===================================================================
RCS file: /cvs/src/src/gdb/values.c,v
retrieving revision 1.40
diff -u -p -r1.40 values.c
--- values.c 24 Aug 2002 00:21:35 -0000 1.40
+++ values.c 30 Aug 2002 13:42:51 -0000
@@ -696,6 +696,7 @@ unpack_long (struct type *type, char *va
case TYPE_CODE_ENUM:
case TYPE_CODE_BOOL:
case TYPE_CODE_INT:
+ case TYPE_CODE_FLAGS:
case TYPE_CODE_CHAR:
case TYPE_CODE_RANGE:
if (nosign)
Index: x86-64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/x86-64-tdep.c,v
retrieving revision 1.26
diff -u -p -r1.26 x86-64-tdep.c
--- x86-64-tdep.c 24 Aug 2002 00:21:35 -0000 1.26
+++ x86-64-tdep.c 30 Aug 2002 13:42:51 -0000
@@ -33,6 +33,8 @@
#include "dwarf2cfi.h"
#include "gdb_assert.h"

+#include "i386-common-tdep.h"
+
/* Register numbers of various important registers. */
#define RAX_REGNUM 0
#define RDX_REGNUM 3
@@ -68,7 +70,7 @@ static struct register_info x86_64_regis
/* 14 */ {8, "r14", &builtin_type_int64},
/* 15 */ {8, "r15", &builtin_type_int64},
/* 16 */ {8, "rip", &builtin_type_void_func_ptr},
- /* 17 */ {4, "eflags", &builtin_type_int32},
+ /* 17 */ {4, "eflags", &builtin_type_i386_eflags},
/* 18 */ {4, "ds", &builtin_type_int32},
/* 19 */ {4, "es", &builtin_type_int32},
/* 20 */ {4, "fs", &builtin_type_int32},
@@ -105,7 +107,7 @@ static struct register_info x86_64_regis
/* 51 */ {16, "xmm13", &builtin_type_v4sf},
/* 52 */ {16, "xmm14", &builtin_type_v4sf},
/* 53 */ {16, "xmm15", &builtin_type_v4sf},
- /* 54 */ {4, "mxcsr", &builtin_type_int32}
+ /* 54 */ {4, "mxcsr", &builtin_type_simd_mxcsr}
};

/* This array is a mapping from Dwarf-2 register
Index: ada-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-valprint.c,v
retrieving revision 1.4
diff -u -p -r1.4 ada-valprint.c
--- ada-valprint.c 18 Aug 2002 18:07:33 -0000 1.4
+++ ada-valprint.c 30 Aug 2002 13:42:50 -0000
@@ -777,6 +777,11 @@ ada_val_print_1 (struct type *type, char
fputs_filtered ("???", stream);
}
break;
+
+ case TYPE_CODE_FLAGS:
+ val_print_type_code_flags (valaddr + embedded_offset, type,
+ format, 0, stream);
+ break;
}
return 0;
}
Index: c-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/c-valprint.c,v
retrieving revision 1.14
diff -u -p -r1.14 c-valprint.c
--- c-valprint.c 27 Aug 2002 22:37:06 -0000 1.14
+++ c-valprint.c 30 Aug 2002 13:42:50 -0000
@@ -486,6 +486,11 @@ c_val_print (struct type *type, char *va
fprintf_filtered (stream, " * I");
break;

+ case TYPE_CODE_FLAGS:
+ val_print_type_code_flags (valaddr + embedded_offset, type,
+ format, 0, stream);
+ break;
+
default:
error ("Invalid C/C++ type code %d in symbol table.", TYPE_CODE (type));
}
Index: f-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/f-valprint.c,v
retrieving revision 1.6
diff -u -p -r1.6 f-valprint.c
--- f-valprint.c 7 Mar 2001 02:57:08 -0000 1.6
+++ f-valprint.c 30 Aug 2002 13:42:50 -0000
@@ -544,6 +544,11 @@ f_val_print (struct type *type, char *va
fprintf_filtered (stream, "<incomplete type>");
break;

+ case TYPE_CODE_FLAGS:
+ val_print_type_code_flags (valaddr + embedded_offset, type,
+ format, 0, stream);
+ break;
+
default:
error ("Invalid F77 type code %d in symbol table.", TYPE_CODE (type));
}
Index: jv-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/jv-valprint.c,v
retrieving revision 1.11
diff -u -p -r1.11 jv-valprint.c
--- jv-valprint.c 27 Aug 2002 22:37:06 -0000 1.11
+++ jv-valprint.c 30 Aug 2002 13:42:51 -0000
@@ -518,6 +518,11 @@ java_val_print (struct type *type, char
recurse, pretty);
break;

+ case TYPE_CODE_FLAGS:
+ val_print_type_code_flags (valaddr + embedded_offset, type,
+ format, 0, stream);
+ break;
+
default:
return c_val_print (type, valaddr, embedded_offset, address, stream,
format, deref_ref, recurse, pretty);
Index: p-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/p-valprint.c,v
retrieving revision 1.13
diff -u -p -r1.13 p-valprint.c
--- p-valprint.c 19 Aug 2002 13:12:09 -0000 1.13
+++ p-valprint.c 30 Aug 2002 13:42:51 -0000
@@ -524,6 +524,11 @@ pascal_val_print (struct type *type, cha
fprintf_filtered (stream, "<incomplete type>");
break;

+ case TYPE_CODE_FLAGS:
+ val_print_type_code_flags (valaddr + embedded_offset, type,
+ format, 0, stream);
+ break;
+
default:
error ("Invalid pascal type code %d in symbol table.", TYPE_CODE (type));
}
Index: config/i386/cygwin.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/cygwin.mt,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 cygwin.mt
--- config/i386/cygwin.mt 16 Apr 1999 01:34:17 -0000 1.1.1.1
+++ config/i386/cygwin.mt 30 Aug 2002 13:42:51 -0000
@@ -1,5 +1,5 @@
# Target: Intel 386 run win32
-TDEPFILES= i386-tdep.o i387-tdep.o
+TDEPFILES= i386-tdep.o i386-common-tdep.o i387-tdep.o
TM_FILE= tm-cygwin.h

Index: config/i386/embed.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/embed.mt,v
retrieving revision 1.3
diff -u -p -r1.3 embed.mt
--- config/i386/embed.mt 18 Nov 2001 21:28:20 -0000 1.3
+++ config/i386/embed.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# Target: Embedded Intel 386
-TDEPFILES= i386-tdep.o i387-tdep.o
+TDEPFILES= i386-tdep.o i386-common-tdep.o i387-tdep.o
TM_FILE= tm-i386.h
Index: config/i386/fbsd.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/fbsd.mt,v
retrieving revision 1.3
diff -u -p -r1.3 fbsd.mt
--- config/i386/fbsd.mt 13 Jul 2001 18:27:21 -0000 1.3
+++ config/i386/fbsd.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# Target: Intel 386 running FreeBSD
-TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o
+TDEPFILES= i386-tdep.o i386-common-tdep.o i387-tdep.o i386bsd-tdep.o
TM_FILE= tm-fbsd.h
Index: config/i386/go32.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/go32.mt,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 go32.mt
--- config/i386/go32.mt 27 Apr 1999 01:26:18 -0000 1.1.1.1
+++ config/i386/go32.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# Target: Intel 386 running DJGPP
-TDEPFILES= i386-tdep.o i387-tdep.o
+TDEPFILES= i386-tdep.o i386-common-tdep.o i387-tdep.o
TM_FILE= tm-go32.h
Index: config/i386/i386aix.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/i386aix.mt,v
retrieving revision 1.2
diff -u -p -r1.2 i386aix.mt
--- config/i386/i386aix.mt 15 Aug 2002 22:51:40 -0000 1.2
+++ config/i386/i386aix.mt 30 Aug 2002 13:42:51 -0000
@@ -3,5 +3,5 @@
# OBSOLETE # proprietary debug info.
# OBSOLETE #
# OBSOLETE # Target: IBM PS/2 (i386) running AIX PS/2
-# OBSOLETE TDEPFILES= i386-tdep.o i387-tdep.o
+# OBSOLETE TDEPFILES= i386-tdep.o i386-common-tdep.o i387-tdep.o
# OBSOLETE TM_FILE= tm-i386aix.h
Index: config/i386/i386aout.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/i386aout.mt,v
retrieving revision 1.2
diff -u -p -r1.2 i386aout.mt
--- config/i386/i386aout.mt 18 Aug 2002 22:14:24 -0000 1.2
+++ config/i386/i386aout.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# Target: Intel 386 with a.out
-TDEPFILES= i386-tdep.o i387-tdep.o
+TDEPFILES= i386-tdep.o i386-common-tdep.o i387-tdep.o
TM_FILE= tm-i386.h
Index: config/i386/i386bsd.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/i386bsd.mt,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 i386bsd.mt
--- config/i386/i386bsd.mt 16 Apr 1999 01:34:18 -0000 1.1.1.1
+++ config/i386/i386bsd.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# Target: Intel 386 running BSD
TM_FILE= tm-i386bsd.h
-TDEPFILES= i386-tdep.o
+TDEPFILES= i386-tdep.o i386-common-tdep.o
Index: config/i386/i386gnu.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/i386gnu.mt,v
retrieving revision 1.3
diff -u -p -r1.3 i386gnu.mt
--- config/i386/i386gnu.mt 15 Aug 2002 22:24:01 -0000 1.3
+++ config/i386/i386gnu.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# Target: Intel 386 running the GNU Hurd
-TDEPFILES= i386-tdep.o i387-tdep.o i386gnu-tdep.o
+TDEPFILES= i386-tdep.o i386-common-tdep.o i387-tdep.o i386gnu-tdep.o
TM_FILE= tm-i386v4.h
Index: config/i386/i386lynx.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/i386lynx.mt,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 i386lynx.mt
--- config/i386/i386lynx.mt 16 Apr 1999 01:34:18 -0000 1.1.1.1
+++ config/i386/i386lynx.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# Target: Intel 386 running LynxOS
-TDEPFILES= coff-solib.o i386-tdep.o i386ly-tdep.o
+TDEPFILES= coff-solib.o i386-tdep.o i386-common-tdep.o i386ly-tdep.o
TM_FILE= tm-i386lynx.h
Index: config/i386/i386m3.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/i386m3.mt,v
retrieving revision 1.2
diff -u -p -r1.2 i386m3.mt
--- config/i386/i386m3.mt 18 Aug 2002 16:32:14 -0000 1.2
+++ config/i386/i386m3.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# OBSOLETE # Target: Intel 386 with a.out under Mach 3
-# OBSOLETE TDEPFILES= i386-tdep.o
+# OBSOLETE TDEPFILES= i386-tdep.o i386-common-tdep.o
# OBSOLETE TM_FILE= tm-i386m3.h
Index: config/i386/i386mk.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/i386mk.mt,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 i386mk.mt
--- config/i386/i386mk.mt 16 Apr 1999 01:34:18 -0000 1.1.1.1
+++ config/i386/i386mk.mt 30 Aug 2002 13:42:51 -0000
@@ -1,5 +1,5 @@
# Target: Intel 386 with a.out in osf 1/mk
-TDEPFILES= i386-tdep.o
+TDEPFILES= i386-tdep.o i386-common-tdep.o
TM_FILE= tm-i386osf1mk.h

TM_CFLAGS= -I/usr/mach3/include
Index: config/i386/i386nw.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/i386nw.mt,v
retrieving revision 1.2
diff -u -p -r1.2 i386nw.mt
--- config/i386/i386nw.mt 14 Jun 2002 19:42:20 -0000 1.2
+++ config/i386/i386nw.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# Target: Intel 386 running NetWare
-TDEPFILES= i386-tdep.o i387-tdep.o
+TDEPFILES= i386-tdep.o i386-common-tdep.o i387-tdep.o
TM_FILE= tm-i386.h
Index: config/i386/i386os9k.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/i386os9k.mt,v
retrieving revision 1.2
diff -u -p -r1.2 i386os9k.mt
--- config/i386/i386os9k.mt 16 Jul 2002 15:19:19 -0000 1.2
+++ config/i386/i386os9k.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# OBSOLETE # Target: Intel 386 running OS9000
-# OBSOLETE TDEPFILES= i386-tdep.o remote-os9k.o
+# OBSOLETE TDEPFILES= i386-tdep.o i386-common-tdep.o remote-os9k.o
# OBSOLETE TM_FILE= tm-i386os9k.h
Index: config/i386/i386sco5.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/i386sco5.mt,v
retrieving revision 1.2
diff -u -p -r1.2 i386sco5.mt
--- config/i386/i386sco5.mt 18 Aug 2002 22:23:32 -0000 1.2
+++ config/i386/i386sco5.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# Target: Intel 386 running SCO Open Server 5
-TDEPFILES= i386-tdep.o i387-tdep.o
+TDEPFILES= i386-tdep.o i386-common-tdep.o i387-tdep.o
TM_FILE= tm-i386v4.h
Index: config/i386/i386sol2.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/i386sol2.mt,v
retrieving revision 1.4
diff -u -p -r1.4 i386sol2.mt
--- config/i386/i386sol2.mt 14 Jun 2002 19:42:20 -0000 1.4
+++ config/i386/i386sol2.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# Target: Intel 386 running Solaris 2 (SVR4)
-TDEPFILES= i386-tdep.o i387-tdep.o i386-sol2-tdep.o i386bsd-tdep.o
+TDEPFILES= i386-tdep.o i386-common-tdep.o i387-tdep.o i386-sol2-tdep.o i386bsd-tdep.o
TM_FILE= tm-i386sol2.h
Index: config/i386/i386v.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/i386v.mt,v
retrieving revision 1.2
diff -u -p -r1.2 i386v.mt
--- config/i386/i386v.mt 18 Aug 2002 22:14:24 -0000 1.2
+++ config/i386/i386v.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# Target: Intel 386 running System V
-TDEPFILES= i386-tdep.o i387-tdep.o
+TDEPFILES= i386-tdep.o i386-common-tdep.o i387-tdep.o
TM_FILE= tm-i386.h
Index: config/i386/i386v4.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/i386v4.mt,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 i386v4.mt
--- config/i386/i386v4.mt 16 Apr 1999 01:34:19 -0000 1.1.1.1
+++ config/i386/i386v4.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# Target: Intel 386 running SVR4
-TDEPFILES= i386-tdep.o i387-tdep.o
+TDEPFILES= i386-tdep.o i386-common-tdep.o i387-tdep.o
TM_FILE= tm-i386v4.h
Index: config/i386/i386v42mp.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/i386v42mp.mt,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 i386v42mp.mt
--- config/i386/i386v42mp.mt 16 Apr 1999 01:34:19 -0000 1.1.1.1
+++ config/i386/i386v42mp.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# Target: Intel 386 running SVR4.2MP
-TDEPFILES= i386-tdep.o i387-tdep.o
+TDEPFILES= i386-tdep.o i386-common-tdep.o i387-tdep.o
TM_FILE= tm-i386v42mp.h
Index: config/i386/linux.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/linux.mt,v
retrieving revision 1.5
diff -u -p -r1.5 linux.mt
--- config/i386/linux.mt 14 Feb 2002 05:48:33 -0000 1.5
+++ config/i386/linux.mt 30 Aug 2002 13:42:51 -0000
@@ -1,5 +1,5 @@
# Target: Intel 386 running GNU/Linux
-TDEPFILES= i386-tdep.o i386-linux-tdep.o i387-tdep.o \
+TDEPFILES= i386-tdep.o i386-common-tdep.o i386-linux-tdep.o i387-tdep.o \
solib.o solib-svr4.o solib-legacy.o
TM_FILE= tm-linux.h

Index: config/i386/nbsdaout.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/nbsdaout.mt,v
retrieving revision 1.1
diff -u -p -r1.1 nbsdaout.mt
--- config/i386/nbsdaout.mt 22 May 2002 03:59:54 -0000 1.1
+++ config/i386/nbsdaout.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# Target: Intel 386 running NetBSD
-TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o i386nbsd-tdep.o corelow.o
+TDEPFILES= i386-tdep.o i386-common-tdep.o i387-tdep.o i386bsd-tdep.o i386nbsd-tdep.o corelow.o
TM_FILE= tm-nbsdaout.h
Index: config/i386/nbsdelf.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/nbsdelf.mt,v
retrieving revision 1.9
diff -u -p -r1.9 nbsdelf.mt
--- config/i386/nbsdelf.mt 22 May 2002 03:59:54 -0000 1.9
+++ config/i386/nbsdelf.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# Target: Intel 386 running NetBSD
-TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o i386nbsd-tdep.o corelow.o
+TDEPFILES= i386-tdep.o i386-common-tdep.o i387-tdep.o i386bsd-tdep.o i386nbsd-tdep.o corelow.o
TM_FILE= tm-nbsd.h
Index: config/i386/ncr3000.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/ncr3000.mt,v
retrieving revision 1.3
diff -u -p -r1.3 ncr3000.mt
--- config/i386/ncr3000.mt 10 Mar 2001 06:17:21 -0000 1.3
+++ config/i386/ncr3000.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# Target: Intel 386 running SVR4
-TDEPFILES= i386-tdep.o i387-tdep.o solib.o solib-svr4.o solib-legacy.o
+TDEPFILES= i386-tdep.o i386-common-tdep.o i387-tdep.o solib.o solib-svr4.o solib-legacy.o
TM_FILE= tm-i386v4.h
Index: config/i386/ptx.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/ptx.mt,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 ptx.mt
--- config/i386/ptx.mt 16 Apr 1999 01:34:19 -0000 1.1.1.1
+++ config/i386/ptx.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# Target: Sequent Symmetry running ptx 2.0, with Weitek 1167 or i387.
-TDEPFILES= symm-tdep.o i387-tdep.o i386-tdep.o
+TDEPFILES= symm-tdep.o i387-tdep.o i386-tdep.o i386-common-tdep.o
TM_FILE= tm-ptx.h
Index: config/i386/ptx4.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/ptx4.mt,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 ptx4.mt
--- config/i386/ptx4.mt 16 Apr 1999 01:34:19 -0000 1.1.1.1
+++ config/i386/ptx4.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# Target: Sequent Symmetry running ptx 4.0, with Weitek 1167 or i387.
-TDEPFILES= symm-tdep.o i387-tdep.o i386-tdep.o
+TDEPFILES= symm-tdep.o i387-tdep.o i386-tdep.o i386-common-tdep.o
TM_FILE= tm-ptx4.h
Index: config/i386/symmetry.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/symmetry.mt,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 symmetry.mt
--- config/i386/symmetry.mt 16 Apr 1999 01:34:19 -0000 1.1.1.1
+++ config/i386/symmetry.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# Target: Sequent Symmetry running Dynix 3.0, with Weitek 1167 or i387.
-TDEPFILES= i386-tdep.o symm-tdep.o i387-tdep.o
+TDEPFILES= i386-tdep.o i386-common-tdep.o symm-tdep.o i387-tdep.o
TM_FILE= tm-symmetry.h
Index: config/i386/vxworks.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/vxworks.mt,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 vxworks.mt
--- config/i386/vxworks.mt 19 Jul 1999 23:28:21 -0000 1.1.1.1
+++ config/i386/vxworks.mt 30 Aug 2002 13:42:51 -0000
@@ -1,3 +1,3 @@
# Target: i386 running VxWorks
-TDEPFILES= i386-tdep.o i387-tdep.o
+TDEPFILES= i386-tdep.o i386-common-tdep.o i387-tdep.o
TM_FILE= tm-vxworks.h
Index: config/i386/x86-64linux.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/x86-64linux.mt,v
retrieving revision 1.5
diff -u -p -r1.5 x86-64linux.mt
--- config/i386/x86-64linux.mt 1 Jul 2002 22:09:52 -0000 1.5
+++ config/i386/x86-64linux.mt 30 Aug 2002 13:42:51 -0000
@@ -1,6 +1,7 @@
# Target: AMD x86-64 running GNU/Linux
TDEPFILES= x86-64-tdep.o x86-64-linux-tdep.o dwarf2cfi.o \
- solib.o solib-svr4.o solib-legacy.o
+ solib.o solib-svr4.o solib-legacy.o \
+ i386-common-tdep.o

GDB_MULTI_ARCH=GDB_MULTI_ARCH_TM