1 // OBSOLETE /* Target-dependent code for Hitachi H8/500, for GDB.
3 // OBSOLETE Copyright 1993, 1994, 1995, 1998, 2000, 2001, 2002 Free Software
4 // OBSOLETE Foundation, Inc.
6 // OBSOLETE This file is part of GDB.
8 // OBSOLETE This program is free software; you can redistribute it and/or modify
9 // OBSOLETE it under the terms of the GNU General Public License as published by
10 // OBSOLETE the Free Software Foundation; either version 2 of the License, or
11 // OBSOLETE (at your option) any later version.
13 // OBSOLETE This program is distributed in the hope that it will be useful,
14 // OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // OBSOLETE GNU General Public License for more details.
18 // OBSOLETE You should have received a copy of the GNU General Public License
19 // OBSOLETE along with this program; if not, write to the Free Software
20 // OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330,
21 // OBSOLETE Boston, MA 02111-1307, USA. */
24 // OBSOLETE Contributed by Steve Chamberlain
25 // OBSOLETE sac@cygnus.com
28 // OBSOLETE #include "defs.h"
29 // OBSOLETE #include "frame.h"
30 // OBSOLETE #include "symtab.h"
31 // OBSOLETE #include "gdbtypes.h"
32 // OBSOLETE #include "gdbcmd.h"
33 // OBSOLETE #include "value.h"
34 // OBSOLETE #include "dis-asm.h"
35 // OBSOLETE #include "gdbcore.h"
36 // OBSOLETE #include "regcache.h"
38 // OBSOLETE #define UNSIGNED_SHORT(X) ((X) & 0xffff)
40 // OBSOLETE static int code_size = 2;
42 // OBSOLETE static int data_size = 2;
44 // OBSOLETE /* Shape of an H8/500 frame :
50 // OBSOLETE return address <2 or 4 bytes>
51 // OBSOLETE old fp <2 bytes>
55 // OBSOLETE saved registers
59 // OBSOLETE /* an easy to debug H8 stack frame looks like:
60 // OBSOLETE 0x6df6 push r6
61 // OBSOLETE 0x0d76 mov.w r7,r6
62 // OBSOLETE 0x6dfn push reg
63 // OBSOLETE 0x7905 nnnn mov.w #n,r5 or 0x1b87 subs #2,sp
64 // OBSOLETE 0x1957 sub.w r5,sp
68 // OBSOLETE #define IS_PUSH(x) (((x) & 0xff00)==0x6d00)
69 // OBSOLETE #define IS_LINK_8(x) ((x) == 0x17)
70 // OBSOLETE #define IS_LINK_16(x) ((x) == 0x1f)
71 // OBSOLETE #define IS_MOVE_FP(x) ((x) == 0x0d76)
72 // OBSOLETE #define IS_MOV_SP_FP(x) ((x) == 0x0d76)
73 // OBSOLETE #define IS_SUB2_SP(x) ((x) == 0x1b87)
74 // OBSOLETE #define IS_MOVK_R5(x) ((x) == 0x7905)
75 // OBSOLETE #define IS_SUB_R5SP(x) ((x) == 0x1957)
77 // OBSOLETE #define LINK_8 0x17
78 // OBSOLETE #define LINK_16 0x1f
80 // OBSOLETE int minimum_mode = 1;
83 // OBSOLETE h8500_skip_prologue (CORE_ADDR start_pc)
85 // OBSOLETE short int w;
87 // OBSOLETE w = read_memory_integer (start_pc, 1);
88 // OBSOLETE if (w == LINK_8)
90 // OBSOLETE start_pc += 2;
91 // OBSOLETE w = read_memory_integer (start_pc, 1);
94 // OBSOLETE if (w == LINK_16)
96 // OBSOLETE start_pc += 3;
97 // OBSOLETE w = read_memory_integer (start_pc, 2);
100 // OBSOLETE return start_pc;
103 // OBSOLETE CORE_ADDR
104 // OBSOLETE h8500_addr_bits_remove (CORE_ADDR addr)
106 // OBSOLETE return ((addr) & 0xffffff);
109 // OBSOLETE /* Given a GDB frame, determine the address of the calling function's
110 // OBSOLETE frame. This will be used to create a new GDB frame struct, and
111 // OBSOLETE then INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC will be
112 // OBSOLETE called for the new frame.
114 // OBSOLETE For us, the frame address is its stack pointer value, so we look up
115 // OBSOLETE the function prologue to determine the caller's sp value, and return it. */
117 // OBSOLETE CORE_ADDR
118 // OBSOLETE h8500_frame_chain (struct frame_info *thisframe)
120 // OBSOLETE if (!inside_entry_file (thisframe->pc))
121 // OBSOLETE return (read_memory_integer (get_frame_base (thisframe), PTR_SIZE));
123 // OBSOLETE return 0;
126 // OBSOLETE /* Fetch the instruction at ADDR, returning 0 if ADDR is beyond LIM or
127 // OBSOLETE is not the address of a valid instruction, the address of the next
128 // OBSOLETE instruction beyond ADDR otherwise. *PWORD1 receives the first word
129 // OBSOLETE of the instruction. */
131 // OBSOLETE CORE_ADDR
132 // OBSOLETE NEXT_PROLOGUE_INSN (CORE_ADDR addr, CORE_ADDR lim, char *pword1)
134 // OBSOLETE if (addr < lim + 8)
136 // OBSOLETE read_memory (addr, pword1, 1);
137 // OBSOLETE read_memory (addr, pword1 + 1, 1);
138 // OBSOLETE return 1;
140 // OBSOLETE return 0;
143 // OBSOLETE /* Examine the prologue of a function. `ip' points to the first
144 // OBSOLETE instruction. `limit' is the limit of the prologue (e.g. the addr
145 // OBSOLETE of the first linenumber, or perhaps the program counter if we're
146 // OBSOLETE stepping through). `frame_sp' is the stack pointer value in use in
147 // OBSOLETE this frame. `fsr' is a pointer to a frame_saved_regs structure
148 // OBSOLETE into which we put info about the registers saved by this frame.
149 // OBSOLETE `fi' is a struct frame_info pointer; we fill in various fields in
150 // OBSOLETE it to reflect the offsets of the arg pointer and the locals
151 // OBSOLETE pointer. */
153 // OBSOLETE /* Return the saved PC from this frame. */
155 // OBSOLETE CORE_ADDR
156 // OBSOLETE frame_saved_pc (struct frame_info *frame)
158 // OBSOLETE return read_memory_integer (get_frame_base (frame) + 2, PTR_SIZE);
162 // OBSOLETE h8500_pop_frame (void)
164 // OBSOLETE unsigned regnum;
165 // OBSOLETE struct frame_saved_regs fsr;
166 // OBSOLETE struct frame_info *frame = get_current_frame ();
168 // OBSOLETE deprecated_get_frame_saved_regs (frame, &fsr);
170 // OBSOLETE for (regnum = 0; regnum < 8; regnum++)
172 // OBSOLETE if (fsr.regs[regnum])
173 // OBSOLETE write_register (regnum, read_memory_short (fsr.regs[regnum]));
175 // OBSOLETE flush_cached_frames ();
179 // OBSOLETE static void
180 // OBSOLETE h8500_print_register_hook (int regno)
182 // OBSOLETE if (regno == CCR_REGNUM)
184 // OBSOLETE /* CCR register */
186 // OBSOLETE int C, Z, N, V;
187 // OBSOLETE unsigned char b[2];
188 // OBSOLETE unsigned char l;
190 // OBSOLETE frame_register_read (deprecated_selected_frame, regno, b);
191 // OBSOLETE l = b[1];
192 // OBSOLETE printf_unfiltered ("\t");
193 // OBSOLETE printf_unfiltered ("I-%d - ", (l & 0x80) != 0);
194 // OBSOLETE N = (l & 0x8) != 0;
195 // OBSOLETE Z = (l & 0x4) != 0;
196 // OBSOLETE V = (l & 0x2) != 0;
197 // OBSOLETE C = (l & 0x1) != 0;
198 // OBSOLETE printf_unfiltered ("N-%d ", N);
199 // OBSOLETE printf_unfiltered ("Z-%d ", Z);
200 // OBSOLETE printf_unfiltered ("V-%d ", V);
201 // OBSOLETE printf_unfiltered ("C-%d ", C);
202 // OBSOLETE if ((C | Z) == 0)
203 // OBSOLETE printf_unfiltered ("u> ");
204 // OBSOLETE if ((C | Z) == 1)
205 // OBSOLETE printf_unfiltered ("u<= ");
206 // OBSOLETE if ((C == 0))
207 // OBSOLETE printf_unfiltered ("u>= ");
208 // OBSOLETE if (C == 1)
209 // OBSOLETE printf_unfiltered ("u< ");
210 // OBSOLETE if (Z == 0)
211 // OBSOLETE printf_unfiltered ("!= ");
212 // OBSOLETE if (Z == 1)
213 // OBSOLETE printf_unfiltered ("== ");
214 // OBSOLETE if ((N ^ V) == 0)
215 // OBSOLETE printf_unfiltered (">= ");
216 // OBSOLETE if ((N ^ V) == 1)
217 // OBSOLETE printf_unfiltered ("< ");
218 // OBSOLETE if ((Z | (N ^ V)) == 0)
219 // OBSOLETE printf_unfiltered ("> ");
220 // OBSOLETE if ((Z | (N ^ V)) == 1)
221 // OBSOLETE printf_unfiltered ("<= ");
225 // OBSOLETE static void
226 // OBSOLETE h8500_print_registers_info (struct gdbarch *gdbarch,
227 // OBSOLETE struct ui_file *file,
228 // OBSOLETE struct frame_info *frame,
229 // OBSOLETE int regnum, int print_all)
232 // OBSOLETE const int numregs = NUM_REGS + NUM_PSEUDO_REGS;
233 // OBSOLETE char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
234 // OBSOLETE char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE);
236 // OBSOLETE for (i = 0; i < numregs; i++)
238 // OBSOLETE /* Decide between printing all regs, non-float / vector regs, or
239 // OBSOLETE specific reg. */
240 // OBSOLETE if (regnum == -1)
242 // OBSOLETE if (!print_all)
244 // OBSOLETE if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
245 // OBSOLETE continue;
246 // OBSOLETE if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i)))
247 // OBSOLETE continue;
252 // OBSOLETE if (i != regnum)
253 // OBSOLETE continue;
256 // OBSOLETE /* If the register name is empty, it is undefined for this
257 // OBSOLETE processor, so don't display anything. */
258 // OBSOLETE if (REGISTER_NAME (i) == NULL || *(REGISTER_NAME (i)) == '\0')
259 // OBSOLETE continue;
261 // OBSOLETE fputs_filtered (REGISTER_NAME (i), file);
262 // OBSOLETE print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), file);
264 // OBSOLETE /* Get the data in raw format. */
265 // OBSOLETE if (! frame_register_read (frame, i, raw_buffer))
267 // OBSOLETE fprintf_filtered (file, "*value not available*\n");
268 // OBSOLETE continue;
271 // OBSOLETE /* FIXME: cagney/2002-08-03: This code shouldn't be necessary.
272 // OBSOLETE The function frame_register_read() should have returned the
273 // OBSOLETE pre-cooked register so no conversion is necessary. */
274 // OBSOLETE /* Convert raw data to virtual format if necessary. */
275 // OBSOLETE if (REGISTER_CONVERTIBLE (i))
277 // OBSOLETE REGISTER_CONVERT_TO_VIRTUAL (i, REGISTER_VIRTUAL_TYPE (i),
278 // OBSOLETE raw_buffer, virtual_buffer);
282 // OBSOLETE memcpy (virtual_buffer, raw_buffer,
283 // OBSOLETE REGISTER_VIRTUAL_SIZE (i));
286 // OBSOLETE /* If virtual format is floating, print it that way, and in raw
288 // OBSOLETE if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
292 // OBSOLETE val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
293 // OBSOLETE file, 0, 1, 0, Val_pretty_default);
295 // OBSOLETE fprintf_filtered (file, "\t(raw 0x");
296 // OBSOLETE for (j = 0; j < REGISTER_RAW_SIZE (i); j++)
299 // OBSOLETE if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
302 // OBSOLETE idx = REGISTER_RAW_SIZE (i) - 1 - j;
303 // OBSOLETE fprintf_filtered (file, "%02x", (unsigned char) raw_buffer[idx]);
305 // OBSOLETE fprintf_filtered (file, ")");
309 // OBSOLETE /* Print the register in hex. */
310 // OBSOLETE val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
311 // OBSOLETE file, 'x', 1, 0, Val_pretty_default);
312 // OBSOLETE /* If not a vector register, print it also according to its
313 // OBSOLETE natural format. */
314 // OBSOLETE if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i)) == 0)
316 // OBSOLETE fprintf_filtered (file, "\t");
317 // OBSOLETE val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
318 // OBSOLETE file, 0, 1, 0, Val_pretty_default);
322 // OBSOLETE /* Some h8500 specific info. */
323 // OBSOLETE h8500_print_register_hook (i);
325 // OBSOLETE fprintf_filtered (file, "\n");
330 // OBSOLETE h8500_do_registers_info (int regnum, int all)
332 // OBSOLETE h8500_print_registers_info (current_gdbarch, gdb_stdout, deprecated_selected_frame,
333 // OBSOLETE regnum, all);
337 // OBSOLETE h8500_register_size (int regno)
339 // OBSOLETE switch (regno)
341 // OBSOLETE case SEG_C_REGNUM:
342 // OBSOLETE case SEG_D_REGNUM:
343 // OBSOLETE case SEG_E_REGNUM:
344 // OBSOLETE case SEG_T_REGNUM:
345 // OBSOLETE return 1;
346 // OBSOLETE case R0_REGNUM:
347 // OBSOLETE case R1_REGNUM:
348 // OBSOLETE case R2_REGNUM:
349 // OBSOLETE case R3_REGNUM:
350 // OBSOLETE case R4_REGNUM:
351 // OBSOLETE case R5_REGNUM:
352 // OBSOLETE case R6_REGNUM:
353 // OBSOLETE case R7_REGNUM:
354 // OBSOLETE case CCR_REGNUM:
355 // OBSOLETE return 2;
357 // OBSOLETE case PR0_REGNUM:
358 // OBSOLETE case PR1_REGNUM:
359 // OBSOLETE case PR2_REGNUM:
360 // OBSOLETE case PR3_REGNUM:
361 // OBSOLETE case PR4_REGNUM:
362 // OBSOLETE case PR5_REGNUM:
363 // OBSOLETE case PR6_REGNUM:
364 // OBSOLETE case PR7_REGNUM:
365 // OBSOLETE case PC_REGNUM:
366 // OBSOLETE return 4;
368 // OBSOLETE internal_error (__FILE__, __LINE__, "failed internal consistency check");
372 // OBSOLETE struct type *
373 // OBSOLETE h8500_register_virtual_type (int regno)
375 // OBSOLETE switch (regno)
377 // OBSOLETE case SEG_C_REGNUM:
378 // OBSOLETE case SEG_E_REGNUM:
379 // OBSOLETE case SEG_D_REGNUM:
380 // OBSOLETE case SEG_T_REGNUM:
381 // OBSOLETE return builtin_type_unsigned_char;
382 // OBSOLETE case R0_REGNUM:
383 // OBSOLETE case R1_REGNUM:
384 // OBSOLETE case R2_REGNUM:
385 // OBSOLETE case R3_REGNUM:
386 // OBSOLETE case R4_REGNUM:
387 // OBSOLETE case R5_REGNUM:
388 // OBSOLETE case R6_REGNUM:
389 // OBSOLETE case R7_REGNUM:
390 // OBSOLETE case CCR_REGNUM:
391 // OBSOLETE return builtin_type_unsigned_short;
392 // OBSOLETE case PR0_REGNUM:
393 // OBSOLETE case PR1_REGNUM:
394 // OBSOLETE case PR2_REGNUM:
395 // OBSOLETE case PR3_REGNUM:
396 // OBSOLETE case PR4_REGNUM:
397 // OBSOLETE case PR5_REGNUM:
398 // OBSOLETE case PR6_REGNUM:
399 // OBSOLETE case PR7_REGNUM:
400 // OBSOLETE case PC_REGNUM:
401 // OBSOLETE return builtin_type_unsigned_long;
403 // OBSOLETE internal_error (__FILE__, __LINE__, "failed internal consistency check");
407 // OBSOLETE /* Put here the code to store, into a struct frame_saved_regs,
408 // OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO.
409 // OBSOLETE This includes special registers such as pc and fp saved in special
410 // OBSOLETE ways in the stack frame. sp is even more special:
411 // OBSOLETE the address we return for it IS the sp for the next frame. */
414 // OBSOLETE frame_find_saved_regs (struct frame_info *frame_info,
415 // OBSOLETE struct frame_saved_regs *frame_saved_regs)
417 // OBSOLETE register int regnum;
418 // OBSOLETE register int regmask;
419 // OBSOLETE register CORE_ADDR next_addr;
420 // OBSOLETE register CORE_ADDR pc;
421 // OBSOLETE unsigned char thebyte;
423 // OBSOLETE memset (frame_saved_regs, '\0', sizeof *frame_saved_regs);
425 // OBSOLETE if ((frame_info)->pc >= (frame_info)->frame - CALL_DUMMY_LENGTH - FP_REGNUM * 4 - 4
426 // OBSOLETE && (frame_info)->pc <= (frame_info)->frame)
428 // OBSOLETE next_addr = (frame_info)->frame;
429 // OBSOLETE pc = (frame_info)->frame - CALL_DUMMY_LENGTH - FP_REGNUM * 4 - 4;
433 // OBSOLETE pc = get_pc_function_start ((frame_info)->pc);
434 // OBSOLETE /* Verify we have a link a6 instruction next;
435 // OBSOLETE if not we lose. If we win, find the address above the saved
436 // OBSOLETE regs using the amount of storage from the link instruction.
439 // OBSOLETE thebyte = read_memory_integer (pc, 1);
440 // OBSOLETE if (0x1f == thebyte)
441 // OBSOLETE next_addr = (frame_info)->frame + read_memory_integer (pc += 1, 2), pc += 2;
442 // OBSOLETE else if (0x17 == thebyte)
443 // OBSOLETE next_addr = (frame_info)->frame + read_memory_integer (pc += 1, 1), pc += 1;
445 // OBSOLETE goto lose;
447 // OBSOLETE /* FIXME steve */
448 // OBSOLETE /* If have an add:g.waddal #-n, sp next, adjust next_addr. */
449 // OBSOLETE if ((0x0c0177777 & read_memory_integer (pc, 2)) == 0157774)
450 // OBSOLETE next_addr += read_memory_integer (pc += 2, 4), pc += 4;
454 // OBSOLETE thebyte = read_memory_integer (pc, 1);
455 // OBSOLETE if (thebyte == 0x12)
457 // OBSOLETE /* Got stm */
459 // OBSOLETE regmask = read_memory_integer (pc, 1);
461 // OBSOLETE for (regnum = 0; regnum < 8; regnum++, regmask >>= 1)
463 // OBSOLETE if (regmask & 1)
465 // OBSOLETE (frame_saved_regs)->regs[regnum] = (next_addr += 2) - 2;
468 // OBSOLETE thebyte = read_memory_integer (pc, 1);
470 // OBSOLETE /* Maybe got a load of pushes */
471 // OBSOLETE while (thebyte == 0xbf)
474 // OBSOLETE regnum = read_memory_integer (pc, 1) & 0x7;
476 // OBSOLETE (frame_saved_regs)->regs[regnum] = (next_addr += 2) - 2;
477 // OBSOLETE thebyte = read_memory_integer (pc, 1);
482 // OBSOLETE /* Remember the address of the frame pointer */
483 // OBSOLETE (frame_saved_regs)->regs[FP_REGNUM] = (frame_info)->frame;
485 // OBSOLETE /* This is where the old sp is hidden */
486 // OBSOLETE (frame_saved_regs)->regs[SP_REGNUM] = (frame_info)->frame;
488 // OBSOLETE /* And the PC - remember the pushed FP is always two bytes long */
489 // OBSOLETE (frame_saved_regs)->regs[PC_REGNUM] = (frame_info)->frame + 2;
492 // OBSOLETE CORE_ADDR
493 // OBSOLETE saved_pc_after_call (void)
496 // OBSOLETE int a = read_register (SP_REGNUM);
498 // OBSOLETE x = read_memory_integer (a, code_size);
499 // OBSOLETE if (code_size == 2)
501 // OBSOLETE /* Stick current code segement onto top */
502 // OBSOLETE x &= 0xffff;
503 // OBSOLETE x |= read_register (SEG_C_REGNUM) << 16;
505 // OBSOLETE x &= 0xffffff;
506 // OBSOLETE return x;
510 // OBSOLETE h8500_set_pointer_size (int newsize)
512 // OBSOLETE static int oldsize = 0;
514 // OBSOLETE if (oldsize != newsize)
516 // OBSOLETE printf_unfiltered ("pointer size set to %d bits\n", newsize);
517 // OBSOLETE oldsize = newsize;
518 // OBSOLETE if (newsize == 32)
520 // OBSOLETE minimum_mode = 0;
524 // OBSOLETE minimum_mode = 1;
526 // OBSOLETE _initialize_gdbtypes ();
530 // OBSOLETE static void
531 // OBSOLETE big_command (char *arg, int from_tty)
533 // OBSOLETE h8500_set_pointer_size (32);
534 // OBSOLETE code_size = 4;
535 // OBSOLETE data_size = 4;
538 // OBSOLETE static void
539 // OBSOLETE medium_command (char *arg, int from_tty)
541 // OBSOLETE h8500_set_pointer_size (32);
542 // OBSOLETE code_size = 4;
543 // OBSOLETE data_size = 2;
546 // OBSOLETE static void
547 // OBSOLETE compact_command (char *arg, int from_tty)
549 // OBSOLETE h8500_set_pointer_size (32);
550 // OBSOLETE code_size = 2;
551 // OBSOLETE data_size = 4;
554 // OBSOLETE static void
555 // OBSOLETE small_command (char *arg, int from_tty)
557 // OBSOLETE h8500_set_pointer_size (16);
558 // OBSOLETE code_size = 2;
559 // OBSOLETE data_size = 2;
562 // OBSOLETE static struct cmd_list_element *setmemorylist;
564 // OBSOLETE static void
565 // OBSOLETE set_memory (char *args, int from_tty)
567 // OBSOLETE printf_unfiltered ("\"set memory\" must be followed by the name of a memory subcommand.\n");
568 // OBSOLETE help_list (setmemorylist, "set memory ", -1, gdb_stdout);
571 // OBSOLETE /* See if variable name is ppc or pr[0-7] */
574 // OBSOLETE h8500_is_trapped_internalvar (char *name)
576 // OBSOLETE if (name[0] != 'p')
577 // OBSOLETE return 0;
579 // OBSOLETE if (strcmp (name + 1, "pc") == 0)
580 // OBSOLETE return 1;
582 // OBSOLETE if (name[1] == 'r'
583 // OBSOLETE && name[2] >= '0'
584 // OBSOLETE && name[2] <= '7'
585 // OBSOLETE && name[3] == '\000')
586 // OBSOLETE return 1;
588 // OBSOLETE return 0;
591 // OBSOLETE struct value *
592 // OBSOLETE h8500_value_of_trapped_internalvar (struct internalvar *var)
594 // OBSOLETE LONGEST regval;
595 // OBSOLETE unsigned char regbuf[4];
596 // OBSOLETE int page_regnum, regnum;
598 // OBSOLETE regnum = var->name[2] == 'c' ? PC_REGNUM : var->name[2] - '0';
600 // OBSOLETE switch (var->name[2])
602 // OBSOLETE case 'c':
603 // OBSOLETE page_regnum = SEG_C_REGNUM;
605 // OBSOLETE case '0':
606 // OBSOLETE case '1':
607 // OBSOLETE case '2':
608 // OBSOLETE case '3':
609 // OBSOLETE page_regnum = SEG_D_REGNUM;
611 // OBSOLETE case '4':
612 // OBSOLETE case '5':
613 // OBSOLETE page_regnum = SEG_E_REGNUM;
615 // OBSOLETE case '6':
616 // OBSOLETE case '7':
617 // OBSOLETE page_regnum = SEG_T_REGNUM;
621 // OBSOLETE get_saved_register (regbuf, NULL, NULL, deprecated_selected_frame, page_regnum, NULL);
622 // OBSOLETE regval = regbuf[0] << 16;
624 // OBSOLETE get_saved_register (regbuf, NULL, NULL, deprecated_selected_frame, regnum, NULL);
625 // OBSOLETE regval |= regbuf[0] << 8 | regbuf[1]; /* XXX host/target byte order */
627 // OBSOLETE xfree (var->value); /* Free up old value */
629 // OBSOLETE var->value = value_from_longest (builtin_type_unsigned_long, regval);
630 // OBSOLETE release_value (var->value); /* Unchain new value */
632 // OBSOLETE VALUE_LVAL (var->value) = lval_internalvar;
633 // OBSOLETE VALUE_INTERNALVAR (var->value) = var;
634 // OBSOLETE return var->value;
638 // OBSOLETE h8500_set_trapped_internalvar (struct internalvar *var, struct value *newval,
639 // OBSOLETE int bitpos, int bitsize, int offset)
641 // OBSOLETE char *page_regnum, *regnum;
642 // OBSOLETE char expression[100];
643 // OBSOLETE unsigned new_regval;
644 // OBSOLETE struct type *type;
645 // OBSOLETE enum type_code newval_type_code;
647 // OBSOLETE type = check_typedef (VALUE_TYPE (newval));
648 // OBSOLETE newval_type_code = TYPE_CODE (type);
650 // OBSOLETE if ((newval_type_code != TYPE_CODE_INT
651 // OBSOLETE && newval_type_code != TYPE_CODE_PTR)
652 // OBSOLETE || TYPE_LENGTH (type) != sizeof (new_regval))
653 // OBSOLETE error ("Illegal type (%s) for assignment to $%s\n",
654 // OBSOLETE TYPE_NAME (VALUE_TYPE (newval)), var->name);
656 // OBSOLETE new_regval = *(long *) VALUE_CONTENTS_RAW (newval);
658 // OBSOLETE regnum = var->name + 1;
660 // OBSOLETE switch (var->name[2])
662 // OBSOLETE case 'c':
663 // OBSOLETE page_regnum = "cp";
665 // OBSOLETE case '0':
666 // OBSOLETE case '1':
667 // OBSOLETE case '2':
668 // OBSOLETE case '3':
669 // OBSOLETE page_regnum = "dp";
671 // OBSOLETE case '4':
672 // OBSOLETE case '5':
673 // OBSOLETE page_regnum = "ep";
675 // OBSOLETE case '6':
676 // OBSOLETE case '7':
677 // OBSOLETE page_regnum = "tp";
681 // OBSOLETE sprintf (expression, "$%s=%d", page_regnum, new_regval >> 16);
682 // OBSOLETE parse_and_eval (expression);
684 // OBSOLETE sprintf (expression, "$%s=%d", regnum, new_regval & 0xffff);
685 // OBSOLETE parse_and_eval (expression);
688 // OBSOLETE CORE_ADDR
689 // OBSOLETE h8500_read_sp (void)
691 // OBSOLETE return read_register (PR7_REGNUM);
695 // OBSOLETE h8500_write_sp (CORE_ADDR v)
697 // OBSOLETE write_register (PR7_REGNUM, v);
700 // OBSOLETE CORE_ADDR
701 // OBSOLETE h8500_read_pc (ptid_t ptid)
703 // OBSOLETE return read_register (PC_REGNUM);
707 // OBSOLETE h8500_write_pc (CORE_ADDR v, ptid_t ptid)
709 // OBSOLETE write_register (PC_REGNUM, v);
712 // OBSOLETE CORE_ADDR
713 // OBSOLETE h8500_read_fp (void)
715 // OBSOLETE return read_register (PR6_REGNUM);
719 // OBSOLETE _initialize_h8500_tdep (void)
721 // OBSOLETE tm_print_insn = print_insn_h8500;
723 // OBSOLETE add_prefix_cmd ("memory", no_class, set_memory,
724 // OBSOLETE "set the memory model", &setmemorylist, "set memory ", 0,
725 // OBSOLETE &setlist);
727 // OBSOLETE add_cmd ("small", class_support, small_command,
728 // OBSOLETE "Set small memory model. (16 bit code, 16 bit data)", &setmemorylist);
730 // OBSOLETE add_cmd ("big", class_support, big_command,
731 // OBSOLETE "Set big memory model. (32 bit code, 32 bit data)", &setmemorylist);
733 // OBSOLETE add_cmd ("medium", class_support, medium_command,
734 // OBSOLETE "Set medium memory model. (32 bit code, 16 bit data)", &setmemorylist);
736 // OBSOLETE add_cmd ("compact", class_support, compact_command,
737 // OBSOLETE "Set compact memory model. (16 bit code, 32 bit data)", &setmemorylist);
This page took 0.086195 seconds and 4 git commands to generate.