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
)
199 for (here
= start_pc
, end
= start_pc
+ (2 * 28); here
< end
;)
201 int w
= read_memory_integer (here
, 2);
203 if (IS_FMOV (w
) || IS_PUSH (w
) || IS_STS (w
) || IS_MOV_R3 (w
)
204 || IS_ADD_R3SP (w
) || IS_ADD_SP (w
) || IS_SHLL_R3 (w
))
207 if (IS_MOV_SP_FP (w
))
217 /* Disassemble an instruction. */
220 gdb_print_insn_sh (memaddr
, info
)
222 disassemble_info
*info
;
224 if (TARGET_BYTE_ORDER
== BIG_ENDIAN
)
225 return print_insn_sh (memaddr
, info
);
227 return print_insn_shl (memaddr
, info
);
230 /* Given a GDB frame, determine the address of the calling function's frame.
231 This will be used to create a new GDB frame struct, and then
232 INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame.
234 For us, the frame address is its stack pointer value, so we look up
235 the function prologue to determine the caller's sp value, and return it. */
238 sh_frame_chain (frame
)
239 struct frame_info
*frame
;
241 if (PC_IN_CALL_DUMMY (frame
->pc
, frame
->frame
, frame
->frame
))
242 return frame
->frame
; /* dummy frame same as caller's frame */
243 if (frame
->pc
&& !inside_entry_file (frame
->pc
))
244 return read_memory_integer (FRAME_FP (frame
) + frame
->f_offset
, 4);
249 /* Find REGNUM on the stack. Otherwise, it's in an active register. One thing
250 we might want to do here is to check REGNUM against the clobber mask, and
251 somehow flag it as invalid if it isn't saved on the stack somewhere. This
252 would provide a graceful failure mode when trying to get the value of
253 caller-saves registers for an inner frame. */
256 sh_find_callers_reg (fi
, regnum
)
257 struct frame_info
*fi
;
260 struct frame_saved_regs fsr
;
262 for (; fi
; fi
= fi
->next
)
263 if (PC_IN_CALL_DUMMY (fi
->pc
, fi
->frame
, fi
->frame
))
264 /* When the caller requests PR from the dummy frame, we return PC because
265 that's where the previous routine appears to have done a call from. */
266 return generic_read_register_dummy (fi
->pc
, fi
->frame
, regnum
);
269 FRAME_FIND_SAVED_REGS (fi
, fsr
);
272 if (fsr
.regs
[regnum
] != 0)
273 return read_memory_integer (fsr
.regs
[regnum
],
274 REGISTER_RAW_SIZE (regnum
));
276 return read_register (regnum
);
279 /* Put here the code to store, into a struct frame_saved_regs, the
280 addresses of the saved registers of frame described by FRAME_INFO.
281 This includes special registers such as pc and fp saved in special
282 ways in the stack frame. sp is even more special: the address we
283 return for it IS the sp for the next frame. */
286 sh_frame_find_saved_regs (fi
, fsr
)
287 struct frame_info
*fi
;
288 struct frame_saved_regs
*fsr
;
298 char *dummy_regs
= generic_find_dummy_frame (fi
->pc
, fi
->frame
);
302 /* DANGER! This is ONLY going to work if the char buffer format of
303 the saved registers is byte-for-byte identical to the
304 CORE_ADDR regs[NUM_REGS] format used by struct frame_saved_regs! */
305 memcpy (&fsr
->regs
, dummy_regs
, sizeof (fsr
));
309 fi
->leaf_function
= 1;
312 for (rn
= 0; rn
< NUM_REGS
; rn
++)
317 /* Loop around examining the prologue insns until we find something
318 that does not appear to be part of the prologue. But give up
319 after 20 of them, since we're getting silly then. */
321 pc
= get_pc_function_start (fi
->pc
);
328 for (opc
= pc
+ (2 * 28); pc
< opc
; pc
+= 2)
330 insn
= read_memory_integer (pc
, 2);
331 /* See where the registers will be saved to */
334 rn
= GET_PUSHED_REG (insn
);
338 else if (IS_STS (insn
))
340 where
[PR_REGNUM
] = depth
;
341 /* If we're storing the pr then this isn't a leaf */
342 fi
->leaf_function
= 0;
345 else if (IS_MOV_R3 (insn
))
347 r3_val
= ((insn
& 0xff) ^ 0x80) - 0x80;
349 else if (IS_SHLL_R3 (insn
))
353 else if (IS_ADD_R3SP (insn
))
357 else if (IS_ADD_SP (insn
))
359 depth
-= ((insn
& 0xff) ^ 0x80) - 0x80;
361 else if (IS_FMOV (insn
))
363 if (read_register (FPSCR_REGNUM
) & FPSCR_SZ
)
372 else if (IS_MOV_SP_FP (insn
))
374 #if 0 /* This used to just stop when it found an instruction that
375 was not considered part of the prologue. Now, we just
376 keep going looking for likely instructions. */
382 /* Now we know how deep things are, we can work out their addresses */
384 for (rn
= 0; rn
< NUM_REGS
; rn
++)
391 fsr
->regs
[rn
] = fi
->frame
- where
[rn
] + depth
- 4;
401 fsr
->regs
[SP_REGNUM
] = read_memory_integer (fsr
->regs
[FP_REGNUM
], 4);
405 fsr
->regs
[SP_REGNUM
] = fi
->frame
- 4;
408 fi
->f_offset
= depth
- where
[FP_REGNUM
] - 4;
409 /* Work out the return pc - either from the saved pr or the pr
413 /* initialize the extra info saved in a FRAME */
416 sh_init_extra_frame_info (fromleaf
, fi
)
418 struct frame_info
*fi
;
420 struct frame_saved_regs fsr
;
423 fi
->pc
= FRAME_SAVED_PC (fi
->next
);
425 if (PC_IN_CALL_DUMMY (fi
->pc
, fi
->frame
, fi
->frame
))
427 /* We need to setup fi->frame here because run_stack_dummy gets it wrong
428 by assuming it's always FP. */
429 fi
->frame
= generic_read_register_dummy (fi
->pc
, fi
->frame
,
431 fi
->return_pc
= generic_read_register_dummy (fi
->pc
, fi
->frame
,
433 fi
->f_offset
= -(CALL_DUMMY_LENGTH
+ 4);
434 fi
->leaf_function
= 0;
439 FRAME_FIND_SAVED_REGS (fi
, fsr
);
440 fi
->return_pc
= sh_find_callers_reg (fi
, PR_REGNUM
);
444 /* Discard from the stack the innermost frame,
445 restoring all saved registers. */
450 register struct frame_info
*frame
= get_current_frame ();
451 register CORE_ADDR fp
;
453 struct frame_saved_regs fsr
;
455 if (PC_IN_CALL_DUMMY (frame
->pc
, frame
->frame
, frame
->frame
))
456 generic_pop_dummy_frame ();
459 fp
= FRAME_FP (frame
);
460 get_frame_saved_regs (frame
, &fsr
);
462 /* Copy regs from where they were saved in the frame */
463 for (regnum
= 0; regnum
< NUM_REGS
; regnum
++)
464 if (fsr
.regs
[regnum
])
465 write_register (regnum
, read_memory_integer (fsr
.regs
[regnum
], 4));
467 write_register (PC_REGNUM
, frame
->return_pc
);
468 write_register (SP_REGNUM
, fp
+ 4);
470 flush_cached_frames ();
473 /* Function: push_arguments
474 Setup the function arguments for calling a function in the inferior.
476 On the Hitachi SH architecture, there are four registers (R4 to R7)
477 which are dedicated for passing function arguments. Up to the first
478 four arguments (depending on size) may go into these registers.
479 The rest go on the stack.
481 Arguments that are smaller than 4 bytes will still take up a whole
482 register or a whole 32-bit word on the stack, and will be
483 right-justified in the register or the stack word. This includes
484 chars, shorts, and small aggregate types.
486 Arguments that are larger than 4 bytes may be split between two or
487 more registers. If there are not enough registers free, an argument
488 may be passed partly in a register (or registers), and partly on the
489 stack. This includes doubles, long longs, and larger aggregates.
490 As far as I know, there is no upper limit to the size of aggregates
491 that will be passed in this way; in other words, the convention of
492 passing a pointer to a large aggregate instead of a copy is not used.
494 An exceptional case exists for struct arguments (and possibly other
495 aggregates such as arrays) if the size is larger than 4 bytes but
496 not a multiple of 4 bytes. In this case the argument is never split
497 between the registers and the stack, but instead is copied in its
498 entirety onto the stack, AND also copied into as many registers as
499 there is room for. In other words, space in registers permitting,
500 two copies of the same argument are passed in. As far as I can tell,
501 only the one on the stack is used, although that may be a function
502 of the level of compiler optimization. I suspect this is a compiler
503 bug. Arguments of these odd sizes are left-justified within the
504 word (as opposed to arguments smaller than 4 bytes, which are
508 If the function is to return an aggregate type such as a struct, it
509 is either returned in the normal return value register R0 (if its
510 size is no greater than one byte), or else the caller must allocate
511 space into which the callee will copy the return value (if the size
512 is greater than one byte). In this case, a pointer to the return
513 value location is passed into the callee in register R2, which does
514 not displace any of the other arguments passed in via registers R4
518 sh_push_arguments (nargs
, args
, sp
, struct_return
, struct_addr
)
522 unsigned char struct_return
;
523 CORE_ADDR struct_addr
;
525 int stack_offset
, stack_alloc
;
533 int odd_sized_struct
;
535 /* first force sp to a 4-byte alignment */
538 /* The "struct return pointer" pseudo-argument has its own dedicated
541 write_register (STRUCT_RETURN_REGNUM
, struct_addr
);
543 /* Now make sure there's space on the stack */
544 for (argnum
= 0, stack_alloc
= 0;
545 argnum
< nargs
; argnum
++)
546 stack_alloc
+= ((TYPE_LENGTH (VALUE_TYPE (args
[argnum
])) + 3) & ~3);
547 sp
-= stack_alloc
; /* make room on stack for args */
550 /* Now load as many as possible of the first arguments into
551 registers, and push the rest onto the stack. There are 16 bytes
552 in four registers available. Loop thru args from first to last. */
554 argreg
= ARG0_REGNUM
;
555 for (argnum
= 0, stack_offset
= 0; argnum
< nargs
; argnum
++)
557 type
= VALUE_TYPE (args
[argnum
]);
558 len
= TYPE_LENGTH (type
);
559 memset (valbuf
, 0, sizeof (valbuf
));
561 { /* value gets right-justified in the register or stack word */
562 memcpy (valbuf
+ (4 - len
),
563 (char *) VALUE_CONTENTS (args
[argnum
]), len
);
567 val
= (char *) VALUE_CONTENTS (args
[argnum
]);
569 if (len
> 4 && (len
& 3) != 0)
570 odd_sized_struct
= 1; /* such structs go entirely on stack */
572 odd_sized_struct
= 0;
575 if (argreg
> ARGLAST_REGNUM
|| odd_sized_struct
)
576 { /* must go on the stack */
577 write_memory (sp
+ stack_offset
, val
, 4);
580 /* NOTE WELL!!!!! This is not an "else if" clause!!!
581 That's because some *&^%$ things get passed on the stack
582 AND in the registers! */
583 if (argreg
<= ARGLAST_REGNUM
)
584 { /* there's room in a register */
585 regval
= extract_address (val
, REGISTER_RAW_SIZE (argreg
));
586 write_register (argreg
++, regval
);
588 /* Store the value 4 bytes at a time. This means that things
589 larger than 4 bytes may go partly in registers and partly
591 len
-= REGISTER_RAW_SIZE (argreg
);
592 val
+= REGISTER_RAW_SIZE (argreg
);
598 /* Function: push_return_address (pc)
599 Set up the return address for the inferior function call.
600 Needed for targets where we don't actually execute a JSR/BSR instruction */
603 sh_push_return_address (pc
, sp
)
607 write_register (PR_REGNUM
, CALL_DUMMY_ADDRESS ());
611 /* Function: fix_call_dummy
612 Poke the callee function's address into the destination part of
613 the CALL_DUMMY. The address is actually stored in a data word
614 following the actualy CALL_DUMMY instructions, which will load
615 it into a register using PC-relative addressing. This function
616 expects the CALL_DUMMY to look like this:
627 sh_fix_call_dummy (dummy
, pc
, fun
, nargs
, args
, type
, gcc_p
)
636 *(unsigned long *) (dummy
+ 8) = fun
;
641 /* Modify the actual processor type. */
644 sh_target_architecture_hook (ap
)
645 const bfd_arch_info_type
*ap
;
649 if (ap
->arch
!= bfd_arch_sh
)
652 for (i
= 0; sh_processor_type_table
[i
].regnames
!= NULL
; i
++)
654 if (sh_processor_type_table
[i
].mach
== ap
->mach
)
656 sh_register_names
= sh_processor_type_table
[i
].regnames
;
661 internal_error ("Architecture `%s' unreconized", ap
->printable_name
);
664 /* Print the registers in a form similar to the E7000 */
667 sh_show_regs (args
, from_tty
)
672 if (TARGET_ARCHITECTURE
->arch
== bfd_arch_sh
)
673 cpu
= TARGET_ARCHITECTURE
->mach
;
677 printf_filtered ("PC=%s SR=%08lx PR=%08lx MACH=%08lx MACHL=%08lx\n",
678 paddr (read_register (PC_REGNUM
)),
679 (long) read_register (SR_REGNUM
),
680 (long) read_register (PR_REGNUM
),
681 (long) read_register (MACH_REGNUM
),
682 (long) read_register (MACL_REGNUM
));
684 printf_filtered ("GBR=%08lx VBR=%08lx",
685 (long) read_register (GBR_REGNUM
),
686 (long) read_register (VBR_REGNUM
));
687 if (cpu
== bfd_mach_sh3
|| cpu
== bfd_mach_sh3e
|| cpu
== bfd_mach_sh3_dsp
688 || cpu
== bfd_mach_sh4
)
690 printf_filtered (" SSR=%08lx SPC=%08lx",
691 (long) read_register (SSR_REGNUM
),
692 (long) read_register (SPC_REGNUM
));
693 if (cpu
== bfd_mach_sh3e
|| cpu
== bfd_mach_sh4
)
695 printf_filtered (" FPUL=%08lx FPSCR=%08lx",
696 (long) read_register (FPUL_REGNUM
),
697 (long) read_register (FPSCR_REGNUM
));
700 if (cpu
== bfd_mach_sh_dsp
|| cpu
== bfd_mach_sh3_dsp
)
701 printf_filtered (" DSR=%08lx", (long) read_register (DSR_REGNUM
));
703 printf_filtered ("\nR0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
704 (long) read_register (0),
705 (long) read_register (1),
706 (long) read_register (2),
707 (long) read_register (3),
708 (long) read_register (4),
709 (long) read_register (5),
710 (long) read_register (6),
711 (long) read_register (7));
712 printf_filtered ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
713 (long) read_register (8),
714 (long) read_register (9),
715 (long) read_register (10),
716 (long) read_register (11),
717 (long) read_register (12),
718 (long) read_register (13),
719 (long) read_register (14),
720 (long) read_register (15));
721 if (cpu
== bfd_mach_sh3e
|| cpu
== bfd_mach_sh4
)
723 int pr
= cpu
== bfd_mach_sh4
&& (read_register (FPSCR_REGNUM
) & 0x80000);
726 ? "DR0-DR6 %08lx%08lx %08lx%08lx %08lx%08lx %08lx%08lx\n"
727 : "FP0-FP7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n"),
728 (long) read_register (FP0_REGNUM
+ 0),
729 (long) read_register (FP0_REGNUM
+ 1),
730 (long) read_register (FP0_REGNUM
+ 2),
731 (long) read_register (FP0_REGNUM
+ 3),
732 (long) read_register (FP0_REGNUM
+ 4),
733 (long) read_register (FP0_REGNUM
+ 5),
734 (long) read_register (FP0_REGNUM
+ 6),
735 (long) read_register (FP0_REGNUM
+ 7));
737 ? "DR8-DR14 %08lx%08lx %08lx%08lx %08lx%08lx %08lx%08lx\n"
738 : "FP8-FP15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n"),
739 (long) read_register (FP0_REGNUM
+ 8),
740 (long) read_register (FP0_REGNUM
+ 9),
741 (long) read_register (FP0_REGNUM
+ 10),
742 (long) read_register (FP0_REGNUM
+ 11),
743 (long) read_register (FP0_REGNUM
+ 12),
744 (long) read_register (FP0_REGNUM
+ 13),
745 (long) read_register (FP0_REGNUM
+ 14),
746 (long) read_register (FP0_REGNUM
+ 15));
748 /* FIXME: sh4 has more registers */
749 if (cpu
== bfd_mach_sh_dsp
|| cpu
== bfd_mach_sh3_dsp
)
751 printf_filtered ("A0G=%02lx A0=%08lx M0=%08lx X0=%08lx Y0=%08lx RS=%08lx MOD=%08lx\n",
752 (long) read_register (A0G_REGNUM
) & 0xff,
753 (long) read_register (A0_REGNUM
),
754 (long) read_register (M0_REGNUM
),
755 (long) read_register (X0_REGNUM
),
756 (long) read_register (Y0_REGNUM
),
757 (long) read_register (RS_REGNUM
),
758 (long) read_register (MOD_REGNUM
));
759 printf_filtered ("A1G=%02lx A1=%08lx M1=%08lx X1=%08lx Y1=%08lx RE=%08lx\n",
760 (long) read_register (A1G_REGNUM
) & 0xff,
761 (long) read_register (A1_REGNUM
),
762 (long) read_register (M1_REGNUM
),
763 (long) read_register (X1_REGNUM
),
764 (long) read_register (Y1_REGNUM
),
765 (long) read_register (RE_REGNUM
));
769 /* Function: extract_return_value
770 Find a function's return value in the appropriate registers (in regbuf),
771 and copy it into valbuf. */
774 sh_extract_return_value (type
, regbuf
, valbuf
)
779 int len
= TYPE_LENGTH (type
);
782 memcpy (valbuf
, ((char *) regbuf
) + 4 - len
, len
);
784 memcpy (valbuf
, ((char *) regbuf
) + 8 - len
, len
);
786 error ("bad size for return value");
790 _initialize_sh_tdep ()
792 struct cmd_list_element
*c
;
794 tm_print_insn
= gdb_print_insn_sh
;
796 target_architecture_hook
= sh_target_architecture_hook
;
798 add_com ("regs", class_vars
, sh_show_regs
, "Print all registers");