summaryrefslogtreecommitdiff
path: root/gdb/i386-tdep.c
diff options
context:
space:
mode:
authorJason Molenda <jsm@bugshack.cygnus.com>1999-10-19 02:47:02 +0000
committerJason Molenda <jsm@bugshack.cygnus.com>1999-10-19 02:47:02 +0000
commit996d40ebc9157af3b41799051b25b9a0c715b4c1 (patch)
tree46cda6f2a377bbfe86bd3be70137397aed7ace9d /gdb/i386-tdep.c
parent62d5ff22119181a83460dfbf8164c95d93bd47ac (diff)
downloadgdb-996d40ebc9157af3b41799051b25b9a0c715b4c1.tar.gz
import gdb-1999-10-18 snapshot
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r--gdb/i386-tdep.c65
1 files changed, 56 insertions, 9 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index e8c1bc943d5..1fbf76ab966 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -46,6 +46,32 @@ static int gdb_print_insn_i386 (bfd_vma, disassemble_info *);
void _initialize_i386_tdep PARAMS ((void));
+/* i386_register_byte[i] is the offset into the register file of the
+ start of register number i. We initialize this from
+ i386_register_raw_size. */
+int i386_register_byte[MAX_NUM_REGS];
+
+/* i386_register_raw_size[i] is the number of bytes of storage in the
+ actual machine representation for register i. */
+int i386_register_raw_size[MAX_NUM_REGS] = {
+ 4, 4, 4, 4,
+ 4, 4, 4, 4,
+ 4, 4, 4, 4,
+ 4, 4, 4, 4,
+ 10, 10, 10, 10,
+ 10, 10, 10, 10,
+ 4, 4, 4, 4,
+ 4, 4, 4, 4,
+ 16, 16, 16, 16,
+ 16, 16, 16, 16,
+ 4
+};
+
+/* i386_register_virtual_size[i] is the size in bytes of the virtual
+ type of register i. */
+int i386_register_virtual_size[MAX_NUM_REGS];
+
+
/* This is the variable the is set with "set disassembly-flavor",
and its legitimate values. */
static char att_flavor[] = "att";
@@ -974,25 +1000,46 @@ set_disassembly_flavor ()
void
_initialize_i386_tdep ()
{
- struct cmd_list_element *new_cmd;
+ /* Initialize the table saying where each register starts in the
+ register file. */
+ {
+ int i, offset;
+
+ offset = 0;
+ for (i = 0; i < MAX_NUM_REGS; i++)
+ {
+ i386_register_byte[i] = offset;
+ offset += i386_register_raw_size[i];
+ }
+ }
+
+ /* Initialize the table of virtual register sizes. */
+ {
+ int i;
+
+ for (i = 0; i < MAX_NUM_REGS; i++)
+ i386_register_virtual_size[i] = TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (i));
+ }
tm_print_insn = gdb_print_insn_i386;
tm_print_insn_info.mach = bfd_lookup_arch (bfd_arch_i386, 0)->mach;
/* Add the variable that controls the disassembly flavor */
+ {
+ struct cmd_list_element *new_cmd;
- new_cmd = add_set_enum_cmd ("disassembly-flavor", no_class,
- valid_flavors,
- (char *) &disassembly_flavor,
- "Set the disassembly flavor, the valid values are \"att\" and \"intel\", \
+ new_cmd = add_set_enum_cmd ("disassembly-flavor", no_class,
+ valid_flavors,
+ (char *) &disassembly_flavor,
+ "Set the disassembly flavor, the valid values are \"att\" and \"intel\", \
and the default value is \"att\".",
- &setlist);
- new_cmd->function.sfunc = set_disassembly_flavor_sfunc;
- add_show_from_set (new_cmd, &showlist);
+ &setlist);
+ new_cmd->function.sfunc = set_disassembly_flavor_sfunc;
+ add_show_from_set (new_cmd, &showlist);
+ }
/* Finally, initialize the disassembly flavor to the default given
in the disassembly_flavor variable */
set_disassembly_flavor ();
-
}