/* Definitions for frame unwinder, for GDB, the GNU debugger.
- Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GDB.
#include "frame.h"
#include "frame-unwind.h"
#include "dummy-frame.h"
+#include "inline-frame.h"
#include "value.h"
#include "regcache.h"
can't override this. */
table->list = OBSTACK_ZALLOC (obstack, struct frame_unwind_table_entry);
table->list->unwinder = dummy_frame_unwind;
+ table->list->next = OBSTACK_ZALLOC (obstack, struct frame_unwind_table_entry);
+ table->list->next->unwinder = inline_frame_unwind;
/* The insertion point for OSABI sniffers. */
- table->osabi_head = &table->list->next;
+ table->osabi_head = &table->list->next->next;
return table;
}
struct value *
frame_unwind_got_optimized (struct frame_info *frame, int regnum)
{
- struct gdbarch *gdbarch = get_frame_arch (frame);
+ struct gdbarch *gdbarch = frame_unwind_arch (frame);
struct value *reg_val;
reg_val = value_zero (register_type (gdbarch, regnum), not_lval);
struct value *
frame_unwind_got_memory (struct frame_info *frame, int regnum, CORE_ADDR addr)
{
- struct gdbarch *gdbarch = get_frame_arch (frame);
+ struct gdbarch *gdbarch = frame_unwind_arch (frame);
+ struct value *v = value_at_lazy (register_type (gdbarch, regnum), addr);
- return value_at_lazy (register_type (gdbarch, regnum), addr);
+ set_value_stack (v, 1);
+ return v;
}
/* Return a value which indicates that FRAME's saved version of
frame_unwind_got_constant (struct frame_info *frame, int regnum,
ULONGEST val)
{
- struct gdbarch *gdbarch = get_frame_arch (frame);
+ struct gdbarch *gdbarch = frame_unwind_arch (frame);
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
struct value *reg_val;
reg_val = value_zero (register_type (gdbarch, regnum), not_lval);
store_unsigned_integer (value_contents_writeable (reg_val),
- register_size (gdbarch, regnum), val);
+ register_size (gdbarch, regnum), byte_order, val);
+ return reg_val;
+}
+
+struct value *
+frame_unwind_got_bytes (struct frame_info *frame, int regnum, gdb_byte *buf)
+{
+ struct gdbarch *gdbarch = frame_unwind_arch (frame);
+ struct value *reg_val;
+
+ reg_val = value_zero (register_type (gdbarch, regnum), not_lval);
+ memcpy (value_contents_raw (reg_val), buf, register_size (gdbarch, regnum));
return reg_val;
}
frame_unwind_got_address (struct frame_info *frame, int regnum,
CORE_ADDR addr)
{
- struct gdbarch *gdbarch = get_frame_arch (frame);
+ struct gdbarch *gdbarch = frame_unwind_arch (frame);
struct value *reg_val;
reg_val = value_zero (register_type (gdbarch, regnum), not_lval);