1 /* Target-dependent code for the Matsushita MN10300 for GDB, the GNU debugger.
3 Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
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"
38 /* Transliterated from <asm-mn10300/elf.h>... */
39 #define MN10300_ELF_NGREG 28
40 #define MN10300_ELF_NFPREG 32
42 typedef gdb_byte mn10300_elf_greg_t
[4];
43 typedef mn10300_elf_greg_t mn10300_elf_gregset_t
[MN10300_ELF_NGREG
];
45 typedef gdb_byte mn10300_elf_fpreg_t
[4];
48 mn10300_elf_fpreg_t fpregs
[MN10300_ELF_NFPREG
];
50 } mn10300_elf_fpregset_t
;
52 /* elf_gregset_t register indices stolen from include/asm-mn10300/ptrace.h. */
53 #define MN10300_ELF_GREGSET_T_REG_INDEX_A3 0
54 #define MN10300_ELF_GREGSET_T_REG_INDEX_A2 1
55 #define MN10300_ELF_GREGSET_T_REG_INDEX_D3 2
56 #define MN10300_ELF_GREGSET_T_REG_INDEX_D2 3
57 #define MN10300_ELF_GREGSET_T_REG_INDEX_MCVF 4
58 #define MN10300_ELF_GREGSET_T_REG_INDEX_MCRL 5
59 #define MN10300_ELF_GREGSET_T_REG_INDEX_MCRH 6
60 #define MN10300_ELF_GREGSET_T_REG_INDEX_MDRQ 7
61 #define MN10300_ELF_GREGSET_T_REG_INDEX_E1 8
62 #define MN10300_ELF_GREGSET_T_REG_INDEX_E0 9
63 #define MN10300_ELF_GREGSET_T_REG_INDEX_E7 10
64 #define MN10300_ELF_GREGSET_T_REG_INDEX_E6 11
65 #define MN10300_ELF_GREGSET_T_REG_INDEX_E5 12
66 #define MN10300_ELF_GREGSET_T_REG_INDEX_E4 13
67 #define MN10300_ELF_GREGSET_T_REG_INDEX_E3 14
68 #define MN10300_ELF_GREGSET_T_REG_INDEX_E2 15
69 #define MN10300_ELF_GREGSET_T_REG_INDEX_SP 16
70 #define MN10300_ELF_GREGSET_T_REG_INDEX_LAR 17
71 #define MN10300_ELF_GREGSET_T_REG_INDEX_LIR 18
72 #define MN10300_ELF_GREGSET_T_REG_INDEX_MDR 19
73 #define MN10300_ELF_GREGSET_T_REG_INDEX_A1 20
74 #define MN10300_ELF_GREGSET_T_REG_INDEX_A0 21
75 #define MN10300_ELF_GREGSET_T_REG_INDEX_D1 22
76 #define MN10300_ELF_GREGSET_T_REG_INDEX_D0 23
77 #define MN10300_ELF_GREGSET_T_REG_INDEX_ORIG_D0 24
78 #define MN10300_ELF_GREGSET_T_REG_INDEX_EPSW 25
79 #define MN10300_ELF_GREGSET_T_REG_INDEX_PC 26
81 /* New gdbarch API for corefile registers.
82 Given a section name and size, create a struct reg object
83 with a supply_register and a collect_register method. */
85 /* Copy register value of REGNUM from regset to regcache.
86 If REGNUM is -1, do this for all gp registers in regset. */
89 am33_supply_gregset_method (const struct regset
*regset
,
90 struct regcache
*regcache
,
91 int regnum
, const void *gregs
, size_t len
)
93 char zerobuf
[MAX_REGISTER_SIZE
];
94 const mn10300_elf_greg_t
*regp
= (const mn10300_elf_greg_t
*) gregs
;
97 gdb_assert (len
== sizeof (mn10300_elf_gregset_t
));
101 regcache_raw_supply (regcache
, E_D0_REGNUM
,
102 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_D0
));
105 regcache_raw_supply (regcache
, E_D1_REGNUM
,
106 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_D1
));
109 regcache_raw_supply (regcache
, E_D2_REGNUM
,
110 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_D2
));
113 regcache_raw_supply (regcache
, E_D3_REGNUM
,
114 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_D3
));
117 regcache_raw_supply (regcache
, E_A0_REGNUM
,
118 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_A0
));
121 regcache_raw_supply (regcache
, E_A1_REGNUM
,
122 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_A1
));
125 regcache_raw_supply (regcache
, E_A2_REGNUM
,
126 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_A2
));
129 regcache_raw_supply (regcache
, E_A3_REGNUM
,
130 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_A3
));
133 regcache_raw_supply (regcache
, E_SP_REGNUM
,
134 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_SP
));
137 regcache_raw_supply (regcache
, E_PC_REGNUM
,
138 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_PC
));
141 regcache_raw_supply (regcache
, E_MDR_REGNUM
,
142 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_MDR
));
145 regcache_raw_supply (regcache
, E_PSW_REGNUM
,
146 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_EPSW
));
149 regcache_raw_supply (regcache
, E_LIR_REGNUM
,
150 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_LIR
));
153 regcache_raw_supply (regcache
, E_LAR_REGNUM
,
154 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_LAR
));
157 regcache_raw_supply (regcache
, E_MDRQ_REGNUM
,
158 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_MDRQ
));
161 regcache_raw_supply (regcache
, E_E0_REGNUM
,
162 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E0
));
165 regcache_raw_supply (regcache
, E_E1_REGNUM
,
166 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E1
));
169 regcache_raw_supply (regcache
, E_E2_REGNUM
,
170 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E2
));
173 regcache_raw_supply (regcache
, E_E3_REGNUM
,
174 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E3
));
177 regcache_raw_supply (regcache
, E_E4_REGNUM
,
178 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E4
));
181 regcache_raw_supply (regcache
, E_E5_REGNUM
,
182 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E5
));
185 regcache_raw_supply (regcache
, E_E6_REGNUM
,
186 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E6
));
189 regcache_raw_supply (regcache
, E_E7_REGNUM
,
190 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E7
));
193 /* ssp, msp, and usp are inaccessible. */
195 memset (zerobuf
, 0, MAX_REGISTER_SIZE
);
196 regcache_raw_supply (regcache
, E_E8_REGNUM
, zerobuf
);
199 memset (zerobuf
, 0, MAX_REGISTER_SIZE
);
200 regcache_raw_supply (regcache
, E_E9_REGNUM
, zerobuf
);
203 memset (zerobuf
, 0, MAX_REGISTER_SIZE
);
204 regcache_raw_supply (regcache
, E_E10_REGNUM
, zerobuf
);
208 regcache_raw_supply (regcache
, E_MCRH_REGNUM
,
209 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_MCRH
));
212 regcache_raw_supply (regcache
, E_MCRL_REGNUM
,
213 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_MCRL
));
216 regcache_raw_supply (regcache
, E_MCVF_REGNUM
,
217 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_MCVF
));
220 /* FPCR is numbered among the GP regs, but handled as an FP reg.
223 case E_FPCR_REGNUM
+ 1:
224 /* The two unused registers beyond fpcr are inaccessible. */
225 memset (zerobuf
, 0, MAX_REGISTER_SIZE
);
226 regcache_raw_supply (regcache
, E_FPCR_REGNUM
+ 1, zerobuf
);
228 case E_FPCR_REGNUM
+ 2:
229 memset (zerobuf
, 0, MAX_REGISTER_SIZE
);
230 regcache_raw_supply (regcache
, E_FPCR_REGNUM
+ 2, zerobuf
);
232 default: /* An error, obviously, but should we error out? */
235 for (i
= 0; i
< MN10300_ELF_NGREG
; i
++)
236 am33_supply_gregset_method (regset
, regcache
, i
, gregs
, len
);
242 /* Copy fp register value of REGNUM from regset to regcache.
243 If REGNUM is -1, do this for all fp registers in regset. */
246 am33_supply_fpregset_method (const struct regset
*regset
,
247 struct regcache
*regcache
,
248 int regnum
, const void *fpregs
, size_t len
)
250 const mn10300_elf_fpregset_t
*fpregset
= fpregs
;
252 gdb_assert (len
== sizeof (mn10300_elf_fpregset_t
));
258 for (i
= 0; i
< MN10300_ELF_NFPREG
; i
++)
259 am33_supply_fpregset_method (regset
, regcache
,
260 E_FS0_REGNUM
+ i
, fpregs
, len
);
261 am33_supply_fpregset_method (regset
, regcache
,
262 E_FPCR_REGNUM
, fpregs
, len
);
264 else if (regnum
== E_FPCR_REGNUM
)
265 regcache_raw_supply (regcache
, E_FPCR_REGNUM
,
267 else if (E_FS0_REGNUM
<= regnum
&& regnum
< E_FS0_REGNUM
+ MN10300_ELF_NFPREG
)
268 regcache_raw_supply (regcache
, regnum
,
269 &fpregset
->fpregs
[regnum
- E_FS0_REGNUM
]);
274 /* Copy register values from regcache to regset. */
277 am33_collect_gregset_method (const struct regset
*regset
,
278 const struct regcache
*regcache
,
279 int regnum
, void *gregs
, size_t len
)
281 mn10300_elf_gregset_t
*regp
= gregs
;
284 gdb_assert (len
== sizeof (mn10300_elf_gregset_t
));
288 regcache_raw_collect (regcache
, E_D0_REGNUM
,
289 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_D0
));
292 regcache_raw_collect (regcache
, E_D1_REGNUM
,
293 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_D1
));
296 regcache_raw_collect (regcache
, E_D2_REGNUM
,
297 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_D2
));
300 regcache_raw_collect (regcache
, E_D3_REGNUM
,
301 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_D3
));
304 regcache_raw_collect (regcache
, E_A0_REGNUM
,
305 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_A0
));
308 regcache_raw_collect (regcache
, E_A1_REGNUM
,
309 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_A1
));
312 regcache_raw_collect (regcache
, E_A2_REGNUM
,
313 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_A2
));
316 regcache_raw_collect (regcache
, E_A3_REGNUM
,
317 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_A3
));
320 regcache_raw_collect (regcache
, E_SP_REGNUM
,
321 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_SP
));
324 regcache_raw_collect (regcache
, E_PC_REGNUM
,
325 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_PC
));
328 regcache_raw_collect (regcache
, E_MDR_REGNUM
,
329 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_MDR
));
332 regcache_raw_collect (regcache
, E_PSW_REGNUM
,
333 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_EPSW
));
336 regcache_raw_collect (regcache
, E_LIR_REGNUM
,
337 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_LIR
));
340 regcache_raw_collect (regcache
, E_LAR_REGNUM
,
341 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_LAR
));
344 regcache_raw_collect (regcache
, E_MDRQ_REGNUM
,
345 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_MDRQ
));
348 regcache_raw_collect (regcache
, E_E0_REGNUM
,
349 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E0
));
352 regcache_raw_collect (regcache
, E_E1_REGNUM
,
353 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E1
));
356 regcache_raw_collect (regcache
, E_E2_REGNUM
,
357 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E2
));
360 regcache_raw_collect (regcache
, E_E3_REGNUM
,
361 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E3
));
364 regcache_raw_collect (regcache
, E_E4_REGNUM
,
365 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E4
));
368 regcache_raw_collect (regcache
, E_E5_REGNUM
,
369 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E5
));
372 regcache_raw_collect (regcache
, E_E6_REGNUM
,
373 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E6
));
376 regcache_raw_collect (regcache
, E_E7_REGNUM
,
377 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_E7
));
380 /* ssp, msp, and usp are inaccessible. */
382 /* The gregset struct has noplace to put this: do nothing. */
385 /* The gregset struct has noplace to put this: do nothing. */
388 /* The gregset struct has noplace to put this: do nothing. */
391 regcache_raw_collect (regcache
, E_MCRH_REGNUM
,
392 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_MCRH
));
395 regcache_raw_collect (regcache
, E_MCRL_REGNUM
,
396 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_MCRL
));
399 regcache_raw_collect (regcache
, E_MCVF_REGNUM
,
400 (regp
+ MN10300_ELF_GREGSET_T_REG_INDEX_MCVF
));
403 /* FPCR is numbered among the GP regs, but handled as an FP reg.
406 case E_FPCR_REGNUM
+ 1:
407 /* The gregset struct has noplace to put this: do nothing. */
409 case E_FPCR_REGNUM
+ 2:
410 /* The gregset struct has noplace to put this: do nothing. */
412 default: /* An error, obviously, but should we error out? */
415 for (i
= 0; i
< MN10300_ELF_NGREG
; i
++)
416 am33_collect_gregset_method (regset
, regcache
, i
, gregs
, len
);
422 /* Copy fp register values from regcache to regset. */
425 am33_collect_fpregset_method (const struct regset
*regset
,
426 const struct regcache
*regcache
,
427 int regnum
, void *fpregs
, size_t len
)
429 mn10300_elf_fpregset_t
*fpregset
= fpregs
;
431 gdb_assert (len
== sizeof (mn10300_elf_fpregset_t
));
436 for (i
= 0; i
< MN10300_ELF_NFPREG
; i
++)
437 am33_collect_fpregset_method (regset
, regcache
, E_FS0_REGNUM
+ i
,
439 am33_collect_fpregset_method (regset
, regcache
,
440 E_FPCR_REGNUM
, fpregs
, len
);
442 else if (regnum
== E_FPCR_REGNUM
)
443 regcache_raw_collect (regcache
, E_FPCR_REGNUM
,
445 else if (E_FS0_REGNUM
<= regnum
446 && regnum
< E_FS0_REGNUM
+ MN10300_ELF_NFPREG
)
447 regcache_raw_collect (regcache
, regnum
,
448 &fpregset
->fpregs
[regnum
- E_FS0_REGNUM
]);
453 /* Create a struct regset from a corefile register section. */
455 static const struct regset
*
456 am33_regset_from_core_section (struct gdbarch
*gdbarch
,
457 const char *sect_name
,
460 /* We will call regset_alloc, and pass the names of the supply and
463 if (sect_size
== sizeof (mn10300_elf_fpregset_t
))
464 return regset_alloc (gdbarch
,
465 am33_supply_fpregset_method
,
466 am33_collect_fpregset_method
);
468 return regset_alloc (gdbarch
,
469 am33_supply_gregset_method
,
470 am33_collect_gregset_method
);
474 am33_linux_sigframe_cache_init (const struct tramp_frame
*self
,
475 struct frame_info
*next_frame
,
476 struct trad_frame_cache
*this_cache
,
479 static const struct tramp_frame am33_linux_sigframe
= {
490 { TRAMP_SENTINEL_INSN
, -1 }
492 am33_linux_sigframe_cache_init
495 static const struct tramp_frame am33_linux_rt_sigframe
= {
506 { TRAMP_SENTINEL_INSN
, -1 }
508 am33_linux_sigframe_cache_init
511 /* Relevant struct definitions for signal handling...
513 From arch/mn10300/kernel/sigframe.h:
517 void (*pretcode)(void);
519 struct sigcontext *psc;
520 struct sigcontext sc;
521 struct fpucontext fpuctx;
522 unsigned long extramask[_NSIG_WORDS-1];
528 void (*pretcode)(void);
530 struct siginfo *pinfo;
534 struct fpucontext fpuctx;
538 From include/asm-mn10300/ucontext.h:
541 unsigned long uc_flags;
542 struct ucontext *uc_link;
544 struct sigcontext uc_mcontext;
548 From include/asm-mn10300/sigcontext.h:
551 unsigned long fs[32];
582 struct fpucontext *fpucontext;
583 unsigned long oldmask;
587 #define AM33_SIGCONTEXT_D0 0
588 #define AM33_SIGCONTEXT_D1 4
589 #define AM33_SIGCONTEXT_D2 8
590 #define AM33_SIGCONTEXT_D3 12
591 #define AM33_SIGCONTEXT_A0 16
592 #define AM33_SIGCONTEXT_A1 20
593 #define AM33_SIGCONTEXT_A2 24
594 #define AM33_SIGCONTEXT_A3 28
595 #define AM33_SIGCONTEXT_E0 32
596 #define AM33_SIGCONTEXT_E1 36
597 #define AM33_SIGCONTEXT_E2 40
598 #define AM33_SIGCONTEXT_E3 44
599 #define AM33_SIGCONTEXT_E4 48
600 #define AM33_SIGCONTEXT_E5 52
601 #define AM33_SIGCONTEXT_E6 56
602 #define AM33_SIGCONTEXT_E7 60
603 #define AM33_SIGCONTEXT_LAR 64
604 #define AM33_SIGCONTEXT_LIR 68
605 #define AM33_SIGCONTEXT_MDR 72
606 #define AM33_SIGCONTEXT_MCVF 76
607 #define AM33_SIGCONTEXT_MCRL 80
608 #define AM33_SIGCONTEXT_MCRH 84
609 #define AM33_SIGCONTEXT_MDRQ 88
610 #define AM33_SIGCONTEXT_SP 92
611 #define AM33_SIGCONTEXT_EPSW 96
612 #define AM33_SIGCONTEXT_PC 100
613 #define AM33_SIGCONTEXT_FPUCONTEXT 104
617 am33_linux_sigframe_cache_init (const struct tramp_frame
*self
,
618 struct frame_info
*next_frame
,
619 struct trad_frame_cache
*this_cache
,
622 CORE_ADDR sc_base
, fpubase
;
625 sc_base
= frame_unwind_register_unsigned (next_frame
, E_SP_REGNUM
);
626 if (self
== &am33_linux_sigframe
)
629 sc_base
= get_frame_memory_unsigned (next_frame
, sc_base
, 4);
634 sc_base
= get_frame_memory_unsigned (next_frame
, sc_base
, 4);
638 trad_frame_set_reg_addr (this_cache
, E_D0_REGNUM
,
639 sc_base
+ AM33_SIGCONTEXT_D0
);
640 trad_frame_set_reg_addr (this_cache
, E_D1_REGNUM
,
641 sc_base
+ AM33_SIGCONTEXT_D1
);
642 trad_frame_set_reg_addr (this_cache
, E_D2_REGNUM
,
643 sc_base
+ AM33_SIGCONTEXT_D2
);
644 trad_frame_set_reg_addr (this_cache
, E_D3_REGNUM
,
645 sc_base
+ AM33_SIGCONTEXT_D3
);
647 trad_frame_set_reg_addr (this_cache
, E_A0_REGNUM
,
648 sc_base
+ AM33_SIGCONTEXT_A0
);
649 trad_frame_set_reg_addr (this_cache
, E_A1_REGNUM
,
650 sc_base
+ AM33_SIGCONTEXT_A1
);
651 trad_frame_set_reg_addr (this_cache
, E_A2_REGNUM
,
652 sc_base
+ AM33_SIGCONTEXT_A2
);
653 trad_frame_set_reg_addr (this_cache
, E_A3_REGNUM
,
654 sc_base
+ AM33_SIGCONTEXT_A3
);
656 trad_frame_set_reg_addr (this_cache
, E_E0_REGNUM
,
657 sc_base
+ AM33_SIGCONTEXT_E0
);
658 trad_frame_set_reg_addr (this_cache
, E_E1_REGNUM
,
659 sc_base
+ AM33_SIGCONTEXT_E1
);
660 trad_frame_set_reg_addr (this_cache
, E_E2_REGNUM
,
661 sc_base
+ AM33_SIGCONTEXT_E2
);
662 trad_frame_set_reg_addr (this_cache
, E_E3_REGNUM
,
663 sc_base
+ AM33_SIGCONTEXT_E3
);
664 trad_frame_set_reg_addr (this_cache
, E_E4_REGNUM
,
665 sc_base
+ AM33_SIGCONTEXT_E4
);
666 trad_frame_set_reg_addr (this_cache
, E_E5_REGNUM
,
667 sc_base
+ AM33_SIGCONTEXT_E5
);
668 trad_frame_set_reg_addr (this_cache
, E_E6_REGNUM
,
669 sc_base
+ AM33_SIGCONTEXT_E6
);
670 trad_frame_set_reg_addr (this_cache
, E_E7_REGNUM
,
671 sc_base
+ AM33_SIGCONTEXT_E7
);
673 trad_frame_set_reg_addr (this_cache
, E_LAR_REGNUM
,
674 sc_base
+ AM33_SIGCONTEXT_LAR
);
675 trad_frame_set_reg_addr (this_cache
, E_LIR_REGNUM
,
676 sc_base
+ AM33_SIGCONTEXT_LIR
);
677 trad_frame_set_reg_addr (this_cache
, E_MDR_REGNUM
,
678 sc_base
+ AM33_SIGCONTEXT_MDR
);
679 trad_frame_set_reg_addr (this_cache
, E_MCVF_REGNUM
,
680 sc_base
+ AM33_SIGCONTEXT_MCVF
);
681 trad_frame_set_reg_addr (this_cache
, E_MCRL_REGNUM
,
682 sc_base
+ AM33_SIGCONTEXT_MCRL
);
683 trad_frame_set_reg_addr (this_cache
, E_MDRQ_REGNUM
,
684 sc_base
+ AM33_SIGCONTEXT_MDRQ
);
686 trad_frame_set_reg_addr (this_cache
, E_SP_REGNUM
,
687 sc_base
+ AM33_SIGCONTEXT_SP
);
688 trad_frame_set_reg_addr (this_cache
, E_PSW_REGNUM
,
689 sc_base
+ AM33_SIGCONTEXT_EPSW
);
690 trad_frame_set_reg_addr (this_cache
, E_PC_REGNUM
,
691 sc_base
+ AM33_SIGCONTEXT_PC
);
693 fpubase
= get_frame_memory_unsigned (next_frame
,
694 sc_base
+ AM33_SIGCONTEXT_FPUCONTEXT
, 4);
697 for (i
= 0; i
< 32; i
++)
699 trad_frame_set_reg_addr (this_cache
, E_FS0_REGNUM
+ i
,
702 trad_frame_set_reg_addr (this_cache
, E_FPCR_REGNUM
, fpubase
+ 4 * 32);
705 trad_frame_set_id (this_cache
, frame_id_build (sc_base
, func
));
708 /* AM33 GNU/Linux osabi has been recognized.
709 Now's our chance to register our corefile handling. */
712 am33_linux_init_osabi (struct gdbarch_info gdbinfo
, struct gdbarch
*gdbarch
)
714 set_gdbarch_regset_from_core_section (gdbarch
,
715 am33_regset_from_core_section
);
716 set_solib_svr4_fetch_link_map_offsets
717 (gdbarch
, svr4_ilp32_fetch_link_map_offsets
);
719 tramp_frame_prepend_unwinder (gdbarch
, &am33_linux_sigframe
);
720 tramp_frame_prepend_unwinder (gdbarch
, &am33_linux_rt_sigframe
);
724 _initialize_mn10300_linux_tdep (void)
726 gdbarch_register_osabi (bfd_arch_mn10300
, 0,
727 GDB_OSABI_LINUX
, am33_linux_init_osabi
);