/* Target-dependent code for AMD64.
- Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
- Contributed by Jiri Smid, SuSE Labs.
+ Copyright 2001, 2002, 2003, 2004, 2005 Free Software Foundation,
+ Inc. Contributed by Jiri Smid, SuSE Labs.
This file is part of GDB.
{
int regnum = -1;
- if (reg >= 0 || reg < amd64_dwarf_regmap_len)
+ if (reg >= 0 && reg < amd64_dwarf_regmap_len)
regnum = amd64_dwarf_regmap[reg];
if (regnum == -1)
- warning ("Unmapped DWARF Register #%d encountered\n", reg);
+ warning (_("Unmapped DWARF Register #%d encountered."), reg);
return regnum;
}
for (i = 0; i < nargs; i++)
{
- struct type *type = VALUE_TYPE (args[i]);
+ struct type *type = value_type (args[i]);
int len = TYPE_LENGTH (type);
enum amd64_reg_class class[2];
int needed_integer_regs = 0;
else
{
/* The argument will be passed in registers. */
- char *valbuf = VALUE_CONTENTS (args[i]);
+ const bfd_byte *valbuf = value_contents (args[i]);
char buf[8];
gdb_assert (len <= 16);
/* Write out the arguments to the stack. */
for (i = 0; i < num_stack_args; i++)
{
- struct type *type = VALUE_TYPE (stack_args[i]);
- char *valbuf = VALUE_CONTENTS (stack_args[i]);
+ struct type *type = value_type (stack_args[i]);
+ const bfd_byte *valbuf = value_contents (stack_args[i]);
int len = TYPE_LENGTH (type);
write_memory (sp + element * 8, valbuf, len);
return;
}
- frame_register_unwind (next_frame, regnum,
- optimizedp, lvalp, addrp, realnump, valuep);
+ *optimizedp = 0;
+ *lvalp = lval_register;
+ *addrp = 0;
+ *realnump = regnum;
+ if (valuep)
+ frame_unwind_register (next_frame, (*realnump), valuep);
}
static const struct frame_unwind amd64_frame_unwind =
set_gdbarch_unwind_dummy_id (gdbarch, amd64_unwind_dummy_id);
- /* FIXME: kettenis/20021026: This is ELF-specific. Fine for now,
- since all supported AMD64 targets are ELF, but that might change
- in the future. */
- set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
-
frame_unwind_append_sniffer (gdbarch, amd64_sigtramp_frame_sniffer);
frame_unwind_append_sniffer (gdbarch, amd64_frame_sniffer);
frame_base_set_default (gdbarch, &amd64_frame_base);