1 /* Target-dependent code for Hitachi Super-H, for GDB.
2 Copyright 1993, 1994, 1995, 1996, 1997, 1998, 2000 Free Software
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
23 Contributed by Steve Chamberlain
37 #include "inferior.h" /* for BEFORE_TEXT_END etc. */
38 #include "gdb_string.h"
39 #include "arch-utils.h"
41 /* A set of original names, to be used when restoring back to generic
42 registers from a specific set. */
44 static char *sh_generic_reg_names
[] = {
45 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
46 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
47 "pc", "pr", "gbr", "vbr", "mach", "macl", "sr",
49 "fr0", "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7",
50 "fr8", "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15",
52 "r0b0", "r1b0", "r2b0", "r3b0", "r4b0", "r5b0", "r6b0", "r7b0",
53 "r0b1", "r1b1", "r2b1", "r3b1", "r4b1", "r5b1", "r6b1", "r7b1",
56 static char *sh_reg_names
[] = {
57 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
58 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
59 "pc", "pr", "gbr", "vbr", "mach", "macl", "sr",
61 "", "", "", "", "", "", "", "",
62 "", "", "", "", "", "", "", "",
64 "", "", "", "", "", "", "", "",
65 "", "", "", "", "", "", "", "",
68 static char *sh3_reg_names
[] = {
69 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
70 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
71 "pc", "pr", "gbr", "vbr", "mach", "macl", "sr",
73 "", "", "", "", "", "", "", "",
74 "", "", "", "", "", "", "", "",
76 "r0b0", "r1b0", "r2b0", "r3b0", "r4b0", "r5b0", "r6b0", "r7b0",
77 "r0b1", "r1b1", "r2b1", "r3b1", "r4b1", "r5b1", "r6b1", "r7b1"
80 static char *sh3e_reg_names
[] = {
81 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
82 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
83 "pc", "pr", "gbr", "vbr", "mach", "macl", "sr",
85 "fr0", "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7",
86 "fr8", "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15",
88 "r0b0", "r1b0", "r2b0", "r3b0", "r4b0", "r5b0", "r6b0", "r7b0",
89 "r0b1", "r1b1", "r2b1", "r3b1", "r4b1", "r5b1", "r6b1", "r7b1",
92 static char *sh_dsp_reg_names
[] = {
93 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
94 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
95 "pc", "pr", "gbr", "vbr", "mach", "macl", "sr",
97 "a0g", "a0", "a1g", "a1", "m0", "m1", "x0", "x1",
98 "y0", "y1", "", "", "", "", "", "mod",
100 "rs", "re", "", "", "", "", "", "",
101 "", "", "", "", "", "", "", "",
104 static char *sh3_dsp_reg_names
[] = {
105 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
106 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
107 "pc", "pr", "gbr", "vbr", "mach", "macl", "sr",
109 "a0g", "a0", "a1g", "a1", "m0", "m1", "x0", "x1",
110 "y0", "y1", "", "", "", "", "", "mod",
112 "rs", "re", "", "", "", "", "", "",
113 "r0b", "r1b", "r2b", "r3b", "r4b", "r5b", "r6b", "r7b",
118 char **sh_register_names
= sh3_reg_names
;
120 char **sh_register_names
= sh_generic_reg_names
;
128 sh_processor_type_table
[] =
131 sh_reg_names
, bfd_mach_sh
135 sh_reg_names
, bfd_mach_sh2
139 sh_dsp_reg_names
, bfd_mach_sh_dsp
143 sh3_reg_names
, bfd_mach_sh3
147 sh3_dsp_reg_names
, bfd_mach_sh3_dsp
151 sh3e_reg_names
, bfd_mach_sh3e
159 /* Prologue looks like
160 [mov.l <regs>,@-r15]...
166 #define IS_STS(x) ((x) == 0x4f22)
167 #define IS_PUSH(x) (((x) & 0xff0f) == 0x2f06)
168 #define GET_PUSHED_REG(x) (((x) >> 4) & 0xf)
169 #define IS_MOV_SP_FP(x) ((x) == 0x6ef3)
170 #define IS_ADD_SP(x) (((x) & 0xff00) == 0x7f00)
171 #define IS_MOV_R3(x) (((x) & 0xff00) == 0x1a00)
172 #define IS_SHLL_R3(x) ((x) == 0x4300)
173 #define IS_ADD_R3SP(x) ((x) == 0x3f3c)
174 #define IS_FMOV(x) (((x) & 0xf00f) == 0xf00b)
175 #define FPSCR_SZ (1 << 20)
178 /* Should call_function allocate stack space for a struct return? */
180 sh_use_struct_convention (gcc_p
, type
)
184 return (TYPE_LENGTH (type
) > 1);
188 /* Skip any prologue before the guts of a function */
191 sh_skip_prologue (start_pc
)
196 w
= read_memory_integer (start_pc
, 2);
207 w
= read_memory_integer (start_pc
, 2);
213 /* Disassemble an instruction. */
216 gdb_print_insn_sh (memaddr
, info
)
218 disassemble_info
*info
;
220 if (TARGET_BYTE_ORDER
== BIG_ENDIAN
)
221 return print_insn_sh (memaddr
, info
);
223 return print_insn_shl (memaddr
, info
);
226 /* Given a GDB frame, determine the address of the calling function's frame.
227 This will be used to create a new GDB frame struct, and then
228 INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame.
230 For us, the frame address is its stack pointer value, so we look up
231 the function prologue to determine the caller's sp value, and return it. */
234 sh_frame_chain (frame
)
235 struct frame_info
*frame
;
237 if (PC_IN_CALL_DUMMY (frame
->pc
, frame
->frame
, frame
->frame
))
238 return frame
->frame
; /* dummy frame same as caller's frame */
239 if (!inside_entry_file (frame
->pc
))
240 return read_memory_integer (FRAME_FP (frame
) + frame
->f_offset
, 4);
245 /* Find REGNUM on the stack. Otherwise, it's in an active register. One thing
246 we might want to do here is to check REGNUM against the clobber mask, and
247 somehow flag it as invalid if it isn't saved on the stack somewhere. This
248 would provide a graceful failure mode when trying to get the value of
249 caller-saves registers for an inner frame. */
252 sh_find_callers_reg (fi
, regnum
)
253 struct frame_info
*fi
;
256 struct frame_saved_regs fsr
;
258 for (; fi
; fi
= fi
->next
)
259 if (PC_IN_CALL_DUMMY (fi
->pc
, fi
->frame
, fi
->frame
))
260 /* When the caller requests PR from the dummy frame, we return PC because
261 that's where the previous routine appears to have done a call from. */
262 return generic_read_register_dummy (fi
->pc
, fi
->frame
, regnum
);
265 FRAME_FIND_SAVED_REGS (fi
, fsr
);
266 if (fsr
.regs
[regnum
] != 0)
267 return read_memory_integer (fsr
.regs
[regnum
],
268 REGISTER_RAW_SIZE (regnum
));
270 return read_register (regnum
);
273 /* Put here the code to store, into a struct frame_saved_regs, the
274 addresses of the saved registers of frame described by FRAME_INFO.
275 This includes special registers such as pc and fp saved in special
276 ways in the stack frame. sp is even more special: the address we
277 return for it IS the sp for the next frame. */
280 sh_frame_find_saved_regs (fi
, fsr
)
281 struct frame_info
*fi
;
282 struct frame_saved_regs
*fsr
;
292 char *dummy_regs
= generic_find_dummy_frame (fi
->pc
, fi
->frame
);
296 /* DANGER! This is ONLY going to work if the char buffer format of
297 the saved registers is byte-for-byte identical to the
298 CORE_ADDR regs[NUM_REGS] format used by struct frame_saved_regs! */
299 memcpy (&fsr
->regs
, dummy_regs
, sizeof (fsr
));
303 opc
= pc
= get_pc_function_start (fi
->pc
);
305 insn
= read_memory_integer (pc
, 2);
307 fi
->leaf_function
= 1;
310 for (rn
= 0; rn
< NUM_REGS
; rn
++)
315 /* Loop around examining the prologue insns until we find something
316 that does not appear to be part of the prologue. But give up
317 after 20 of them, since we're getting silly then. */
319 while (pc
< opc
+ 20 * 2)
321 /* See where the registers will be saved to */
325 rn
= GET_PUSHED_REG (insn
);
327 insn
= read_memory_integer (pc
, 2);
330 else if (IS_STS (insn
))
333 where
[PR_REGNUM
] = depth
;
334 insn
= read_memory_integer (pc
, 2);
335 /* If we're storing the pr then this isn't a leaf */
336 fi
->leaf_function
= 0;
339 else if (IS_MOV_R3 (insn
))
341 r3_val
= ((insn
& 0xff) ^ 0x80) - 0x80;
343 insn
= read_memory_integer (pc
, 2);
345 else if (IS_SHLL_R3 (insn
))
349 insn
= read_memory_integer (pc
, 2);
351 else if (IS_ADD_R3SP (insn
))
355 insn
= read_memory_integer (pc
, 2);
357 else if (IS_ADD_SP (insn
))
360 depth
-= ((insn
& 0xff) ^ 0x80) - 0x80;
361 insn
= read_memory_integer (pc
, 2);
363 else if (IS_FMOV (insn
))
366 insn
= read_memory_integer (pc
, 2);
367 if (read_register (FPSCR_REGNUM
) & FPSCR_SZ
)
380 /* Now we know how deep things are, we can work out their addresses */
382 for (rn
= 0; rn
< NUM_REGS
; rn
++)
389 fsr
->regs
[rn
] = fi
->frame
- where
[rn
] + depth
- 4;
399 fsr
->regs
[SP_REGNUM
] = read_memory_integer (fsr
->regs
[FP_REGNUM
], 4);
403 fsr
->regs
[SP_REGNUM
] = fi
->frame
- 4;
406 fi
->f_offset
= depth
- where
[FP_REGNUM
] - 4;
407 /* Work out the return pc - either from the saved pr or the pr
411 /* initialize the extra info saved in a FRAME */
414 sh_init_extra_frame_info (fromleaf
, fi
)
416 struct frame_info
*fi
;
418 struct frame_saved_regs fsr
;
421 fi
->pc
= FRAME_SAVED_PC (fi
->next
);
423 if (PC_IN_CALL_DUMMY (fi
->pc
, fi
->frame
, fi
->frame
))
425 /* We need to setup fi->frame here because run_stack_dummy gets it wrong
426 by assuming it's always FP. */
427 fi
->frame
= generic_read_register_dummy (fi
->pc
, fi
->frame
,
429 fi
->return_pc
= generic_read_register_dummy (fi
->pc
, fi
->frame
,
431 fi
->f_offset
= -(CALL_DUMMY_LENGTH
+ 4);
432 fi
->leaf_function
= 0;
437 FRAME_FIND_SAVED_REGS (fi
, fsr
);
438 fi
->return_pc
= sh_find_callers_reg (fi
, PR_REGNUM
);
442 /* Discard from the stack the innermost frame,
443 restoring all saved registers. */
448 register struct frame_info
*frame
= get_current_frame ();
449 register CORE_ADDR fp
;
451 struct frame_saved_regs fsr
;
453 if (PC_IN_CALL_DUMMY (frame
->pc
, frame
->frame
, frame
->frame
))
454 generic_pop_dummy_frame ();
457 fp
= FRAME_FP (frame
);
458 get_frame_saved_regs (frame
, &fsr
);
460 /* Copy regs from where they were saved in the frame */
461 for (regnum
= 0; regnum
< NUM_REGS
; regnum
++)
462 if (fsr
.regs
[regnum
])
463 write_register (regnum
, read_memory_integer (fsr
.regs
[regnum
], 4));
465 write_register (PC_REGNUM
, frame
->return_pc
);
466 write_register (SP_REGNUM
, fp
+ 4);
468 flush_cached_frames ();
471 /* Function: push_arguments
472 Setup the function arguments for calling a function in the inferior.
474 On the Hitachi SH architecture, there are four registers (R4 to R7)
475 which are dedicated for passing function arguments. Up to the first
476 four arguments (depending on size) may go into these registers.
477 The rest go on the stack.
479 Arguments that are smaller than 4 bytes will still take up a whole
480 register or a whole 32-bit word on the stack, and will be
481 right-justified in the register or the stack word. This includes
482 chars, shorts, and small aggregate types.
484 Arguments that are larger than 4 bytes may be split between two or
485 more registers. If there are not enough registers free, an argument
486 may be passed partly in a register (or registers), and partly on the
487 stack. This includes doubles, long longs, and larger aggregates.
488 As far as I know, there is no upper limit to the size of aggregates
489 that will be passed in this way; in other words, the convention of
490 passing a pointer to a large aggregate instead of a copy is not used.
492 An exceptional case exists for struct arguments (and possibly other
493 aggregates such as arrays) if the size is larger than 4 bytes but
494 not a multiple of 4 bytes. In this case the argument is never split
495 between the registers and the stack, but instead is copied in its
496 entirety onto the stack, AND also copied into as many registers as
497 there is room for. In other words, space in registers permitting,
498 two copies of the same argument are passed in. As far as I can tell,
499 only the one on the stack is used, although that may be a function
500 of the level of compiler optimization. I suspect this is a compiler
501 bug. Arguments of these odd sizes are left-justified within the
502 word (as opposed to arguments smaller than 4 bytes, which are
506 If the function is to return an aggregate type such as a struct, it
507 is either returned in the normal return value register R0 (if its
508 size is no greater than one byte), or else the caller must allocate
509 space into which the callee will copy the return value (if the size
510 is greater than one byte). In this case, a pointer to the return
511 value location is passed into the callee in register R2, which does
512 not displace any of the other arguments passed in via registers R4
516 sh_push_arguments (nargs
, args
, sp
, struct_return
, struct_addr
)
520 unsigned char struct_return
;
521 CORE_ADDR struct_addr
;
523 int stack_offset
, stack_alloc
;
531 int odd_sized_struct
;
533 /* first force sp to a 4-byte alignment */
536 /* The "struct return pointer" pseudo-argument has its own dedicated
539 write_register (STRUCT_RETURN_REGNUM
, struct_addr
);
541 /* Now make sure there's space on the stack */
542 for (argnum
= 0, stack_alloc
= 0;
543 argnum
< nargs
; argnum
++)
544 stack_alloc
+= ((TYPE_LENGTH (VALUE_TYPE (args
[argnum
])) + 3) & ~3);
545 sp
-= stack_alloc
; /* make room on stack for args */
548 /* Now load as many as possible of the first arguments into
549 registers, and push the rest onto the stack. There are 16 bytes
550 in four registers available. Loop thru args from first to last. */
552 argreg
= ARG0_REGNUM
;
553 for (argnum
= 0, stack_offset
= 0; argnum
< nargs
; argnum
++)
555 type
= VALUE_TYPE (args
[argnum
]);
556 len
= TYPE_LENGTH (type
);
557 memset (valbuf
, 0, sizeof (valbuf
));
559 { /* value gets right-justified in the register or stack word */
560 memcpy (valbuf
+ (4 - len
),
561 (char *) VALUE_CONTENTS (args
[argnum
]), len
);
565 val
= (char *) VALUE_CONTENTS (args
[argnum
]);
567 if (len
> 4 && (len
& 3) != 0)
568 odd_sized_struct
= 1; /* such structs go entirely on stack */
570 odd_sized_struct
= 0;
573 if (argreg
> ARGLAST_REGNUM
|| odd_sized_struct
)
574 { /* must go on the stack */
575 write_memory (sp
+ stack_offset
, val
, 4);
578 /* NOTE WELL!!!!! This is not an "else if" clause!!!
579 That's because some *&^%$ things get passed on the stack
580 AND in the registers! */
581 if (argreg
<= ARGLAST_REGNUM
)
582 { /* there's room in a register */
583 regval
= extract_address (val
, REGISTER_RAW_SIZE (argreg
));
584 write_register (argreg
++, regval
);
586 /* Store the value 4 bytes at a time. This means that things
587 larger than 4 bytes may go partly in registers and partly
589 len
-= REGISTER_RAW_SIZE (argreg
);
590 val
+= REGISTER_RAW_SIZE (argreg
);
596 /* Function: push_return_address (pc)
597 Set up the return address for the inferior function call.
598 Needed for targets where we don't actually execute a JSR/BSR instruction */
601 sh_push_return_address (pc
, sp
)
605 write_register (PR_REGNUM
, CALL_DUMMY_ADDRESS ());
609 /* Function: fix_call_dummy
610 Poke the callee function's address into the destination part of
611 the CALL_DUMMY. The address is actually stored in a data word
612 following the actualy CALL_DUMMY instructions, which will load
613 it into a register using PC-relative addressing. This function
614 expects the CALL_DUMMY to look like this:
625 sh_fix_call_dummy (dummy
, pc
, fun
, nargs
, args
, type
, gcc_p
)
634 *(unsigned long *) (dummy
+ 8) = fun
;
639 /* Modify the actual processor type. */
642 sh_target_architecture_hook (ap
)
643 const bfd_arch_info_type
*ap
;
647 if (ap
->arch
!= bfd_arch_sh
)
650 for (i
= 0; sh_processor_type_table
[i
].regnames
!= NULL
; i
++)
652 if (sh_processor_type_table
[i
].mach
== ap
->mach
)
654 sh_register_names
= sh_processor_type_table
[i
].regnames
;
659 internal_error ("Architecture `%s' unreconized", ap
->printable_name
);
662 /* Print the registers in a form similar to the E7000 */
665 sh_show_regs (args
, from_tty
)
670 if (TARGET_ARCHITECTURE
->arch
== bfd_arch_sh
)
671 cpu
= TARGET_ARCHITECTURE
->mach
;
675 printf_filtered ("PC=%s SR=%08lx PR=%08lx MACH=%08lx MACHL=%08lx\n",
676 paddr (read_register (PC_REGNUM
)),
677 (long) read_register (SR_REGNUM
),
678 (long) read_register (PR_REGNUM
),
679 (long) read_register (MACH_REGNUM
),
680 (long) read_register (MACL_REGNUM
));
682 printf_filtered ("GBR=%08lx VBR=%08lx",
683 (long) read_register (GBR_REGNUM
),
684 (long) read_register (VBR_REGNUM
));
685 if (cpu
== bfd_mach_sh3
|| cpu
== bfd_mach_sh3e
|| cpu
== bfd_mach_sh3_dsp
686 || cpu
== bfd_mach_sh4
)
688 printf_filtered (" SSR=%08lx SPC=%08lx",
689 (long) read_register (SSR_REGNUM
),
690 (long) read_register (SPC_REGNUM
));
691 if (cpu
== bfd_mach_sh3e
|| cpu
== bfd_mach_sh4
)
693 printf_filtered (" FPUL=%08lx FPSCR=%08lx",
694 (long) read_register (FPUL_REGNUM
),
695 (long) read_register (FPSCR_REGNUM
));
698 if (cpu
== bfd_mach_sh_dsp
|| cpu
== bfd_mach_sh3_dsp
)
699 printf_filtered (" DSR=%08lx", (long) read_register (DSR_REGNUM
));
701 printf_filtered ("\nR0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
702 (long) read_register (0),
703 (long) read_register (1),
704 (long) read_register (2),
705 (long) read_register (3),
706 (long) read_register (4),
707 (long) read_register (5),
708 (long) read_register (6),
709 (long) read_register (7));
710 printf_filtered ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
711 (long) read_register (8),
712 (long) read_register (9),
713 (long) read_register (10),
714 (long) read_register (11),
715 (long) read_register (12),
716 (long) read_register (13),
717 (long) read_register (14),
718 (long) read_register (15));
719 if (cpu
== bfd_mach_sh3e
|| cpu
== bfd_mach_sh4
)
721 int pr
= cpu
== bfd_mach_sh4
&& (read_register (FPSCR_REGNUM
) & 0x80000);
724 ? "DR0-DR6 %08lx%08lx %08lx%08lx %08lx%08lx %08lx%08lx\n"
725 : "FP0-FP7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n"),
726 (long) read_register (FP0_REGNUM
+ 0),
727 (long) read_register (FP0_REGNUM
+ 1),
728 (long) read_register (FP0_REGNUM
+ 2),
729 (long) read_register (FP0_REGNUM
+ 3),
730 (long) read_register (FP0_REGNUM
+ 4),
731 (long) read_register (FP0_REGNUM
+ 5),
732 (long) read_register (FP0_REGNUM
+ 6),
733 (long) read_register (FP0_REGNUM
+ 7));
735 ? "DR8-DR14 %08lx%08lx %08lx%08lx %08lx%08lx %08lx%08lx\n"
736 : "FP8-FP15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n"),
737 (long) read_register (FP0_REGNUM
+ 8),
738 (long) read_register (FP0_REGNUM
+ 9),
739 (long) read_register (FP0_REGNUM
+ 10),
740 (long) read_register (FP0_REGNUM
+ 11),
741 (long) read_register (FP0_REGNUM
+ 12),
742 (long) read_register (FP0_REGNUM
+ 13),
743 (long) read_register (FP0_REGNUM
+ 14),
744 (long) read_register (FP0_REGNUM
+ 15));
746 /* FIXME: sh4 has more registers */
747 if (cpu
== bfd_mach_sh_dsp
|| cpu
== bfd_mach_sh3_dsp
)
749 printf_filtered ("A0G=%02lx A0=%08lx M0=%08lx X0=%08lx Y0=%08lx RS=%08lx MOD=%08lx\n",
750 (long) read_register (A0G_REGNUM
) & 0xff,
751 (long) read_register (A0_REGNUM
),
752 (long) read_register (M0_REGNUM
),
753 (long) read_register (X0_REGNUM
),
754 (long) read_register (Y0_REGNUM
),
755 (long) read_register (RS_REGNUM
),
756 (long) read_register (MOD_REGNUM
));
757 printf_filtered ("A1G=%02lx A1=%08lx M1=%08lx X1=%08lx Y1=%08lx RE=%08lx\n",
758 (long) read_register (A1G_REGNUM
) & 0xff,
759 (long) read_register (A1_REGNUM
),
760 (long) read_register (M1_REGNUM
),
761 (long) read_register (X1_REGNUM
),
762 (long) read_register (Y1_REGNUM
),
763 (long) read_register (RE_REGNUM
));
767 /* Function: extract_return_value
768 Find a function's return value in the appropriate registers (in regbuf),
769 and copy it into valbuf. */
772 sh_extract_return_value (type
, regbuf
, valbuf
)
777 int len
= TYPE_LENGTH (type
);
780 memcpy (valbuf
, ((char *) regbuf
) + 4 - len
, len
);
782 memcpy (valbuf
, ((char *) regbuf
) + 8 - len
, len
);
784 error ("bad size for return value");
788 _initialize_sh_tdep ()
790 struct cmd_list_element
*c
;
792 tm_print_insn
= gdb_print_insn_sh
;
794 target_architecture_hook
= sh_target_architecture_hook
;
796 add_com ("regs", class_vars
, sh_show_regs
, "Print all registers");