1 /* Target-dependent code for the Matsushita MN10300 for GDB, the GNU debugger.
3 Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
4 Free Software Foundation, Inc.
6 This file is part of GDB.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 #include "gdb_string.h"
25 #include "mn10300-tdep.h"
26 #include "gdb_assert.h"
31 #include "solib-svr4.h"
33 #include "trad-frame.h"
34 #include "tramp-frame.h"
35 #include "linux-tdep.h"
39 /* Transliterated from <asm-mn10300/elf.h>... */
40 #define MN10300_ELF_NGREG 28
41 #define MN10300_ELF_NFPREG 32
43 typedef gdb_byte mn10300_elf_greg_t
[4];
44 typedef mn10300_elf_greg_t mn10300_elf_gregset_t
[MN10300_ELF_NGREG
];
46 typedef gdb_byte mn10300_elf_fpreg_t
[4];
49 mn10300_elf_fpreg_t fpregs
[MN10300_ELF_NFPREG
];
51 } mn10300_elf_fpregset_t
;
53 /* elf_gregset_t register indices stolen from include/asm-mn10300/ptrace.h. */
54 #define MN10300_ELF_GREGSET_T_REG_INDEX_A3 0
55 #define MN10300_ELF_GREGSET_T_REG_INDEX_A2 1
56 #define MN10300_ELF_GREGSET_T_REG_INDEX_D3 2
57 #define MN10300_ELF_GREGSET_T_REG_INDEX_D2 3
58 #define MN10300_ELF_GREGSET_T_REG_INDEX_MCVF 4
59 #define MN10300_ELF_GREGSET_T_REG_INDEX_MCRL 5
60 #define MN10300_ELF_GREGSET_T_REG_INDEX_MCRH 6
61 #define MN10300_ELF_GREGSET_T_REG_INDEX_MDRQ 7
62 #define MN10300_ELF_GREGSET_T_REG_INDEX_E1 8
63 #define MN10300_ELF_GREGSET_T_REG_INDEX_E0 9
64 #define MN10300_ELF_GREGSET_T_REG_INDEX_E7 10
65 #define MN10300_ELF_GREGSET_T_REG_INDEX_E6 11
66 #define MN10300_ELF_GREGSET_T_REG_INDEX_E5 12
67 #define MN10300_ELF_GREGSET_T_REG_INDEX_E4 13
68 #define MN10300_ELF_GREGSET_T_REG_INDEX_E3 14
69 #define MN10300_ELF_GREGSET_T_REG_INDEX_E2 15
70 #define MN10300_ELF_GREGSET_T_REG_INDEX_SP 16
71 #define MN10300_ELF_GREGSET_T_REG_INDEX_LAR 17
72 #define MN10300_ELF_GREGSET_T_REG_INDEX_LIR 18
73 #define MN10300_ELF_GREGSET_T_REG_INDEX_MDR 19
74 #define MN10300_ELF_GREGSET_T_REG_INDEX_A1 20
75 #define MN10300_ELF_GREGSET_T_REG_INDEX_A0 21
76 #define MN10300_ELF_GREGSET_T_REG_INDEX_D1 22
77 #define MN10300_ELF_GREGSET_T_REG_INDEX_D0 23
78 #define MN10300_ELF_GREGSET_T_REG_INDEX_ORIG_D0 24
79 #define MN10300_ELF_GREGSET_T_REG_INDEX_EPSW 25
80 #define MN10300_ELF_GREGSET_T_REG_INDEX_PC 26
82 /* New gdbarch API for corefile registers.
83 Given a section name and size, create a struct reg object
84 with a supply_register and a collect_register method. */
86 /* Copy register value of REGNUM from regset to regcache.
87 If REGNUM is -1, do this for all gp registers in regset. */
90 am33_supply_gregset_method (const struct regset
*regset
,
91 struct regcache
*regcache
,
92 int regnum
, const void *gregs
, size_t len
)
94 char zerobuf
[MAX_REGISTER_SIZE
];
95 const mn10300_elf_greg_t
*regp
= (const mn10300_elf_greg_t
*) gregs
;
98 gdb_assert (len
== sizeof (mn10300_elf_gregset_t
));
102 regcache_raw_supply (regcache
, E_D0_REGNUM
,
103 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_D0
));
106 regcache_raw_supply (regcache
, E_D1_REGNUM
,
107 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_D1
));
110 regcache_raw_supply (regcache
, E_D2_REGNUM
,
111 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_D2
));
114 regcache_raw_supply (regcache
, E_D3_REGNUM
,
115 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_D3
));
118 regcache_raw_supply (regcache
, E_A0_REGNUM
,
119 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_A0
));
122 regcache_raw_supply (regcache
, E_A1_REGNUM
,
123 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_A1
));
126 regcache_raw_supply (regcache
, E_A2_REGNUM
,
127 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_A2
));
130 regcache_raw_supply (regcache
, E_A3_REGNUM
,
131 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_A3
));
134 regcache_raw_supply (regcache
, E_SP_REGNUM
,
135 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_SP
));
138 regcache_raw_supply (regcache
, E_PC_REGNUM
,
139 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_PC
));
142 regcache_raw_supply (regcache
, E_MDR_REGNUM
,
143 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_MDR
));
146 regcache_raw_supply (regcache
, E_PSW_REGNUM
,
147 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_EPSW
));
150 regcache_raw_supply (regcache
, E_LIR_REGNUM
,
151 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_LIR
));
154 regcache_raw_supply (regcache
, E_LAR_REGNUM
,
155 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_LAR
));
158 regcache_raw_supply (regcache
, E_MDRQ_REGNUM
,
159 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_MDRQ
));
162 regcache_raw_supply (regcache
, E_E0_REGNUM
,
163 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E0
));
166 regcache_raw_supply (regcache
, E_E1_REGNUM
,
167 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E1
));
170 regcache_raw_supply (regcache
, E_E2_REGNUM
,
171 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E2
));
174 regcache_raw_supply (regcache
, E_E3_REGNUM
,
175 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E3
));
178 regcache_raw_supply (regcache
, E_E4_REGNUM
,
179 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E4
));
182 regcache_raw_supply (regcache
, E_E5_REGNUM
,
183 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E5
));
186 regcache_raw_supply (regcache
, E_E6_REGNUM
,
187 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E6
));
190 regcache_raw_supply (regcache
, E_E7_REGNUM
,
191 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E7
));
194 /* ssp, msp, and usp are inaccessible. */
196 memset (zerobuf
, 0, MAX_REGISTER_SIZE
);
197 regcache_raw_supply (regcache
, E_E8_REGNUM
, zerobuf
);
200 memset (zerobuf
, 0, MAX_REGISTER_SIZE
);
201 regcache_raw_supply (regcache
, E_E9_REGNUM
, zerobuf
);
204 memset (zerobuf
, 0, MAX_REGISTER_SIZE
);
205 regcache_raw_supply (regcache
, E_E10_REGNUM
, zerobuf
);
209 regcache_raw_supply (regcache
, E_MCRH_REGNUM
,
210 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_MCRH
));
213 regcache_raw_supply (regcache
, E_MCRL_REGNUM
,
214 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_MCRL
));
217 regcache_raw_supply (regcache
, E_MCVF_REGNUM
,
218 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_MCVF
));
221 /* FPCR is numbered among the GP regs, but handled as an FP reg.
224 case E_FPCR_REGNUM
+ 1:
225 /* The two unused registers beyond fpcr are inaccessible. */
226 memset (zerobuf
, 0, MAX_REGISTER_SIZE
);
227 regcache_raw_supply (regcache
, E_FPCR_REGNUM
+ 1, zerobuf
);
229 case E_FPCR_REGNUM
+ 2:
230 memset (zerobuf
, 0, MAX_REGISTER_SIZE
);
231 regcache_raw_supply (regcache
, E_FPCR_REGNUM
+ 2, zerobuf
);
233 default: /* An error, obviously, but should we error out? */
236 for (i
= 0; i
< MN10300_ELF_NGREG
; i
++)
237 am33_supply_gregset_method (regset
, regcache
, i
, gregs
, len
);
243 /* Copy fp register value of REGNUM from regset to regcache.
244 If REGNUM is -1, do this for all fp registers in regset. */
247 am33_supply_fpregset_method (const struct regset
*regset
,
248 struct regcache
*regcache
,
249 int regnum
, const void *fpregs
, size_t len
)
251 const mn10300_elf_fpregset_t
*fpregset
= fpregs
;
253 gdb_assert (len
== sizeof (mn10300_elf_fpregset_t
));
259 for (i
= 0; i
< MN10300_ELF_NFPREG
; i
++)
260 am33_supply_fpregset_method (regset
, regcache
,
261 E_FS0_REGNUM
+ i
, fpregs
, len
);
262 am33_supply_fpregset_method (regset
, regcache
,
263 E_FPCR_REGNUM
, fpregs
, len
);
265 else if (regnum
== E_FPCR_REGNUM
)
266 regcache_raw_supply (regcache
, E_FPCR_REGNUM
,
268 else if (E_FS0_REGNUM
<= regnum
269 && regnum
< E_FS0_REGNUM
+ MN10300_ELF_NFPREG
)
270 regcache_raw_supply (regcache
, regnum
,
271 &fpregset
->fpregs
[regnum
- E_FS0_REGNUM
]);
276 /* Copy register values from regcache to regset. */
279 am33_collect_gregset_method (const struct regset
*regset
,
280 const struct regcache
*regcache
,
281 int regnum
, void *gregs
, size_t len
)
283 mn10300_elf_gregset_t
*regp
= gregs
;
286 gdb_assert (len
== sizeof (mn10300_elf_gregset_t
));
290 regcache_raw_collect (regcache
, E_D0_REGNUM
,
291 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_D0
));
294 regcache_raw_collect (regcache
, E_D1_REGNUM
,
295 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_D1
));
298 regcache_raw_collect (regcache
, E_D2_REGNUM
,
299 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_D2
));
302 regcache_raw_collect (regcache
, E_D3_REGNUM
,
303 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_D3
));
306 regcache_raw_collect (regcache
, E_A0_REGNUM
,
307 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_A0
));
310 regcache_raw_collect (regcache
, E_A1_REGNUM
,
311 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_A1
));
314 regcache_raw_collect (regcache
, E_A2_REGNUM
,
315 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_A2
));
318 regcache_raw_collect (regcache
, E_A3_REGNUM
,
319 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_A3
));
322 regcache_raw_collect (regcache
, E_SP_REGNUM
,
323 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_SP
));
326 regcache_raw_collect (regcache
, E_PC_REGNUM
,
327 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_PC
));
330 regcache_raw_collect (regcache
, E_MDR_REGNUM
,
331 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_MDR
));
334 regcache_raw_collect (regcache
, E_PSW_REGNUM
,
335 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_EPSW
));
338 regcache_raw_collect (regcache
, E_LIR_REGNUM
,
339 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_LIR
));
342 regcache_raw_collect (regcache
, E_LAR_REGNUM
,
343 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_LAR
));
346 regcache_raw_collect (regcache
, E_MDRQ_REGNUM
,
347 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_MDRQ
));
350 regcache_raw_collect (regcache
, E_E0_REGNUM
,
351 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E0
));
354 regcache_raw_collect (regcache
, E_E1_REGNUM
,
355 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E1
));
358 regcache_raw_collect (regcache
, E_E2_REGNUM
,
359 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E2
));
362 regcache_raw_collect (regcache
, E_E3_REGNUM
,
363 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E3
));
366 regcache_raw_collect (regcache
, E_E4_REGNUM
,
367 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E4
));
370 regcache_raw_collect (regcache
, E_E5_REGNUM
,
371 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E5
));
374 regcache_raw_collect (regcache
, E_E6_REGNUM
,
375 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E6
));
378 regcache_raw_collect (regcache
, E_E7_REGNUM
,
379 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E7
));
382 /* ssp, msp, and usp are inaccessible. */
384 /* The gregset struct has noplace to put this: do nothing. */
387 /* The gregset struct has noplace to put this: do nothing. */
390 /* The gregset struct has noplace to put this: do nothing. */
393 regcache_raw_collect (regcache
, E_MCRH_REGNUM
,
394 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_MCRH
));
397 regcache_raw_collect (regcache
, E_MCRL_REGNUM
,
398 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_MCRL
));
401 regcache_raw_collect (regcache
, E_MCVF_REGNUM
,
402 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_MCVF
));
405 /* FPCR is numbered among the GP regs, but handled as an FP reg.
408 case E_FPCR_REGNUM
+ 1:
409 /* The gregset struct has noplace to put this: do nothing. */
411 case E_FPCR_REGNUM
+ 2:
412 /* The gregset struct has noplace to put this: do nothing. */
414 default: /* An error, obviously, but should we error out? */
417 for (i
= 0; i
< MN10300_ELF_NGREG
; i
++)
418 am33_collect_gregset_method (regset
, regcache
, i
, gregs
, len
);
424 /* Copy fp register values from regcache to regset. */
427 am33_collect_fpregset_method (const struct regset
*regset
,
428 const struct regcache
*regcache
,
429 int regnum
, void *fpregs
, size_t len
)
431 mn10300_elf_fpregset_t
*fpregset
= fpregs
;
433 gdb_assert (len
== sizeof (mn10300_elf_fpregset_t
));
438 for (i
= 0; i
< MN10300_ELF_NFPREG
; i
++)
439 am33_collect_fpregset_method (regset
, regcache
, E_FS0_REGNUM
+ i
,
441 am33_collect_fpregset_method (regset
, regcache
,
442 E_FPCR_REGNUM
, fpregs
, len
);
444 else if (regnum
== E_FPCR_REGNUM
)
445 regcache_raw_collect (regcache
, E_FPCR_REGNUM
,
447 else if (E_FS0_REGNUM
<= regnum
448 && regnum
< E_FS0_REGNUM
+ MN10300_ELF_NFPREG
)
449 regcache_raw_collect (regcache
, regnum
,
450 &fpregset
->fpregs
[regnum
- E_FS0_REGNUM
]);
455 /* Create a struct regset from a corefile register section. */
457 static const struct regset
*
458 am33_regset_from_core_section (struct gdbarch
*gdbarch
,
459 const char *sect_name
,
462 /* We will call regset_alloc, and pass the names of the supply and
465 if (sect_size
== sizeof (mn10300_elf_fpregset_t
))
466 return regset_alloc (gdbarch
,
467 am33_supply_fpregset_method
,
468 am33_collect_fpregset_method
);
470 return regset_alloc (gdbarch
,
471 am33_supply_gregset_method
,
472 am33_collect_gregset_method
);
476 am33_linux_sigframe_cache_init (const struct tramp_frame
*self
,
477 struct frame_info
*this_frame
,
478 struct trad_frame_cache
*this_cache
,
481 static const struct tramp_frame am33_linux_sigframe
= {
492 { TRAMP_SENTINEL_INSN
, -1 }
494 am33_linux_sigframe_cache_init
497 static const struct tramp_frame am33_linux_rt_sigframe
= {
508 { TRAMP_SENTINEL_INSN
, -1 }
510 am33_linux_sigframe_cache_init
513 /* Relevant struct definitions for signal handling...
515 From arch/mn10300/kernel/sigframe.h:
519 void (*pretcode)(void);
521 struct sigcontext *psc;
522 struct sigcontext sc;
523 struct fpucontext fpuctx;
524 unsigned long extramask[_NSIG_WORDS-1];
530 void (*pretcode)(void);
532 struct siginfo *pinfo;
536 struct fpucontext fpuctx;
540 From include/asm-mn10300/ucontext.h:
543 unsigned long uc_flags;
544 struct ucontext *uc_link;
546 struct sigcontext uc_mcontext;
550 From include/asm-mn10300/sigcontext.h:
553 unsigned long fs[32];
584 struct fpucontext *fpucontext;
585 unsigned long oldmask;
589 #define AM33_SIGCONTEXT_D0 0
590 #define AM33_SIGCONTEXT_D1 4
591 #define AM33_SIGCONTEXT_D2 8
592 #define AM33_SIGCONTEXT_D3 12
593 #define AM33_SIGCONTEXT_A0 16
594 #define AM33_SIGCONTEXT_A1 20
595 #define AM33_SIGCONTEXT_A2 24
596 #define AM33_SIGCONTEXT_A3 28
597 #define AM33_SIGCONTEXT_E0 32
598 #define AM33_SIGCONTEXT_E1 36
599 #define AM33_SIGCONTEXT_E2 40
600 #define AM33_SIGCONTEXT_E3 44
601 #define AM33_SIGCONTEXT_E4 48
602 #define AM33_SIGCONTEXT_E5 52
603 #define AM33_SIGCONTEXT_E6 56
604 #define AM33_SIGCONTEXT_E7 60
605 #define AM33_SIGCONTEXT_LAR 64
606 #define AM33_SIGCONTEXT_LIR 68
607 #define AM33_SIGCONTEXT_MDR 72
608 #define AM33_SIGCONTEXT_MCVF 76
609 #define AM33_SIGCONTEXT_MCRL 80
610 #define AM33_SIGCONTEXT_MCRH 84
611 #define AM33_SIGCONTEXT_MDRQ 88
612 #define AM33_SIGCONTEXT_SP 92
613 #define AM33_SIGCONTEXT_EPSW 96
614 #define AM33_SIGCONTEXT_PC 100
615 #define AM33_SIGCONTEXT_FPUCONTEXT 104
619 am33_linux_sigframe_cache_init (const struct tramp_frame
*self
,
620 struct frame_info
*this_frame
,
621 struct trad_frame_cache
*this_cache
,
624 CORE_ADDR sc_base
, fpubase
;
627 sc_base
= get_frame_register_unsigned (this_frame
, E_SP_REGNUM
);
628 if (self
== &am33_linux_sigframe
)
631 sc_base
= get_frame_memory_unsigned (this_frame
, sc_base
, 4);
636 sc_base
= get_frame_memory_unsigned (this_frame
, sc_base
, 4);
640 trad_frame_set_reg_addr (this_cache
, E_D0_REGNUM
,
641 sc_base
+ AM33_SIGCONTEXT_D0
);
642 trad_frame_set_reg_addr (this_cache
, E_D1_REGNUM
,
643 sc_base
+ AM33_SIGCONTEXT_D1
);
644 trad_frame_set_reg_addr (this_cache
, E_D2_REGNUM
,
645 sc_base
+ AM33_SIGCONTEXT_D2
);
646 trad_frame_set_reg_addr (this_cache
, E_D3_REGNUM
,
647 sc_base
+ AM33_SIGCONTEXT_D3
);
649 trad_frame_set_reg_addr (this_cache
, E_A0_REGNUM
,
650 sc_base
+ AM33_SIGCONTEXT_A0
);
651 trad_frame_set_reg_addr (this_cache
, E_A1_REGNUM
,
652 sc_base
+ AM33_SIGCONTEXT_A1
);
653 trad_frame_set_reg_addr (this_cache
, E_A2_REGNUM
,
654 sc_base
+ AM33_SIGCONTEXT_A2
);
655 trad_frame_set_reg_addr (this_cache
, E_A3_REGNUM
,
656 sc_base
+ AM33_SIGCONTEXT_A3
);
658 trad_frame_set_reg_addr (this_cache
, E_E0_REGNUM
,
659 sc_base
+ AM33_SIGCONTEXT_E0
);
660 trad_frame_set_reg_addr (this_cache
, E_E1_REGNUM
,
661 sc_base
+ AM33_SIGCONTEXT_E1
);
662 trad_frame_set_reg_addr (this_cache
, E_E2_REGNUM
,
663 sc_base
+ AM33_SIGCONTEXT_E2
);
664 trad_frame_set_reg_addr (this_cache
, E_E3_REGNUM
,
665 sc_base
+ AM33_SIGCONTEXT_E3
);
666 trad_frame_set_reg_addr (this_cache
, E_E4_REGNUM
,
667 sc_base
+ AM33_SIGCONTEXT_E4
);
668 trad_frame_set_reg_addr (this_cache
, E_E5_REGNUM
,
669 sc_base
+ AM33_SIGCONTEXT_E5
);
670 trad_frame_set_reg_addr (this_cache
, E_E6_REGNUM
,
671 sc_base
+ AM33_SIGCONTEXT_E6
);
672 trad_frame_set_reg_addr (this_cache
, E_E7_REGNUM
,
673 sc_base
+ AM33_SIGCONTEXT_E7
);
675 trad_frame_set_reg_addr (this_cache
, E_LAR_REGNUM
,
676 sc_base
+ AM33_SIGCONTEXT_LAR
);
677 trad_frame_set_reg_addr (this_cache
, E_LIR_REGNUM
,
678 sc_base
+ AM33_SIGCONTEXT_LIR
);
679 trad_frame_set_reg_addr (this_cache
, E_MDR_REGNUM
,
680 sc_base
+ AM33_SIGCONTEXT_MDR
);
681 trad_frame_set_reg_addr (this_cache
, E_MCVF_REGNUM
,
682 sc_base
+ AM33_SIGCONTEXT_MCVF
);
683 trad_frame_set_reg_addr (this_cache
, E_MCRL_REGNUM
,
684 sc_base
+ AM33_SIGCONTEXT_MCRL
);
685 trad_frame_set_reg_addr (this_cache
, E_MDRQ_REGNUM
,
686 sc_base
+ AM33_SIGCONTEXT_MDRQ
);
688 trad_frame_set_reg_addr (this_cache
, E_SP_REGNUM
,
689 sc_base
+ AM33_SIGCONTEXT_SP
);
690 trad_frame_set_reg_addr (this_cache
, E_PSW_REGNUM
,
691 sc_base
+ AM33_SIGCONTEXT_EPSW
);
692 trad_frame_set_reg_addr (this_cache
, E_PC_REGNUM
,
693 sc_base
+ AM33_SIGCONTEXT_PC
);
695 fpubase
= get_frame_memory_unsigned (this_frame
,
696 sc_base
+ AM33_SIGCONTEXT_FPUCONTEXT
,
700 for (i
= 0; i
< 32; i
++)
702 trad_frame_set_reg_addr (this_cache
, E_FS0_REGNUM
+ i
,
705 trad_frame_set_reg_addr (this_cache
, E_FPCR_REGNUM
, fpubase
+ 4 * 32);
708 trad_frame_set_id (this_cache
, frame_id_build (sc_base
, func
));
711 /* AM33 GNU/Linux osabi has been recognized.
712 Now's our chance to register our corefile handling. */
715 am33_linux_init_osabi (struct gdbarch_info info
, struct gdbarch
*gdbarch
)
717 linux_init_abi (info
, gdbarch
);
719 set_gdbarch_regset_from_core_section (gdbarch
,
720 am33_regset_from_core_section
);
721 set_solib_svr4_fetch_link_map_offsets
722 (gdbarch
, svr4_ilp32_fetch_link_map_offsets
);
724 tramp_frame_prepend_unwinder (gdbarch
, &am33_linux_sigframe
);
725 tramp_frame_prepend_unwinder (gdbarch
, &am33_linux_rt_sigframe
);
728 /* Provide a prototype to silence -Wmissing-prototypes. */
729 extern initialize_file_ftype _initialize_mn10300_linux_tdep
;
732 _initialize_mn10300_linux_tdep (void)
734 gdbarch_register_osabi (bfd_arch_mn10300
, 0,
735 GDB_OSABI_LINUX
, am33_linux_init_osabi
);