代码来自 gdb 6.1.1; mips-tep.c
#define PROC_LOW_ADDR(proc) ((proc)->pdr.adr) /* least address */
#define PROC_HIGH_ADDR(proc) ((proc)->high_addr) /* upper address bound */
#define PROC_FRAME_OFFSET(proc) ((proc)->pdr.frameoffset)
#define PROC_FRAME_REG(proc) ((proc)->pdr.framereg)
#define PROC_FRAME_ADJUST(proc) ((proc)->frame_adjust)
#define PROC_REG_MASK(proc) ((proc)->pdr.regmask)
#define PROC_FREG_MASK(proc) ((proc)->pdr.fregmask)
#define PROC_REG_OFFSET(proc) ((proc)->pdr.regoffset)
#define PROC_FREG_OFFSET(proc) ((proc)->pdr.fregoffset)
#define PROC_PC_REG(proc) ((proc)->pdr.pcreg)
/* FIXME drow/2002-06-10: If a pointer on the host is bigger than a long,
this will corrupt pdr.iline. Fortunately we don't use it. */
#define PROC_SYMBOL(proc) (*(struct symbol**)&(proc)->pdr.isym)
#define _PROC_MAGIC_ 0x0F0F0F0F
#define PROC_DESC_IS_DUMMY(proc) ((proc)->pdr.isym == _PROC_MAGIC_)
#define SET_PROC_DESC_IS_DUMMY(proc) ((proc)->pdr.isym = _PROC_MAGIC_)
bfdsec = bfd_get_section_by_name (sec->objfile->obfd, ".pdr");
/* Fill in what we need of the proc_desc. */
proc_desc = (mips_extra_func_info_t)
obstack_alloc (&sec->objfile->objfile_obstack,
sizeof (struct mips_extra_func_info));
PROC_LOW_ADDR (proc_desc) = startaddr;
/* Only used for dummy frames. */
PROC_HIGH_ADDR (proc_desc) = 0;
PROC_FRAME_OFFSET (proc_desc)= bfd_get_32 (sec->objfile->obfd, ptr + 20);
PROC_FRAME_REG (proc_desc) = bfd_get_32 (sec->objfile->obfd, ptr + 24);
PROC_FRAME_ADJUST (proc_desc) = 0;
PROC_REG_MASK (proc_desc) = bfd_get_32 (sec->objfile->obfd, ptr + 4);
PROC_FREG_MASK (proc_desc) = bfd_get_32 (sec->objfile->obfd, ptr + 12);
PROC_REG_OFFSET (proc_desc) = bfd_get_32 (sec->objfile->obfd, ptr + 8);
PROC_FREG_OFFSET (proc_desc)= bfd_get_32 (sec->objfile->obfd, ptr + 16);
PROC_PC_REG (proc_desc) = bfd_get_32 (sec->objfile->obfd, ptr + 28);
proc_desc->pdr.isym = (long) sym;
return proc_desc;
阅读(2094) | 评论(0) | 转发(0) |