1 /* Pyramid target-dependent code for GDB.
2 Copyright (C) 1988, 1989, 1991 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
22 /*** Prettier register printing. ***/
24 /* Print registers in the same format as pyramid's dbx, adb, sdb. */
25 pyr_print_registers(reg_buf
, regnum
)
32 for (regno
= 0; regno
< 16; regno
++) {
33 printf
/*_filtered*/ ("%6.6s: %8x %6.6s: %8x %6s: %8x %6s: %8x\n",
34 reg_names
[regno
], reg_buf
[regno
],
35 reg_names
[regno
+16], reg_buf
[regno
+16],
36 reg_names
[regno
+32], reg_buf
[regno
+32],
37 reg_names
[regno
+48], reg_buf
[regno
+48]);
39 usp
= ptrace (3, inferior_pid
,
40 (PTRACE_ARG3_TYPE
) ((char *)&u
.u_pcb
.pcb_usp
) -
42 ksp
= ptrace (3, inferior_pid
,
43 (PTRACE_ARG3_TYPE
) ((char *)&u
.u_pcb
.pcb_ksp
) -
45 printf
/*_filtered*/ ("\n%6.6s: %8x %6.6s: %8x (%08x) %6.6s %8x\n",
46 reg_names
[CSP_REGNUM
],reg_buf
[CSP_REGNUM
],
47 reg_names
[KSP_REGNUM
], reg_buf
[KSP_REGNUM
], ksp
,
51 /* Print the register regnum, or all registers if regnum is -1.
52 fpregs is currently ignored. */
54 pyr_do_registers_info (regnum
, fpregs
)
58 /* On a pyr, we know a virtual register can always fit in an long.
59 Here (and elsewhere) we take advantage of that. Yuk. */
60 long raw_regs
[MAX_REGISTER_RAW_SIZE
*NUM_REGS
];
63 for (i
= 0 ; i
< 64 ; i
++) {
64 read_relative_register_raw_bytes(i
, raw_regs
+i
);
67 pyr_print_registers (raw_regs
, regnum
);
69 for (i
= 0; i
< NUM_REGS
; i
++)
71 long val
= raw_regs
[i
];
73 fputs_filtered (reg_names
[i
], stdout
);
75 print_spaces_filtered (6 - strlen (reg_names
[i
]), stdout
);
77 printf_filtered ("0");
79 printf_filtered ("%s %d", local_hex_string_custom(val
,"08"), val
);
80 printf_filtered("\n");
84 /*** Debugging editions of various macros from m-pyr.h ****/
86 CORE_ADDR
frame_locals_address (frame
)
89 register int addr
= find_saved_register (frame
,CFP_REGNUM
);
90 register int result
= read_memory_integer (addr
, 4);
91 #ifdef PYRAMID_CONTROL_FRAME_DEBUGGING
93 "\t[[..frame_locals:%8x, %s= %x @%x fcfp= %x foo= %x\n\t gr13=%x pr13=%x tr13=%x @%x]]\n",
95 reg_names
[CFP_REGNUM
],
97 frame
->frame_cfp
, (CFP_REGNUM
),
100 read_register(13), read_register(29), read_register(61),
101 find_saved_register(frame
, 61));
102 #endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
104 /* FIXME: I thought read_register (CFP_REGNUM) should be the right answer;
105 or at least CFP_REGNUM relative to FRAME (ie, result).
106 There seems to be a bug in the way the innermost frame is set up. */
108 return ((frame
->next
) ? result
: frame
->frame_cfp
);
111 CORE_ADDR
frame_args_addr (frame
)
114 register int addr
= find_saved_register (frame
,CFP_REGNUM
);
115 register int result
= read_memory_integer (addr
, 4);
117 #ifdef PYRAMID_CONTROL_FRAME_DEBUGGING
119 "\t[[..frame_args:%8x, %s= %x @%x fcfp= %x r_r= %x\n\t gr13=%x pr13=%x tr13=%x @%x]]\n",
121 reg_names
[CFP_REGNUM
],
123 frame
->frame_cfp
, read_register(CFP_REGNUM
),
125 read_register(13), read_register(29), read_register(61),
126 find_saved_register(frame
, 61));
127 #endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
129 /* FIXME: I thought read_register (CFP_REGNUM) should be the right answer;
130 or at least CFP_REGNUM relative to FRAME (ie, result).
131 There seems to be a bug in the way the innermost frame is set up. */
132 return ((frame
->next
) ? result
: frame
->frame_cfp
);
This page took 0.031855 seconds and 4 git commands to generate.