Lines 73-84
arm_fbsd_supply_pcb(struct regcache *regcache, CORE_ADDR pcb_addr)
Link Here
|
73 |
regcache->raw_supply_unsigned(ARM_PS_REGNUM, 0); |
73 |
regcache->raw_supply_unsigned(ARM_PS_REGNUM, 0); |
74 |
} |
74 |
} |
75 |
|
75 |
|
|
|
76 |
#define PSR_MODE 0x0000001f /* mode mask */ |
77 |
#define PSR_USR32_MODE 0x00000010 |
78 |
|
76 |
static struct trad_frame_cache * |
79 |
static struct trad_frame_cache * |
77 |
arm_fbsd_trapframe_cache (struct frame_info *this_frame, void **this_cache) |
80 |
arm_fbsd_trapframe_cache (struct frame_info *this_frame, void **this_cache) |
78 |
{ |
81 |
{ |
79 |
struct gdbarch *gdbarch = get_frame_arch (this_frame); |
82 |
struct gdbarch *gdbarch = get_frame_arch (this_frame); |
80 |
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); |
83 |
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); |
81 |
struct trad_frame_cache *cache; |
84 |
struct trad_frame_cache *cache; |
|
|
85 |
uint32_t psr; |
82 |
CORE_ADDR func, pc, sp; |
86 |
CORE_ADDR func, pc, sp; |
83 |
const char *name; |
87 |
const char *name; |
84 |
int i; |
88 |
int i; |
Lines 94-103
arm_fbsd_trapframe_cache (struct frame_info *this_frame, void **this_cache)
Link Here
|
94 |
|
98 |
|
95 |
find_pc_partial_function (func, &name, NULL, NULL); |
99 |
find_pc_partial_function (func, &name, NULL, NULL); |
96 |
|
100 |
|
|
|
101 |
/* Read $PSR to determine where SP and LR are. */ |
102 |
psr = read_memory_unsigned_integer (sp, 4, byte_order); |
103 |
|
97 |
for (i = 0; i <= 12; i++) |
104 |
for (i = 0; i <= 12; i++) |
98 |
trad_frame_set_reg_addr (cache, ARM_A1_REGNUM + i, sp + 4 + i * 4); |
105 |
trad_frame_set_reg_addr (cache, ARM_A1_REGNUM + i, sp + 4 + i * 4); |
99 |
trad_frame_set_reg_addr (cache, ARM_SP_REGNUM, sp + 14 * 4); |
106 |
if ((psr & PSR_MODE) == PSR_USR32_MODE) |
100 |
trad_frame_set_reg_addr (cache, ARM_LR_REGNUM, sp + 15 * 4); |
107 |
{ |
|
|
108 |
trad_frame_set_reg_addr (cache, ARM_SP_REGNUM, sp + 14 * 4); |
109 |
trad_frame_set_reg_addr (cache, ARM_LR_REGNUM, sp + 15 * 4); |
110 |
} |
111 |
else |
112 |
{ |
113 |
trad_frame_set_reg_addr (cache, ARM_SP_REGNUM, sp + 16 * 4); |
114 |
trad_frame_set_reg_addr (cache, ARM_LR_REGNUM, sp + 17 * 4); |
115 |
} |
101 |
trad_frame_set_reg_addr (cache, ARM_PC_REGNUM, sp + 18 * 4); |
116 |
trad_frame_set_reg_addr (cache, ARM_PC_REGNUM, sp + 18 * 4); |
102 |
trad_frame_set_reg_addr (cache, ARM_PS_REGNUM, sp); |
117 |
trad_frame_set_reg_addr (cache, ARM_PS_REGNUM, sp); |
103 |
|
118 |
|