diff options
author | Michal Ludvig <mludvig@suse.cz> | 2002-06-07 16:11:10 +0000 |
---|---|---|
committer | Michal Ludvig <mludvig@suse.cz> | 2002-06-07 16:11:10 +0000 |
commit | 8dda97708fa5c4537d670a063d4a1b9a2690f3b5 (patch) | |
tree | 1236ecda8d006fef66f60592ef4671c8dbb94476 /gdb/x86-64-tdep.c | |
parent | eb95bb9a4e738150793d5fdb094b3ebad025174a (diff) | |
download | gdb-8dda97708fa5c4537d670a063d4a1b9a2690f3b5.zip gdb-8dda97708fa5c4537d670a063d4a1b9a2690f3b5.tar.gz gdb-8dda97708fa5c4537d670a063d4a1b9a2690f3b5.tar.bz2 |
2002-06-07 Michal Ludvig <mludvig@suse.cz>
* x86-64-linux-nat.c (x86_64_fxsave_offset): New.
(supply_fpregset, fill_fpregset): Don't call i387_*_fxsave,
better do the things actually here.
* x86-64-tdep.c (x86_64_register_name2nr): New.
(x86_64_register_name): Renamed to x86_64_register_nr2name.
(x86_64_gdbarch_init): Respect the above change.
* x86-64-tdep.h (x86_64_register_name2nr)
(x86_64_register_nr2name): Add prototypes.
* config/i386/x86-64linux.mt (TDEPFILES): Remove i387-tdep.o.
Diffstat (limited to 'gdb/x86-64-tdep.c')
-rw-r--r-- | gdb/x86-64-tdep.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c index a3f8bee..6391e75 100644 --- a/gdb/x86-64-tdep.c +++ b/gdb/x86-64-tdep.c @@ -376,14 +376,15 @@ classify_argument (struct type *type, { int num = classify_argument (TYPE_FIELDS (type)[j].type, subclasses, - (TYPE_FIELDS (type)[j].loc.bitpos - + bit_offset) % 256); + (TYPE_FIELDS (type)[j].loc. + bitpos + bit_offset) % 256); if (!num) return 0; for (i = 0; i < num; i++) { int pos = - (TYPE_FIELDS (type)[j].loc.bitpos + bit_offset) / 8 / 8; + (TYPE_FIELDS (type)[j].loc.bitpos + + bit_offset) / 8 / 8; classes[i + pos] = merge_classes (subclasses[i], classes[i + pos]); } @@ -490,7 +491,7 @@ classify_argument (struct type *type, } case TYPE_CODE_VOID: return 0; - default: /* Avoid warning. */ + default: /* Avoid warning. */ break; } internal_error (__FILE__, __LINE__, @@ -797,13 +798,24 @@ x86_64_store_return_value (struct type *type, char *valbuf) } -static char * -x86_64_register_name (int reg_nr) +char * +x86_64_register_nr2name (int reg_nr) { if (reg_nr < 0 || reg_nr >= X86_64_NUM_REGS) return NULL; return x86_64_register_info_table[reg_nr].name; } + +int +x86_64_register_name2nr (const char *name) +{ + int reg_nr; + + for (reg_nr = 0; reg_nr < X86_64_NUM_REGS; reg_nr++) + if (strcmp (name, x86_64_register_info_table[reg_nr].name) == 0) + return reg_nr; + return -1; +} @@ -862,7 +874,7 @@ x86_64_skip_prologue (CORE_ADDR pc) /* First check, whether pc points to pushq %rbp, movq %rsp,%rbp. */ for (i = 0; i < PROLOG_BUFSIZE; i++) if (prolog_expect[i] != prolog_buf[i]) - return pc; /* ... no, it doesn't. Nothing to skip. */ + return pc; /* ... no, it doesn't. Nothing to skip. */ /* OK, we have found the prologue and want PC of the first non-prologue instruction. */ @@ -982,7 +994,7 @@ x86_64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_long_double_format (gdbarch, &floatformat_i387_ext); set_gdbarch_num_regs (gdbarch, X86_64_NUM_REGS); - set_gdbarch_register_name (gdbarch, x86_64_register_name); + set_gdbarch_register_name (gdbarch, x86_64_register_nr2name); set_gdbarch_register_size (gdbarch, 8); set_gdbarch_register_raw_size (gdbarch, x86_64_register_raw_size); set_gdbarch_max_register_raw_size (gdbarch, 16); |