| 1 | /* OBSOLETE /* Convex stuff for GDB. */ |
| 2 | /* OBSOLETE Copyright (C) 1990, 1991, 1996, 2000 Free Software Foundation, Inc. */ |
| 3 | /* OBSOLETE */ |
| 4 | /* OBSOLETE This file is part of GDB. */ |
| 5 | /* OBSOLETE */ |
| 6 | /* OBSOLETE This program is free software; you can redistribute it and/or modify */ |
| 7 | /* OBSOLETE it under the terms of the GNU General Public License as published by */ |
| 8 | /* OBSOLETE the Free Software Foundation; either version 2 of the License, or */ |
| 9 | /* OBSOLETE (at your option) any later version. */ |
| 10 | /* OBSOLETE */ |
| 11 | /* OBSOLETE This program is distributed in the hope that it will be useful, */ |
| 12 | /* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */ |
| 13 | /* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ |
| 14 | /* OBSOLETE GNU General Public License for more details. */ |
| 15 | /* OBSOLETE */ |
| 16 | /* OBSOLETE You should have received a copy of the GNU General Public License */ |
| 17 | /* OBSOLETE along with this program; if not, write to the Free Software */ |
| 18 | /* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *x/ */ |
| 19 | /* OBSOLETE */ |
| 20 | /* OBSOLETE #include "defs.h" */ |
| 21 | /* OBSOLETE #include "command.h" */ |
| 22 | /* OBSOLETE #include "symtab.h" */ |
| 23 | /* OBSOLETE #include "value.h" */ |
| 24 | /* OBSOLETE #include "frame.h" */ |
| 25 | /* OBSOLETE #include "inferior.h" */ |
| 26 | /* OBSOLETE #include "gdb_wait.h" */ |
| 27 | /* OBSOLETE */ |
| 28 | /* OBSOLETE #include <signal.h> */ |
| 29 | /* OBSOLETE #include <fcntl.h> */ |
| 30 | /* OBSOLETE */ |
| 31 | /* OBSOLETE #include "gdbcore.h" */ |
| 32 | /* OBSOLETE #include <sys/param.h> */ |
| 33 | /* OBSOLETE #include <sys/dir.h> */ |
| 34 | /* OBSOLETE #include <sys/user.h> */ |
| 35 | /* OBSOLETE #include <sys/ioctl.h> */ |
| 36 | /* OBSOLETE #include <sys/pcntl.h> */ |
| 37 | /* OBSOLETE #include <sys/thread.h> */ |
| 38 | /* OBSOLETE #include <sys/proc.h> */ |
| 39 | /* OBSOLETE #include <sys/file.h> */ |
| 40 | /* OBSOLETE #include "gdb_stat.h" */ |
| 41 | /* OBSOLETE #include <sys/mman.h> */ |
| 42 | /* OBSOLETE */ |
| 43 | /* OBSOLETE #include "gdbcmd.h" */ |
| 44 | /* OBSOLETE */ |
| 45 | /* OBSOLETE CORE_ADDR */ |
| 46 | /* OBSOLETE convex_skip_prologue (pc) */ |
| 47 | /* OBSOLETE CORE_ADDR pc; */ |
| 48 | /* OBSOLETE { */ |
| 49 | /* OBSOLETE int op, ix; */ |
| 50 | /* OBSOLETE op = read_memory_integer (pc, 2); */ |
| 51 | /* OBSOLETE if ((op & 0xffc7) == 0x5ac0) */ |
| 52 | /* OBSOLETE pc += 2; */ |
| 53 | /* OBSOLETE else if (op == 0x1580) */ |
| 54 | /* OBSOLETE pc += 4; */ |
| 55 | /* OBSOLETE else if (op == 0x15c0) */ |
| 56 | /* OBSOLETE pc += 6; */ |
| 57 | /* OBSOLETE if ((read_memory_integer (pc, 2) & 0xfff8) == 0x7c40 */ |
| 58 | /* OBSOLETE && (read_memory_integer (pc + 2, 2) & 0xfff8) == 0x1240 */ |
| 59 | /* OBSOLETE && (read_memory_integer (pc + 8, 2) & 0xfff8) == 0x7c48) */ |
| 60 | /* OBSOLETE pc += 10; */ |
| 61 | /* OBSOLETE if (read_memory_integer (pc, 2) == 0x1240) */ |
| 62 | /* OBSOLETE pc += 6; */ |
| 63 | /* OBSOLETE for (;;) */ |
| 64 | /* OBSOLETE { */ |
| 65 | /* OBSOLETE op = read_memory_integer (pc, 2); */ |
| 66 | /* OBSOLETE ix = (op >> 3) & 7; */ |
| 67 | /* OBSOLETE if (ix != 6) */ |
| 68 | /* OBSOLETE break; */ |
| 69 | /* OBSOLETE if ((op & 0xfcc0) == 0x3000) */ |
| 70 | /* OBSOLETE pc += 4; */ |
| 71 | /* OBSOLETE else if ((op & 0xfcc0) == 0x3040) */ |
| 72 | /* OBSOLETE pc += 6; */ |
| 73 | /* OBSOLETE else if ((op & 0xfcc0) == 0x2800) */ |
| 74 | /* OBSOLETE pc += 4; */ |
| 75 | /* OBSOLETE else if ((op & 0xfcc0) == 0x2840) */ |
| 76 | /* OBSOLETE pc += 6; */ |
| 77 | /* OBSOLETE else */ |
| 78 | /* OBSOLETE break; */ |
| 79 | /* OBSOLETE } */ |
| 80 | /* OBSOLETE return pc; */ |
| 81 | /* OBSOLETE } */ |
| 82 | /* OBSOLETE */ |
| 83 | /* OBSOLETE int */ |
| 84 | /* OBSOLETE convex_frameless_function_invocation (fi) */ |
| 85 | /* OBSOLETE struct frame_info *fi; */ |
| 86 | /* OBSOLETE { */ |
| 87 | /* OBSOLETE int frameless; */ |
| 88 | /* OBSOLETE extern CORE_ADDR text_start, text_end; */ |
| 89 | /* OBSOLETE CORE_ADDR call_addr = SAVED_PC_AFTER_CALL (FI); */ |
| 90 | /* OBSOLETE frameless = (call_addr >= text_start && call_addr < text_end */ |
| 91 | /* OBSOLETE && read_memory_integer (call_addr - 6, 1) == 0x22); */ |
| 92 | /* OBSOLETE return frameless; */ |
| 93 | /* OBSOLETE } */ |
| 94 | /* OBSOLETE */ |
| 95 | /* OBSOLETE int */ |
| 96 | /* OBSOLETE convex_frame_num_args (fi) */ |
| 97 | /* OBSOLETE struct frame_info *fi; */ |
| 98 | /* OBSOLETE { */ |
| 99 | /* OBSOLETE int numargs = read_memory_integer (FRAME_ARGS_ADDRESS (fi) - 4, 4); */ |
| 100 | /* OBSOLETE if (numargs < 0 || numargs >= 256) */ |
| 101 | /* OBSOLETE numargs = -1; */ |
| 102 | /* OBSOLETE return numargs; */ |
| 103 | /* OBSOLETE } */ |
| 104 | /* OBSOLETE */ |
| 105 | /* OBSOLETE exec_file_command (filename, from_tty) */ |
| 106 | /* OBSOLETE char *filename; */ |
| 107 | /* OBSOLETE int from_tty; */ |
| 108 | /* OBSOLETE { */ |
| 109 | /* OBSOLETE int val; */ |
| 110 | /* OBSOLETE int n; */ |
| 111 | /* OBSOLETE struct stat st_exec; */ |
| 112 | /* OBSOLETE */ |
| 113 | /* OBSOLETE /* Eliminate all traces of old exec file. */ |
| 114 | /* OBSOLETE Mark text segment as empty. *x/ */ |
| 115 | /* OBSOLETE */ |
| 116 | /* OBSOLETE if (execfile) */ |
| 117 | /* OBSOLETE free (execfile); */ |
| 118 | /* OBSOLETE execfile = 0; */ |
| 119 | /* OBSOLETE data_start = 0; */ |
| 120 | /* OBSOLETE data_end = 0; */ |
| 121 | /* OBSOLETE text_start = 0; */ |
| 122 | /* OBSOLETE text_end = 0; */ |
| 123 | /* OBSOLETE exec_data_start = 0; */ |
| 124 | /* OBSOLETE exec_data_end = 0; */ |
| 125 | /* OBSOLETE if (execchan >= 0) */ |
| 126 | /* OBSOLETE close (execchan); */ |
| 127 | /* OBSOLETE execchan = -1; */ |
| 128 | /* OBSOLETE */ |
| 129 | /* OBSOLETE n_exec = 0; */ |
| 130 | /* OBSOLETE */ |
| 131 | /* OBSOLETE /* Now open and digest the file the user requested, if any. *x/ */ |
| 132 | /* OBSOLETE */ |
| 133 | /* OBSOLETE if (filename) */ |
| 134 | /* OBSOLETE { */ |
| 135 | /* OBSOLETE filename = tilde_expand (filename); */ |
| 136 | /* OBSOLETE make_cleanup (free, filename); */ |
| 137 | /* OBSOLETE */ |
| 138 | /* OBSOLETE execchan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0, */ |
| 139 | /* OBSOLETE &execfile); */ |
| 140 | /* OBSOLETE if (execchan < 0) */ |
| 141 | /* OBSOLETE perror_with_name (filename); */ |
| 142 | /* OBSOLETE */ |
| 143 | /* OBSOLETE if (myread (execchan, &filehdr, sizeof filehdr) < 0) */ |
| 144 | /* OBSOLETE perror_with_name (filename); */ |
| 145 | /* OBSOLETE */ |
| 146 | /* OBSOLETE if (! IS_SOFF_MAGIC (filehdr.h_magic)) */ |
| 147 | /* OBSOLETE error ("%s: not an executable file.", filename); */ |
| 148 | /* OBSOLETE */ |
| 149 | /* OBSOLETE if (myread (execchan, &opthdr, filehdr.h_opthdr) <= 0) */ |
| 150 | /* OBSOLETE perror_with_name (filename); */ |
| 151 | /* OBSOLETE */ |
| 152 | /* OBSOLETE /* Read through the section headers. */ |
| 153 | /* OBSOLETE For text, data, etc, record an entry in the exec file map. */ |
| 154 | /* OBSOLETE Record text_start and text_end. *x/ */ |
| 155 | /* OBSOLETE */ |
| 156 | /* OBSOLETE lseek (execchan, (long) filehdr.h_scnptr, 0); */ |
| 157 | /* OBSOLETE */ |
| 158 | /* OBSOLETE for (n = 0; n < filehdr.h_nscns; n++) */ |
| 159 | /* OBSOLETE { */ |
| 160 | /* OBSOLETE if (myread (execchan, &scnhdr, sizeof scnhdr) < 0) */ |
| 161 | /* OBSOLETE perror_with_name (filename); */ |
| 162 | /* OBSOLETE */ |
| 163 | /* OBSOLETE if ((scnhdr.s_flags & S_TYPMASK) >= S_TEXT */ |
| 164 | /* OBSOLETE && (scnhdr.s_flags & S_TYPMASK) <= S_COMON) */ |
| 165 | /* OBSOLETE { */ |
| 166 | /* OBSOLETE exec_map[n_exec].mem_addr = scnhdr.s_vaddr; */ |
| 167 | /* OBSOLETE exec_map[n_exec].mem_end = scnhdr.s_vaddr + scnhdr.s_size; */ |
| 168 | /* OBSOLETE exec_map[n_exec].file_addr = scnhdr.s_scnptr; */ |
| 169 | /* OBSOLETE exec_map[n_exec].type = scnhdr.s_flags & S_TYPMASK; */ |
| 170 | /* OBSOLETE n_exec++; */ |
| 171 | /* OBSOLETE */ |
| 172 | /* OBSOLETE if ((scnhdr.s_flags & S_TYPMASK) == S_TEXT) */ |
| 173 | /* OBSOLETE { */ |
| 174 | /* OBSOLETE text_start = scnhdr.s_vaddr; */ |
| 175 | /* OBSOLETE text_end = scnhdr.s_vaddr + scnhdr.s_size; */ |
| 176 | /* OBSOLETE } */ |
| 177 | /* OBSOLETE } */ |
| 178 | /* OBSOLETE } */ |
| 179 | /* OBSOLETE */ |
| 180 | /* OBSOLETE fstat (execchan, &st_exec); */ |
| 181 | /* OBSOLETE exec_mtime = st_exec.st_mtime; */ |
| 182 | /* OBSOLETE */ |
| 183 | /* OBSOLETE validate_files (); */ |
| 184 | /* OBSOLETE } */ |
| 185 | /* OBSOLETE else if (from_tty) */ |
| 186 | /* OBSOLETE printf_filtered ("No executable file now.\n"); */ |
| 187 | /* OBSOLETE */ |
| 188 | /* OBSOLETE /* Tell display code (if any) about the changed file name. *x/ */ |
| 189 | /* OBSOLETE if (exec_file_display_hook) */ |
| 190 | /* OBSOLETE (*exec_file_display_hook) (filename); */ |
| 191 | /* OBSOLETE } */ |
| 192 | /* OBSOLETE */ |
| 193 | /* OBSOLETE #if 0 */ |
| 194 | /* OBSOLETE /* Read data from SOFF exec or core file. */ |
| 195 | /* OBSOLETE Return 0 on success, EIO if address out of bounds. *x/ */ |
| 196 | /* OBSOLETE */ |
| 197 | /* OBSOLETE int */ |
| 198 | /* OBSOLETE xfer_core_file (memaddr, myaddr, len) */ |
| 199 | /* OBSOLETE CORE_ADDR memaddr; */ |
| 200 | /* OBSOLETE char *myaddr; */ |
| 201 | /* OBSOLETE int len; */ |
| 202 | /* OBSOLETE { */ |
| 203 | /* OBSOLETE register int i; */ |
| 204 | /* OBSOLETE register int n; */ |
| 205 | /* OBSOLETE register int val; */ |
| 206 | /* OBSOLETE int xferchan; */ |
| 207 | /* OBSOLETE char **xferfile; */ |
| 208 | /* OBSOLETE int fileptr; */ |
| 209 | /* OBSOLETE int returnval = 0; */ |
| 210 | /* OBSOLETE */ |
| 211 | /* OBSOLETE while (len > 0) */ |
| 212 | /* OBSOLETE { */ |
| 213 | /* OBSOLETE xferfile = 0; */ |
| 214 | /* OBSOLETE xferchan = 0; */ |
| 215 | /* OBSOLETE */ |
| 216 | /* OBSOLETE /* Determine which file the next bunch of addresses reside in, */ |
| 217 | /* OBSOLETE and where in the file. Set the file's read/write pointer */ |
| 218 | /* OBSOLETE to point at the proper place for the desired address */ |
| 219 | /* OBSOLETE and set xferfile and xferchan for the correct file. */ |
| 220 | /* OBSOLETE If desired address is nonexistent, leave them zero. */ |
| 221 | /* OBSOLETE i is set to the number of bytes that can be handled */ |
| 222 | /* OBSOLETE along with the next address. *x/ */ |
| 223 | /* OBSOLETE */ |
| 224 | /* OBSOLETE i = len; */ |
| 225 | /* OBSOLETE */ |
| 226 | /* OBSOLETE for (n = 0; n < n_core; n++) */ |
| 227 | /* OBSOLETE { */ |
| 228 | /* OBSOLETE if (memaddr >= core_map[n].mem_addr && memaddr < core_map[n].mem_end */ |
| 229 | /* OBSOLETE && (core_map[n].thread == -1 */ |
| 230 | /* OBSOLETE || core_map[n].thread == inferior_thread)) */ |
| 231 | /* OBSOLETE { */ |
| 232 | /* OBSOLETE i = min (len, core_map[n].mem_end - memaddr); */ |
| 233 | /* OBSOLETE fileptr = core_map[n].file_addr + memaddr - core_map[n].mem_addr; */ |
| 234 | /* OBSOLETE if (core_map[n].file_addr) */ |
| 235 | /* OBSOLETE { */ |
| 236 | /* OBSOLETE xferfile = &corefile; */ |
| 237 | /* OBSOLETE xferchan = corechan; */ |
| 238 | /* OBSOLETE } */ |
| 239 | /* OBSOLETE break; */ |
| 240 | /* OBSOLETE } */ |
| 241 | /* OBSOLETE else if (core_map[n].mem_addr >= memaddr */ |
| 242 | /* OBSOLETE && core_map[n].mem_addr < memaddr + i) */ |
| 243 | /* OBSOLETE i = core_map[n].mem_addr - memaddr; */ |
| 244 | /* OBSOLETE } */ |
| 245 | /* OBSOLETE */ |
| 246 | /* OBSOLETE if (!xferfile) */ |
| 247 | /* OBSOLETE for (n = 0; n < n_exec; n++) */ |
| 248 | /* OBSOLETE { */ |
| 249 | /* OBSOLETE if (memaddr >= exec_map[n].mem_addr */ |
| 250 | /* OBSOLETE && memaddr < exec_map[n].mem_end) */ |
| 251 | /* OBSOLETE { */ |
| 252 | /* OBSOLETE i = min (len, exec_map[n].mem_end - memaddr); */ |
| 253 | /* OBSOLETE fileptr = exec_map[n].file_addr + memaddr */ |
| 254 | /* OBSOLETE - exec_map[n].mem_addr; */ |
| 255 | /* OBSOLETE if (exec_map[n].file_addr) */ |
| 256 | /* OBSOLETE { */ |
| 257 | /* OBSOLETE xferfile = &execfile; */ |
| 258 | /* OBSOLETE xferchan = execchan; */ |
| 259 | /* OBSOLETE } */ |
| 260 | /* OBSOLETE break; */ |
| 261 | /* OBSOLETE } */ |
| 262 | /* OBSOLETE else if (exec_map[n].mem_addr >= memaddr */ |
| 263 | /* OBSOLETE && exec_map[n].mem_addr < memaddr + i) */ |
| 264 | /* OBSOLETE i = exec_map[n].mem_addr - memaddr; */ |
| 265 | /* OBSOLETE } */ |
| 266 | /* OBSOLETE */ |
| 267 | /* OBSOLETE /* Now we know which file to use. */ |
| 268 | /* OBSOLETE Set up its pointer and transfer the data. *x/ */ |
| 269 | /* OBSOLETE if (xferfile) */ |
| 270 | /* OBSOLETE { */ |
| 271 | /* OBSOLETE if (*xferfile == 0) */ |
| 272 | /* OBSOLETE if (xferfile == &execfile) */ |
| 273 | /* OBSOLETE error ("No program file to examine."); */ |
| 274 | /* OBSOLETE else */ |
| 275 | /* OBSOLETE error ("No core dump file or running program to examine."); */ |
| 276 | /* OBSOLETE val = lseek (xferchan, fileptr, 0); */ |
| 277 | /* OBSOLETE if (val < 0) */ |
| 278 | /* OBSOLETE perror_with_name (*xferfile); */ |
| 279 | /* OBSOLETE val = myread (xferchan, myaddr, i); */ |
| 280 | /* OBSOLETE if (val < 0) */ |
| 281 | /* OBSOLETE perror_with_name (*xferfile); */ |
| 282 | /* OBSOLETE } */ |
| 283 | /* OBSOLETE /* If this address is for nonexistent memory, */ |
| 284 | /* OBSOLETE read zeros if reading, or do nothing if writing. *x/ */ |
| 285 | /* OBSOLETE else */ |
| 286 | /* OBSOLETE { */ |
| 287 | /* OBSOLETE memset (myaddr, '\0', i); */ |
| 288 | /* OBSOLETE returnval = EIO; */ |
| 289 | /* OBSOLETE } */ |
| 290 | /* OBSOLETE */ |
| 291 | /* OBSOLETE memaddr += i; */ |
| 292 | /* OBSOLETE myaddr += i; */ |
| 293 | /* OBSOLETE len -= i; */ |
| 294 | /* OBSOLETE } */ |
| 295 | /* OBSOLETE return returnval; */ |
| 296 | /* OBSOLETE } */ |
| 297 | /* OBSOLETE #endif */ |
| 298 | /* OBSOLETE */ |
| 299 | /* OBSOLETE /* Here from info files command to print an address map. *x/ */ |
| 300 | /* OBSOLETE */ |
| 301 | /* OBSOLETE print_maps () */ |
| 302 | /* OBSOLETE { */ |
| 303 | /* OBSOLETE struct pmap ptrs[200]; */ |
| 304 | /* OBSOLETE int n; */ |
| 305 | /* OBSOLETE */ |
| 306 | /* OBSOLETE /* ID strings for core and executable file sections *x/ */ |
| 307 | /* OBSOLETE */ |
| 308 | /* OBSOLETE static char *idstr[] = */ |
| 309 | /* OBSOLETE { */ |
| 310 | /* OBSOLETE "0", "text", "data", "tdata", "bss", "tbss", */ |
| 311 | /* OBSOLETE "common", "ttext", "ctx", "tctx", "10", "11", "12", */ |
| 312 | /* OBSOLETE }; */ |
| 313 | /* OBSOLETE */ |
| 314 | /* OBSOLETE for (n = 0; n < n_core; n++) */ |
| 315 | /* OBSOLETE { */ |
| 316 | /* OBSOLETE core_map[n].which = 0; */ |
| 317 | /* OBSOLETE ptrs[n] = core_map[n]; */ |
| 318 | /* OBSOLETE } */ |
| 319 | /* OBSOLETE for (n = 0; n < n_exec; n++) */ |
| 320 | /* OBSOLETE { */ |
| 321 | /* OBSOLETE exec_map[n].which = 1; */ |
| 322 | /* OBSOLETE ptrs[n_core+n] = exec_map[n]; */ |
| 323 | /* OBSOLETE } */ |
| 324 | /* OBSOLETE */ |
| 325 | /* OBSOLETE qsort (ptrs, n_core + n_exec, sizeof *ptrs, ptr_cmp); */ |
| 326 | /* OBSOLETE */ |
| 327 | /* OBSOLETE for (n = 0; n < n_core + n_exec; n++) */ |
| 328 | /* OBSOLETE { */ |
| 329 | /* OBSOLETE struct pmap *p = &ptrs[n]; */ |
| 330 | /* OBSOLETE if (n > 0) */ |
| 331 | /* OBSOLETE { */ |
| 332 | /* OBSOLETE if (p->mem_addr < ptrs[n-1].mem_end) */ |
| 333 | /* OBSOLETE p->mem_addr = ptrs[n-1].mem_end; */ |
| 334 | /* OBSOLETE if (p->mem_addr >= p->mem_end) */ |
| 335 | /* OBSOLETE continue; */ |
| 336 | /* OBSOLETE } */ |
| 337 | /* OBSOLETE printf_filtered ("%08x .. %08x %-6s %s\n", */ |
| 338 | /* OBSOLETE p->mem_addr, p->mem_end, idstr[p->type], */ |
| 339 | /* OBSOLETE p->which ? execfile : corefile); */ |
| 340 | /* OBSOLETE } */ |
| 341 | /* OBSOLETE } */ |
| 342 | /* OBSOLETE */ |
| 343 | /* OBSOLETE /* Compare routine to put file sections in order. */ |
| 344 | /* OBSOLETE Sort into increasing order on address, and put core file sections */ |
| 345 | /* OBSOLETE before exec file sections if both files contain the same addresses. *x/ */ |
| 346 | /* OBSOLETE */ |
| 347 | /* OBSOLETE static ptr_cmp (a, b) */ |
| 348 | /* OBSOLETE struct pmap *a, *b; */ |
| 349 | /* OBSOLETE { */ |
| 350 | /* OBSOLETE if (a->mem_addr != b->mem_addr) return a->mem_addr - b->mem_addr; */ |
| 351 | /* OBSOLETE return a->which - b->which; */ |
| 352 | /* OBSOLETE } */ |
| 353 | /* OBSOLETE \f */ |
| 354 | /* OBSOLETE /* Trapped internal variables are used to handle special registers. */ |
| 355 | /* OBSOLETE A trapped i.v. calls a hook here every time it is dereferenced, */ |
| 356 | /* OBSOLETE to provide a new value for the variable, and it calls a hook here */ |
| 357 | /* OBSOLETE when a new value is assigned, to do something with the value. */ |
| 358 | /* OBSOLETE */ |
| 359 | /* OBSOLETE The vector registers are $vl, $vs, $vm, $vN, $VN (N in 0..7). */ |
| 360 | /* OBSOLETE The communication registers are $cN, $CN (N in 0..63). */ |
| 361 | /* OBSOLETE They not handled as regular registers because it's expensive to */ |
| 362 | /* OBSOLETE read them, and their size varies, and they have too many names. *x/ */ |
| 363 | /* OBSOLETE */ |
| 364 | /* OBSOLETE */ |
| 365 | /* OBSOLETE /* Return 1 if NAME is a trapped internal variable, else 0. *x/ */ |
| 366 | /* OBSOLETE */ |
| 367 | /* OBSOLETE int */ |
| 368 | /* OBSOLETE is_trapped_internalvar (name) */ |
| 369 | /* OBSOLETE char *name; */ |
| 370 | /* OBSOLETE { */ |
| 371 | /* OBSOLETE if ((name[0] == 'c' || name[0] == 'C') */ |
| 372 | /* OBSOLETE && name[1] >= '0' && name[1] <= '9' */ |
| 373 | /* OBSOLETE && (name[2] == '\0' */ |
| 374 | /* OBSOLETE || (name[2] >= '0' && name[2] <= '9' */ |
| 375 | /* OBSOLETE && name[3] == '\0' && name[1] != '0')) */ |
| 376 | /* OBSOLETE && atoi (&name[1]) < 64) return 1; */ |
| 377 | /* OBSOLETE */ |
| 378 | /* OBSOLETE if ((name[0] == 'v' || name[0] == 'V') */ |
| 379 | /* OBSOLETE && (((name[1] & -8) == '0' && name[2] == '\0') */ |
| 380 | /* OBSOLETE || STREQ (name, "vl") */ |
| 381 | /* OBSOLETE || STREQ (name, "vs") */ |
| 382 | /* OBSOLETE || STREQ (name, "vm"))) */ |
| 383 | /* OBSOLETE return 1; */ |
| 384 | /* OBSOLETE else return 0; */ |
| 385 | /* OBSOLETE } */ |
| 386 | /* OBSOLETE */ |
| 387 | /* OBSOLETE /* Return the value of trapped internal variable VAR *x/ */ |
| 388 | /* OBSOLETE */ |
| 389 | /* OBSOLETE value */ |
| 390 | /* OBSOLETE value_of_trapped_internalvar (var) */ |
| 391 | /* OBSOLETE struct internalvar *var; */ |
| 392 | /* OBSOLETE { */ |
| 393 | /* OBSOLETE char *name = var->name; */ |
| 394 | /* OBSOLETE value val; */ |
| 395 | /* OBSOLETE struct type *type; */ |
| 396 | /* OBSOLETE struct type *range_type; */ |
| 397 | /* OBSOLETE long len = *read_vector_register (VL_REGNUM); */ |
| 398 | /* OBSOLETE if (len <= 0 || len > 128) len = 128; */ |
| 399 | /* OBSOLETE */ |
| 400 | /* OBSOLETE if (STREQ (name, "vl")) */ |
| 401 | /* OBSOLETE { */ |
| 402 | /* OBSOLETE val = value_from_longest (builtin_type_int, */ |
| 403 | /* OBSOLETE (LONGEST) *read_vector_register_1 (VL_REGNUM)); */ |
| 404 | /* OBSOLETE } */ |
| 405 | /* OBSOLETE else if (STREQ (name, "vs")) */ |
| 406 | /* OBSOLETE { */ |
| 407 | /* OBSOLETE val = value_from_longest (builtin_type_int, */ |
| 408 | /* OBSOLETE (LONGEST) *read_vector_register_1 (VS_REGNUM)); */ |
| 409 | /* OBSOLETE } */ |
| 410 | /* OBSOLETE else if (STREQ (name, "vm")) */ |
| 411 | /* OBSOLETE { */ |
| 412 | /* OBSOLETE long vm[4]; */ |
| 413 | /* OBSOLETE long i, *p; */ |
| 414 | /* OBSOLETE memcpy (vm, read_vector_register_1 (VM_REGNUM), sizeof vm); */ |
| 415 | /* OBSOLETE range_type = */ |
| 416 | /* OBSOLETE create_range_type ((struct type *) NULL, builtin_type_int, 0, len - 1); */ |
| 417 | /* OBSOLETE type = */ |
| 418 | /* OBSOLETE create_array_type ((struct type *) NULL, builtin_type_int, range_type); */ |
| 419 | /* OBSOLETE val = allocate_value (type); */ |
| 420 | /* OBSOLETE p = (long *) VALUE_CONTENTS (val); */ |
| 421 | /* OBSOLETE for (i = 0; i < len; i++) */ |
| 422 | /* OBSOLETE *p++ = !! (vm[3 - (i >> 5)] & (1 << (i & 037))); */ |
| 423 | /* OBSOLETE } */ |
| 424 | /* OBSOLETE else if (name[0] == 'V') */ |
| 425 | /* OBSOLETE { */ |
| 426 | /* OBSOLETE range_type = */ |
| 427 | /* OBSOLETE create_range_type ((struct type *) NULL, builtin_type_int 0, len - 1); */ |
| 428 | /* OBSOLETE type = */ |
| 429 | /* OBSOLETE create_array_type ((struct type *) NULL, builtin_type_long_long, */ |
| 430 | /* OBSOLETE range_type); */ |
| 431 | /* OBSOLETE val = allocate_value (type); */ |
| 432 | /* OBSOLETE memcpy (VALUE_CONTENTS (val), */ |
| 433 | /* OBSOLETE read_vector_register_1 (name[1] - '0'), */ |
| 434 | /* OBSOLETE TYPE_LENGTH (type)); */ |
| 435 | /* OBSOLETE } */ |
| 436 | /* OBSOLETE else if (name[0] == 'v') */ |
| 437 | /* OBSOLETE { */ |
| 438 | /* OBSOLETE long *p1, *p2; */ |
| 439 | /* OBSOLETE range_type = */ |
| 440 | /* OBSOLETE create_range_type ((struct type *) NULL, builtin_type_int 0, len - 1); */ |
| 441 | /* OBSOLETE type = */ |
| 442 | /* OBSOLETE create_array_type ((struct type *) NULL, builtin_type_long, */ |
| 443 | /* OBSOLETE range_type); */ |
| 444 | /* OBSOLETE val = allocate_value (type); */ |
| 445 | /* OBSOLETE p1 = read_vector_register_1 (name[1] - '0'); */ |
| 446 | /* OBSOLETE p2 = (long *) VALUE_CONTENTS (val); */ |
| 447 | /* OBSOLETE while (--len >= 0) {p1++; *p2++ = *p1++;} */ |
| 448 | /* OBSOLETE } */ |
| 449 | /* OBSOLETE */ |
| 450 | /* OBSOLETE else if (name[0] == 'c') */ |
| 451 | /* OBSOLETE val = value_from_longest (builtin_type_int, */ |
| 452 | /* OBSOLETE read_comm_register (atoi (&name[1]))); */ |
| 453 | /* OBSOLETE else if (name[0] == 'C') */ |
| 454 | /* OBSOLETE val = value_from_longest (builtin_type_long_long, */ |
| 455 | /* OBSOLETE read_comm_register (atoi (&name[1]))); */ |
| 456 | /* OBSOLETE */ |
| 457 | /* OBSOLETE VALUE_LVAL (val) = lval_internalvar; */ |
| 458 | /* OBSOLETE VALUE_INTERNALVAR (val) = var; */ |
| 459 | /* OBSOLETE return val; */ |
| 460 | /* OBSOLETE } */ |
| 461 | /* OBSOLETE */ |
| 462 | /* OBSOLETE /* Handle a new value assigned to a trapped internal variable *x/ */ |
| 463 | /* OBSOLETE */ |
| 464 | /* OBSOLETE void */ |
| 465 | /* OBSOLETE set_trapped_internalvar (var, val, bitpos, bitsize, offset) */ |
| 466 | /* OBSOLETE struct internalvar *var; */ |
| 467 | /* OBSOLETE value val; */ |
| 468 | /* OBSOLETE int bitpos, bitsize, offset; */ |
| 469 | /* OBSOLETE { */ |
| 470 | /* OBSOLETE char *name = var->name; */ |
| 471 | /* OBSOLETE long long newval = value_as_long (val); */ |
| 472 | /* OBSOLETE */ |
| 473 | /* OBSOLETE if (STREQ (name, "vl")) */ |
| 474 | /* OBSOLETE write_vector_register (VL_REGNUM, 0, newval); */ |
| 475 | /* OBSOLETE else if (STREQ (name, "vs")) */ |
| 476 | /* OBSOLETE write_vector_register (VS_REGNUM, 0, newval); */ |
| 477 | /* OBSOLETE else if (name[0] == 'c' || name[0] == 'C') */ |
| 478 | /* OBSOLETE write_comm_register (atoi (&name[1]), newval); */ |
| 479 | /* OBSOLETE else if (STREQ (name, "vm")) */ |
| 480 | /* OBSOLETE error ("can't assign to $vm"); */ |
| 481 | /* OBSOLETE else */ |
| 482 | /* OBSOLETE { */ |
| 483 | /* OBSOLETE offset /= bitsize / 8; */ |
| 484 | /* OBSOLETE write_vector_register (name[1] - '0', offset, newval); */ |
| 485 | /* OBSOLETE } */ |
| 486 | /* OBSOLETE } */ |
| 487 | /* OBSOLETE */ |
| 488 | /* OBSOLETE /* Print an integer value when no format was specified. gdb normally */ |
| 489 | /* OBSOLETE prints these values in decimal, but the the leading 0x80000000 of */ |
| 490 | /* OBSOLETE pointers produces intolerable 10-digit negative numbers. */ |
| 491 | /* OBSOLETE If it looks like an address, print it in hex instead. *x/ */ |
| 492 | /* OBSOLETE */ |
| 493 | /* OBSOLETE decout (stream, type, val) */ |
| 494 | /* OBSOLETE struct ui_file *stream; */ |
| 495 | /* OBSOLETE struct type *type; */ |
| 496 | /* OBSOLETE LONGEST val; */ |
| 497 | /* OBSOLETE { */ |
| 498 | /* OBSOLETE long lv = val; */ |
| 499 | /* OBSOLETE */ |
| 500 | /* OBSOLETE switch (output_radix) */ |
| 501 | /* OBSOLETE { */ |
| 502 | /* OBSOLETE case 0: */ |
| 503 | /* OBSOLETE if ((lv == val || (unsigned) lv == val) */ |
| 504 | /* OBSOLETE && ((lv & 0xf0000000) == 0x80000000 */ |
| 505 | /* OBSOLETE || ((lv & 0xf0000000) == 0xf0000000 && lv < STACK_END_ADDR))) */ |
| 506 | /* OBSOLETE { */ |
| 507 | /* OBSOLETE print_longest (stream, "x", 0, val); */ |
| 508 | /* OBSOLETE return; */ |
| 509 | /* OBSOLETE } */ |
| 510 | /* OBSOLETE */ |
| 511 | /* OBSOLETE case 10: */ |
| 512 | /* OBSOLETE print_longest (stream, TYPE_UNSIGNED (type) ? "u" : "d", 0, val); */ |
| 513 | /* OBSOLETE return; */ |
| 514 | /* OBSOLETE */ |
| 515 | /* OBSOLETE case 8: */ |
| 516 | /* OBSOLETE print_longest (stream, "o", 0, val); */ |
| 517 | /* OBSOLETE return; */ |
| 518 | /* OBSOLETE */ |
| 519 | /* OBSOLETE case 16: */ |
| 520 | /* OBSOLETE print_longest (stream, "x", 0, val); */ |
| 521 | /* OBSOLETE return; */ |
| 522 | /* OBSOLETE } */ |
| 523 | /* OBSOLETE } */ |
| 524 | /* OBSOLETE */ |
| 525 | /* OBSOLETE /* Change the default output radix to 10 or 16, or set it to 0 (heuristic). */ |
| 526 | /* OBSOLETE This command is mostly obsolete now that the print command allows */ |
| 527 | /* OBSOLETE formats to apply to aggregates, but is still handy occasionally. *x/ */ |
| 528 | /* OBSOLETE */ |
| 529 | /* OBSOLETE static void */ |
| 530 | /* OBSOLETE set_base_command (arg) */ |
| 531 | /* OBSOLETE char *arg; */ |
| 532 | /* OBSOLETE { */ |
| 533 | /* OBSOLETE int new_radix; */ |
| 534 | /* OBSOLETE */ |
| 535 | /* OBSOLETE if (!arg) */ |
| 536 | /* OBSOLETE output_radix = 0; */ |
| 537 | /* OBSOLETE else */ |
| 538 | /* OBSOLETE { */ |
| 539 | /* OBSOLETE new_radix = atoi (arg); */ |
| 540 | /* OBSOLETE if (new_radix != 10 && new_radix != 16 && new_radix != 8) */ |
| 541 | /* OBSOLETE error ("base must be 8, 10 or 16, or null"); */ |
| 542 | /* OBSOLETE else output_radix = new_radix; */ |
| 543 | /* OBSOLETE } */ |
| 544 | /* OBSOLETE } */ |
| 545 | /* OBSOLETE */ |
| 546 | /* OBSOLETE /* Turn pipelining on or off in the inferior. *x/ */ |
| 547 | /* OBSOLETE */ |
| 548 | /* OBSOLETE static void */ |
| 549 | /* OBSOLETE set_pipelining_command (arg) */ |
| 550 | /* OBSOLETE char *arg; */ |
| 551 | /* OBSOLETE { */ |
| 552 | /* OBSOLETE if (!arg) */ |
| 553 | /* OBSOLETE { */ |
| 554 | /* OBSOLETE sequential = !sequential; */ |
| 555 | /* OBSOLETE printf_filtered ("%s\n", sequential ? "off" : "on"); */ |
| 556 | /* OBSOLETE } */ |
| 557 | /* OBSOLETE else if (STREQ (arg, "on")) */ |
| 558 | /* OBSOLETE sequential = 0; */ |
| 559 | /* OBSOLETE else if (STREQ (arg, "off")) */ |
| 560 | /* OBSOLETE sequential = 1; */ |
| 561 | /* OBSOLETE else error ("valid args are `on', to allow instructions to overlap, or\n\ */ |
| 562 | /* OBSOLETE `off', to prevent it and thereby pinpoint exceptions."); */ |
| 563 | /* OBSOLETE } */ |
| 564 | /* OBSOLETE */ |
| 565 | /* OBSOLETE /* Enable, disable, or force parallel execution in the inferior. *x/ */ |
| 566 | /* OBSOLETE */ |
| 567 | /* OBSOLETE static void */ |
| 568 | /* OBSOLETE set_parallel_command (arg) */ |
| 569 | /* OBSOLETE char *arg; */ |
| 570 | /* OBSOLETE { */ |
| 571 | /* OBSOLETE struct rlimit rl; */ |
| 572 | /* OBSOLETE int prevparallel = parallel; */ |
| 573 | /* OBSOLETE */ |
| 574 | /* OBSOLETE if (!strncmp (arg, "fixed", strlen (arg))) */ |
| 575 | /* OBSOLETE parallel = 2; */ |
| 576 | /* OBSOLETE else if (STREQ (arg, "on")) */ |
| 577 | /* OBSOLETE parallel = 1; */ |
| 578 | /* OBSOLETE else if (STREQ (arg, "off")) */ |
| 579 | /* OBSOLETE parallel = 0; */ |
| 580 | /* OBSOLETE else error ("valid args are `on', to allow multiple threads, or\n\ */ |
| 581 | /* OBSOLETE `fixed', to force multiple threads, or\n\ */ |
| 582 | /* OBSOLETE `off', to run with one thread only."); */ |
| 583 | /* OBSOLETE */ |
| 584 | /* OBSOLETE if ((prevparallel == 0) != (parallel == 0) && inferior_pid) */ |
| 585 | /* OBSOLETE printf_filtered ("will take effect at next run.\n"); */ |
| 586 | /* OBSOLETE */ |
| 587 | /* OBSOLETE getrlimit (RLIMIT_CONCUR, &rl); */ |
| 588 | /* OBSOLETE rl.rlim_cur = parallel ? rl.rlim_max : 1; */ |
| 589 | /* OBSOLETE setrlimit (RLIMIT_CONCUR, &rl); */ |
| 590 | /* OBSOLETE */ |
| 591 | /* OBSOLETE if (inferior_pid) */ |
| 592 | /* OBSOLETE set_fixed_scheduling (inferior_pid, parallel == 2); */ |
| 593 | /* OBSOLETE } */ |
| 594 | /* OBSOLETE */ |
| 595 | /* OBSOLETE /* Add a new name for an existing command. *x/ */ |
| 596 | /* OBSOLETE */ |
| 597 | /* OBSOLETE static void */ |
| 598 | /* OBSOLETE alias_command (arg) */ |
| 599 | /* OBSOLETE char *arg; */ |
| 600 | /* OBSOLETE { */ |
| 601 | /* OBSOLETE static char *aliaserr = "usage is `alias NEW OLD', no args allowed"; */ |
| 602 | /* OBSOLETE char *newname = arg; */ |
| 603 | /* OBSOLETE struct cmd_list_element *new, *old; */ |
| 604 | /* OBSOLETE */ |
| 605 | /* OBSOLETE if (!arg) */ |
| 606 | /* OBSOLETE error_no_arg ("newname oldname"); */ |
| 607 | /* OBSOLETE */ |
| 608 | /* OBSOLETE new = lookup_cmd (&arg, cmdlist, "", -1); */ |
| 609 | /* OBSOLETE if (new && !strncmp (newname, new->name, strlen (new->name))) */ |
| 610 | /* OBSOLETE { */ |
| 611 | /* OBSOLETE newname = new->name; */ |
| 612 | /* OBSOLETE if (!(*arg == '-' */ |
| 613 | /* OBSOLETE || (*arg >= 'a' && *arg <= 'z') */ |
| 614 | /* OBSOLETE || (*arg >= 'A' && *arg <= 'Z') */ |
| 615 | /* OBSOLETE || (*arg >= '0' && *arg <= '9'))) */ |
| 616 | /* OBSOLETE error (aliaserr); */ |
| 617 | /* OBSOLETE } */ |
| 618 | /* OBSOLETE else */ |
| 619 | /* OBSOLETE { */ |
| 620 | /* OBSOLETE arg = newname; */ |
| 621 | /* OBSOLETE while (*arg == '-' */ |
| 622 | /* OBSOLETE || (*arg >= 'a' && *arg <= 'z') */ |
| 623 | /* OBSOLETE || (*arg >= 'A' && *arg <= 'Z') */ |
| 624 | /* OBSOLETE || (*arg >= '0' && *arg <= '9')) */ |
| 625 | /* OBSOLETE arg++; */ |
| 626 | /* OBSOLETE if (*arg != ' ' && *arg != '\t') */ |
| 627 | /* OBSOLETE error (aliaserr); */ |
| 628 | /* OBSOLETE *arg = '\0'; */ |
| 629 | /* OBSOLETE arg++; */ |
| 630 | /* OBSOLETE } */ |
| 631 | /* OBSOLETE */ |
| 632 | /* OBSOLETE old = lookup_cmd (&arg, cmdlist, "", 0); */ |
| 633 | /* OBSOLETE */ |
| 634 | /* OBSOLETE if (*arg != '\0') */ |
| 635 | /* OBSOLETE error (aliaserr); */ |
| 636 | /* OBSOLETE */ |
| 637 | /* OBSOLETE if (new && !strncmp (newname, new->name, strlen (new->name))) */ |
| 638 | /* OBSOLETE { */ |
| 639 | /* OBSOLETE char *tem; */ |
| 640 | /* OBSOLETE if (new->class == (int) class_user || new->class == (int) class_alias) */ |
| 641 | /* OBSOLETE tem = "Redefine command \"%s\"? "; */ |
| 642 | /* OBSOLETE else */ |
| 643 | /* OBSOLETE tem = "Really redefine built-in command \"%s\"? "; */ |
| 644 | /* OBSOLETE if (!query (tem, new->name)) */ |
| 645 | /* OBSOLETE error ("Command \"%s\" not redefined.", new->name); */ |
| 646 | /* OBSOLETE } */ |
| 647 | /* OBSOLETE */ |
| 648 | /* OBSOLETE add_com (newname, class_alias, old->function, old->doc); */ |
| 649 | /* OBSOLETE } */ |
| 650 | /* OBSOLETE */ |
| 651 | /* OBSOLETE */ |
| 652 | /* OBSOLETE */ |
| 653 | /* OBSOLETE /* Print the current thread number, and any threads with signals in the */ |
| 654 | /* OBSOLETE queue. *x/ */ |
| 655 | /* OBSOLETE */ |
| 656 | /* OBSOLETE thread_info () */ |
| 657 | /* OBSOLETE { */ |
| 658 | /* OBSOLETE struct threadpid *p; */ |
| 659 | /* OBSOLETE */ |
| 660 | /* OBSOLETE if (have_inferior_p ()) */ |
| 661 | /* OBSOLETE { */ |
| 662 | /* OBSOLETE ps.pi_buffer = (char *) &comm_registers; */ |
| 663 | /* OBSOLETE ps.pi_nbytes = sizeof comm_registers; */ |
| 664 | /* OBSOLETE ps.pi_offset = 0; */ |
| 665 | /* OBSOLETE ps.pi_thread = inferior_thread; */ |
| 666 | /* OBSOLETE ioctl (inferior_fd, PIXRDCREGS, &ps); */ |
| 667 | /* OBSOLETE } */ |
| 668 | /* OBSOLETE */ |
| 669 | /* OBSOLETE /* FIXME: stop_signal is from target.h but stop_sigcode is a */ |
| 670 | /* OBSOLETE convex-specific thing. *x/ */ |
| 671 | /* OBSOLETE printf_filtered ("Current thread %d stopped with signal %d.%d (%s).\n", */ |
| 672 | /* OBSOLETE inferior_thread, stop_signal, stop_sigcode, */ |
| 673 | /* OBSOLETE subsig_name (stop_signal, stop_sigcode)); */ |
| 674 | /* OBSOLETE */ |
| 675 | /* OBSOLETE for (p = signal_stack; p->pid; p--) */ |
| 676 | /* OBSOLETE printf_filtered ("Thread %d stopped with signal %d.%d (%s).\n", */ |
| 677 | /* OBSOLETE p->thread, p->signo, p->subsig, */ |
| 678 | /* OBSOLETE subsig_name (p->signo, p->subsig)); */ |
| 679 | /* OBSOLETE */ |
| 680 | /* OBSOLETE if (iscrlbit (comm_registers.crctl.lbits.cc, 64+13)) */ |
| 681 | /* OBSOLETE printf_filtered ("New thread start pc %#x\n", */ |
| 682 | /* OBSOLETE (long) (comm_registers.crreg.pcpsw >> 32)); */ |
| 683 | /* OBSOLETE } */ |
| 684 | /* OBSOLETE */ |
| 685 | /* OBSOLETE /* Return string describing a signal.subcode number *x/ */ |
| 686 | /* OBSOLETE */ |
| 687 | /* OBSOLETE static char * */ |
| 688 | /* OBSOLETE subsig_name (signo, subcode) */ |
| 689 | /* OBSOLETE int signo, subcode; */ |
| 690 | /* OBSOLETE { */ |
| 691 | /* OBSOLETE static char *subsig4[] = { */ |
| 692 | /* OBSOLETE "error exit", "privileged instruction", "unknown", */ |
| 693 | /* OBSOLETE "unknown", "undefined opcode", */ |
| 694 | /* OBSOLETE 0}; */ |
| 695 | /* OBSOLETE static char *subsig5[] = {0, */ |
| 696 | /* OBSOLETE "breakpoint", "single step", "fork trap", "exec trap", "pfork trap", */ |
| 697 | /* OBSOLETE "join trap", "idle trap", "last thread", "wfork trap", */ |
| 698 | /* OBSOLETE "process breakpoint", "trap instruction", */ |
| 699 | /* OBSOLETE 0}; */ |
| 700 | /* OBSOLETE static char *subsig8[] = {0, */ |
| 701 | /* OBSOLETE "int overflow", "int divide check", "float overflow", */ |
| 702 | /* OBSOLETE "float divide check", "float underflow", "reserved operand", */ |
| 703 | /* OBSOLETE "sqrt error", "exp error", "ln error", "sin error", "cos error", */ |
| 704 | /* OBSOLETE 0}; */ |
| 705 | /* OBSOLETE static char *subsig10[] = {0, */ |
| 706 | /* OBSOLETE "invalid inward ring address", "invalid outward ring call", */ |
| 707 | /* OBSOLETE "invalid inward ring return", "invalid syscall gate", */ |
| 708 | /* OBSOLETE "invalid rtn frame length", "invalid comm reg address", */ |
| 709 | /* OBSOLETE "invalid trap gate", */ |
| 710 | /* OBSOLETE 0}; */ |
| 711 | /* OBSOLETE static char *subsig11[] = {0, */ |
| 712 | /* OBSOLETE "read access denied", "write access denied", "execute access denied", */ |
| 713 | /* OBSOLETE "segment descriptor fault", "page table fault", "data reference fault", */ |
| 714 | /* OBSOLETE "i/o access denied", "levt pte invalid", */ |
| 715 | /* OBSOLETE 0}; */ |
| 716 | /* OBSOLETE */ |
| 717 | /* OBSOLETE static char **subsig_list[] = */ |
| 718 | /* OBSOLETE {0, 0, 0, 0, subsig4, subsig5, 0, 0, subsig8, 0, subsig10, subsig11, 0}; */ |
| 719 | /* OBSOLETE */ |
| 720 | /* OBSOLETE int i; */ |
| 721 | /* OBSOLETE char *p; */ |
| 722 | /* OBSOLETE */ |
| 723 | /* OBSOLETE if ((p = strsignal (signo)) == NULL) */ |
| 724 | /* OBSOLETE p = "unknown"; */ |
| 725 | /* OBSOLETE if (signo >= (sizeof subsig_list / sizeof *subsig_list) */ |
| 726 | /* OBSOLETE || !subsig_list[signo]) */ |
| 727 | /* OBSOLETE return p; */ |
| 728 | /* OBSOLETE for (i = 1; subsig_list[signo][i]; i++) */ |
| 729 | /* OBSOLETE if (i == subcode) */ |
| 730 | /* OBSOLETE return subsig_list[signo][subcode]; */ |
| 731 | /* OBSOLETE return p; */ |
| 732 | /* OBSOLETE } */ |
| 733 | /* OBSOLETE */ |
| 734 | /* OBSOLETE */ |
| 735 | /* OBSOLETE /* Print a compact display of thread status, essentially x/i $pc */ |
| 736 | /* OBSOLETE for all active threads. *x/ */ |
| 737 | /* OBSOLETE */ |
| 738 | /* OBSOLETE static void */ |
| 739 | /* OBSOLETE threadstat () */ |
| 740 | /* OBSOLETE { */ |
| 741 | /* OBSOLETE int t; */ |
| 742 | /* OBSOLETE */ |
| 743 | /* OBSOLETE for (t = 0; t < n_threads; t++) */ |
| 744 | /* OBSOLETE if (thread_state[t] == PI_TALIVE) */ |
| 745 | /* OBSOLETE { */ |
| 746 | /* OBSOLETE printf_filtered ("%d%c %08x%c %d.%d ", t, */ |
| 747 | /* OBSOLETE (t == inferior_thread ? '*' : ' '), thread_pc[t], */ |
| 748 | /* OBSOLETE (thread_is_in_kernel[t] ? '#' : ' '), */ |
| 749 | /* OBSOLETE thread_signal[t], thread_sigcode[t]); */ |
| 750 | /* OBSOLETE print_insn (thread_pc[t], stdout); */ |
| 751 | /* OBSOLETE printf_filtered ("\n"); */ |
| 752 | /* OBSOLETE } */ |
| 753 | /* OBSOLETE } */ |
| 754 | /* OBSOLETE */ |
| 755 | /* OBSOLETE /* Change the current thread to ARG. *x/ */ |
| 756 | /* OBSOLETE */ |
| 757 | /* OBSOLETE set_thread_command (arg) */ |
| 758 | /* OBSOLETE char *arg; */ |
| 759 | /* OBSOLETE { */ |
| 760 | /* OBSOLETE int thread; */ |
| 761 | /* OBSOLETE */ |
| 762 | /* OBSOLETE if (!arg) */ |
| 763 | /* OBSOLETE { */ |
| 764 | /* OBSOLETE threadstat (); */ |
| 765 | /* OBSOLETE return; */ |
| 766 | /* OBSOLETE } */ |
| 767 | /* OBSOLETE */ |
| 768 | /* OBSOLETE thread = parse_and_eval_address (arg); */ |
| 769 | /* OBSOLETE */ |
| 770 | /* OBSOLETE if (thread < 0 || thread > n_threads || thread_state[thread] != PI_TALIVE) */ |
| 771 | /* OBSOLETE error ("no such thread."); */ |
| 772 | /* OBSOLETE */ |
| 773 | /* OBSOLETE select_thread (thread); */ |
| 774 | /* OBSOLETE */ |
| 775 | /* OBSOLETE stop_pc = read_pc (); */ |
| 776 | /* OBSOLETE flush_cached_frames (); */ |
| 777 | /* OBSOLETE select_frame (get_current_frame (), 0); */ |
| 778 | /* OBSOLETE print_stack_frame (selected_frame, selected_frame_level, -1); */ |
| 779 | /* OBSOLETE } */ |
| 780 | /* OBSOLETE */ |
| 781 | /* OBSOLETE /* Here on CONT command; gdb's dispatch address is changed to come here. */ |
| 782 | /* OBSOLETE Set global variable ALL_CONTINUE to tell resume() that it should */ |
| 783 | /* OBSOLETE start up all threads, and that a thread switch will not blow gdb's */ |
| 784 | /* OBSOLETE mind. *x/ */ |
| 785 | /* OBSOLETE */ |
| 786 | /* OBSOLETE static void */ |
| 787 | /* OBSOLETE convex_cont_command (proc_count_exp, from_tty) */ |
| 788 | /* OBSOLETE char *proc_count_exp; */ |
| 789 | /* OBSOLETE int from_tty; */ |
| 790 | /* OBSOLETE { */ |
| 791 | /* OBSOLETE all_continue = 1; */ |
| 792 | /* OBSOLETE cont_command (proc_count_exp, from_tty); */ |
| 793 | /* OBSOLETE } */ |
| 794 | /* OBSOLETE */ |
| 795 | /* OBSOLETE /* Here on 1CONT command. Resume only the current thread. *x/ */ |
| 796 | /* OBSOLETE */ |
| 797 | /* OBSOLETE one_cont_command (proc_count_exp, from_tty) */ |
| 798 | /* OBSOLETE char *proc_count_exp; */ |
| 799 | /* OBSOLETE int from_tty; */ |
| 800 | /* OBSOLETE { */ |
| 801 | /* OBSOLETE cont_command (proc_count_exp, from_tty); */ |
| 802 | /* OBSOLETE } */ |
| 803 | /* OBSOLETE */ |
| 804 | /* OBSOLETE /* Print the contents and lock bits of all communication registers, */ |
| 805 | /* OBSOLETE or just register ARG if ARG is a communication register, */ |
| 806 | /* OBSOLETE or the 3-word resource structure in memory at address ARG. *x/ */ |
| 807 | /* OBSOLETE */ |
| 808 | /* OBSOLETE comm_registers_info (arg) */ |
| 809 | /* OBSOLETE char *arg; */ |
| 810 | /* OBSOLETE { */ |
| 811 | /* OBSOLETE int i, regnum; */ |
| 812 | /* OBSOLETE */ |
| 813 | /* OBSOLETE if (arg) */ |
| 814 | /* OBSOLETE { */ |
| 815 | /* OBSOLETE if (sscanf (arg, "$c%d", ®num) == 1) { */ |
| 816 | /* OBSOLETE ; */ |
| 817 | /* OBSOLETE } else if (sscanf (arg, "$C%d", ®num) == 1) { */ |
| 818 | /* OBSOLETE ; */ |
| 819 | /* OBSOLETE } else { */ |
| 820 | /* OBSOLETE regnum = parse_and_eval_address (arg); */ |
| 821 | /* OBSOLETE if (regnum > 0) */ |
| 822 | /* OBSOLETE regnum &= ~0x8000; */ |
| 823 | /* OBSOLETE } */ |
| 824 | /* OBSOLETE */ |
| 825 | /* OBSOLETE if (regnum >= 64) */ |
| 826 | /* OBSOLETE error ("%s: invalid register name.", arg); */ |
| 827 | /* OBSOLETE */ |
| 828 | /* OBSOLETE /* if we got a (user) address, examine the resource struct there *x/ */ |
| 829 | /* OBSOLETE */ |
| 830 | /* OBSOLETE if (regnum < 0) */ |
| 831 | /* OBSOLETE { */ |
| 832 | /* OBSOLETE static int buf[3]; */ |
| 833 | /* OBSOLETE read_memory (regnum, buf, sizeof buf); */ |
| 834 | /* OBSOLETE printf_filtered ("%08x %08x%08x%s\n", regnum, buf[1], buf[2], */ |
| 835 | /* OBSOLETE buf[0] & 0xff ? " locked" : ""); */ |
| 836 | /* OBSOLETE return; */ |
| 837 | /* OBSOLETE } */ |
| 838 | /* OBSOLETE } */ |
| 839 | /* OBSOLETE */ |
| 840 | /* OBSOLETE ps.pi_buffer = (char *) &comm_registers; */ |
| 841 | /* OBSOLETE ps.pi_nbytes = sizeof comm_registers; */ |
| 842 | /* OBSOLETE ps.pi_offset = 0; */ |
| 843 | /* OBSOLETE ps.pi_thread = inferior_thread; */ |
| 844 | /* OBSOLETE ioctl (inferior_fd, PIXRDCREGS, &ps); */ |
| 845 | /* OBSOLETE */ |
| 846 | /* OBSOLETE for (i = 0; i < 64; i++) */ |
| 847 | /* OBSOLETE if (!arg || i == regnum) */ |
| 848 | /* OBSOLETE printf_filtered ("%2d 0x8%03x %016llx%s\n", i, i, */ |
| 849 | /* OBSOLETE comm_registers.crreg.r4[i], */ |
| 850 | /* OBSOLETE (iscrlbit (comm_registers.crctl.lbits.cc, i) */ |
| 851 | /* OBSOLETE ? " locked" : "")); */ |
| 852 | /* OBSOLETE } */ |
| 853 | /* OBSOLETE */ |
| 854 | /* OBSOLETE /* Print the psw *x/ */ |
| 855 | /* OBSOLETE */ |
| 856 | /* OBSOLETE static void */ |
| 857 | /* OBSOLETE psw_info (arg) */ |
| 858 | /* OBSOLETE char *arg; */ |
| 859 | /* OBSOLETE { */ |
| 860 | /* OBSOLETE struct pswbit */ |
| 861 | /* OBSOLETE { */ |
| 862 | /* OBSOLETE int bit; */ |
| 863 | /* OBSOLETE int pos; */ |
| 864 | /* OBSOLETE char *text; */ |
| 865 | /* OBSOLETE }; */ |
| 866 | /* OBSOLETE */ |
| 867 | /* OBSOLETE static struct pswbit pswbit[] = */ |
| 868 | /* OBSOLETE { */ |
| 869 | /* OBSOLETE { 0x80000000, -1, "A carry" }, */ |
| 870 | /* OBSOLETE { 0x40000000, -1, "A integer overflow" }, */ |
| 871 | /* OBSOLETE { 0x20000000, -1, "A zero divide" }, */ |
| 872 | /* OBSOLETE { 0x10000000, -1, "Integer overflow enable" }, */ |
| 873 | /* OBSOLETE { 0x08000000, -1, "Trace" }, */ |
| 874 | /* OBSOLETE { 0x06000000, 25, "Frame length" }, */ |
| 875 | /* OBSOLETE { 0x01000000, -1, "Sequential" }, */ |
| 876 | /* OBSOLETE { 0x00800000, -1, "S carry" }, */ |
| 877 | /* OBSOLETE { 0x00400000, -1, "S integer overflow" }, */ |
| 878 | /* OBSOLETE { 0x00200000, -1, "S zero divide" }, */ |
| 879 | /* OBSOLETE { 0x00100000, -1, "Zero divide enable" }, */ |
| 880 | /* OBSOLETE { 0x00080000, -1, "Floating underflow" }, */ |
| 881 | /* OBSOLETE { 0x00040000, -1, "Floating overflow" }, */ |
| 882 | /* OBSOLETE { 0x00020000, -1, "Floating reserved operand" }, */ |
| 883 | /* OBSOLETE { 0x00010000, -1, "Floating zero divide" }, */ |
| 884 | /* OBSOLETE { 0x00008000, -1, "Floating error enable" }, */ |
| 885 | /* OBSOLETE { 0x00004000, -1, "Floating underflow enable" }, */ |
| 886 | /* OBSOLETE { 0x00002000, -1, "IEEE" }, */ |
| 887 | /* OBSOLETE { 0x00001000, -1, "Sequential stores" }, */ |
| 888 | /* OBSOLETE { 0x00000800, -1, "Intrinsic error" }, */ |
| 889 | /* OBSOLETE { 0x00000400, -1, "Intrinsic error enable" }, */ |
| 890 | /* OBSOLETE { 0x00000200, -1, "Trace thread creates" }, */ |
| 891 | /* OBSOLETE { 0x00000100, -1, "Thread init trap" }, */ |
| 892 | /* OBSOLETE { 0x000000e0, 5, "Reserved" }, */ |
| 893 | /* OBSOLETE { 0x0000001f, 0, "Intrinsic error code" }, */ |
| 894 | /* OBSOLETE {0, 0, 0}, */ |
| 895 | /* OBSOLETE }; */ |
| 896 | /* OBSOLETE */ |
| 897 | /* OBSOLETE long psw; */ |
| 898 | /* OBSOLETE struct pswbit *p; */ |
| 899 | /* OBSOLETE */ |
| 900 | /* OBSOLETE if (arg) */ |
| 901 | /* OBSOLETE psw = parse_and_eval_address (arg); */ |
| 902 | /* OBSOLETE else */ |
| 903 | /* OBSOLETE psw = read_register (PS_REGNUM); */ |
| 904 | /* OBSOLETE */ |
| 905 | /* OBSOLETE for (p = pswbit; p->bit; p++) */ |
| 906 | /* OBSOLETE { */ |
| 907 | /* OBSOLETE if (p->pos < 0) */ |
| 908 | /* OBSOLETE printf_filtered ("%08x %s %s\n", p->bit, */ |
| 909 | /* OBSOLETE (psw & p->bit) ? "yes" : "no ", p->text); */ |
| 910 | /* OBSOLETE else */ |
| 911 | /* OBSOLETE printf_filtered ("%08x %3d %s\n", p->bit, */ |
| 912 | /* OBSOLETE (psw & p->bit) >> p->pos, p->text); */ |
| 913 | /* OBSOLETE } */ |
| 914 | /* OBSOLETE } */ |
| 915 | /* OBSOLETE \f */ |
| 916 | /* OBSOLETE #include "symtab.h" */ |
| 917 | /* OBSOLETE */ |
| 918 | /* OBSOLETE /* reg (fmt_field, inst_field) -- */ |
| 919 | /* OBSOLETE the {first,second,third} operand of instruction as fmt_field = [ijk] */ |
| 920 | /* OBSOLETE gets the value of the field from the [ijk] position of the instruction *x/ */ |
| 921 | /* OBSOLETE */ |
| 922 | /* OBSOLETE #define reg(a,b) ((char (*)[3])(op[fmt->a]))[inst.f0.b] */ |
| 923 | /* OBSOLETE */ |
| 924 | /* OBSOLETE /* lit (fmt_field) -- field [ijk] is a literal (PSW, VL, eg) *x/ */ |
| 925 | /* OBSOLETE */ |
| 926 | /* OBSOLETE #define lit(i) op[fmt->i] */ |
| 927 | /* OBSOLETE */ |
| 928 | /* OBSOLETE /* aj[j] -- name for A register j *x/ */ |
| 929 | /* OBSOLETE */ |
| 930 | /* OBSOLETE #define aj ((char (*)[3])(op[A])) */ |
| 931 | /* OBSOLETE \f */ |
| 932 | /* OBSOLETE union inst { */ |
| 933 | /* OBSOLETE struct { */ |
| 934 | /* OBSOLETE unsigned : 7; */ |
| 935 | /* OBSOLETE unsigned i : 3; */ |
| 936 | /* OBSOLETE unsigned j : 3; */ |
| 937 | /* OBSOLETE unsigned k : 3; */ |
| 938 | /* OBSOLETE unsigned : 16; */ |
| 939 | /* OBSOLETE unsigned : 32; */ |
| 940 | /* OBSOLETE } f0; */ |
| 941 | /* OBSOLETE struct { */ |
| 942 | /* OBSOLETE unsigned : 8; */ |
| 943 | /* OBSOLETE unsigned indir : 1; */ |
| 944 | /* OBSOLETE unsigned len : 1; */ |
| 945 | /* OBSOLETE unsigned j : 3; */ |
| 946 | /* OBSOLETE unsigned k : 3; */ |
| 947 | /* OBSOLETE unsigned : 16; */ |
| 948 | /* OBSOLETE unsigned : 32; */ |
| 949 | /* OBSOLETE } f1; */ |
| 950 | /* OBSOLETE unsigned char byte[8]; */ |
| 951 | /* OBSOLETE unsigned short half[4]; */ |
| 952 | /* OBSOLETE char signed_byte[8]; */ |
| 953 | /* OBSOLETE short signed_half[4]; */ |
| 954 | /* OBSOLETE }; */ |
| 955 | /* OBSOLETE */ |
| 956 | /* OBSOLETE struct opform { */ |
| 957 | /* OBSOLETE int mask; /* opcode mask *x/ */ |
| 958 | /* OBSOLETE int shift; /* opcode align *x/ */ |
| 959 | /* OBSOLETE struct formstr *formstr[3]; /* ST, E0, E1 *x/ */ |
| 960 | /* OBSOLETE }; */ |
| 961 | /* OBSOLETE */ |
| 962 | /* OBSOLETE struct formstr { */ |
| 963 | /* OBSOLETE unsigned lop:8, rop:5; /* opcode *x/ */ |
| 964 | /* OBSOLETE unsigned fmt:5; /* inst format *x/ */ |
| 965 | /* OBSOLETE unsigned i:5, j:5, k:2; /* operand formats *x/ */ |
| 966 | /* OBSOLETE }; */ |
| 967 | /* OBSOLETE */ |
| 968 | /* OBSOLETE #include "opcode/convex.h" */ |
| 969 | /* OBSOLETE */ |
| 970 | /* OBSOLETE CONST unsigned char formdecode [] = { */ |
| 971 | /* OBSOLETE 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, */ |
| 972 | /* OBSOLETE 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, */ |
| 973 | /* OBSOLETE 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, */ |
| 974 | /* OBSOLETE 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, */ |
| 975 | /* OBSOLETE 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, */ |
| 976 | /* OBSOLETE 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, */ |
| 977 | /* OBSOLETE 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, */ |
| 978 | /* OBSOLETE 4,4,4,4,4,4,4,4,5,5,5,5,6,6,7,8, */ |
| 979 | /* OBSOLETE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, */ |
| 980 | /* OBSOLETE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, */ |
| 981 | /* OBSOLETE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, */ |
| 982 | /* OBSOLETE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, */ |
| 983 | /* OBSOLETE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, */ |
| 984 | /* OBSOLETE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, */ |
| 985 | /* OBSOLETE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, */ |
| 986 | /* OBSOLETE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, */ |
| 987 | /* OBSOLETE }; */ |
| 988 | /* OBSOLETE */ |
| 989 | /* OBSOLETE CONST struct opform opdecode[] = { */ |
| 990 | /* OBSOLETE 0x7e00, 9, format0, e0_format0, e1_format0, */ |
| 991 | /* OBSOLETE 0x3f00, 8, format1, e0_format1, e1_format1, */ |
| 992 | /* OBSOLETE 0x1fc0, 6, format2, e0_format2, e1_format2, */ |
| 993 | /* OBSOLETE 0x0fc0, 6, format3, e0_format3, e1_format3, */ |
| 994 | /* OBSOLETE 0x0700, 8, format4, e0_format4, e1_format4, */ |
| 995 | /* OBSOLETE 0x03c0, 6, format5, e0_format5, e1_format5, */ |
| 996 | /* OBSOLETE 0x01f8, 3, format6, e0_format6, e1_format6, */ |
| 997 | /* OBSOLETE 0x00f8, 3, format7, e0_format7, e1_format7, */ |
| 998 | /* OBSOLETE 0x0000, 0, formatx, formatx, formatx, */ |
| 999 | /* OBSOLETE 0x0f80, 7, formatx, formatx, formatx, */ |
| 1000 | /* OBSOLETE 0x0f80, 7, formatx, formatx, formatx, */ |
| 1001 | /* OBSOLETE }; */ |
| 1002 | /* OBSOLETE \f */ |
| 1003 | /* OBSOLETE /* Print the instruction at address MEMADDR in debugged memory, */ |
| 1004 | /* OBSOLETE on STREAM. Returns length of the instruction, in bytes. *x/ */ |
| 1005 | /* OBSOLETE */ |
| 1006 | /* OBSOLETE int */ |
| 1007 | /* OBSOLETE convex_print_insn (memaddr, stream) */ |
| 1008 | /* OBSOLETE CORE_ADDR memaddr; */ |
| 1009 | /* OBSOLETE FILE *stream; */ |
| 1010 | /* OBSOLETE { */ |
| 1011 | /* OBSOLETE union inst inst; */ |
| 1012 | /* OBSOLETE struct formstr *fmt; */ |
| 1013 | /* OBSOLETE register int format, op1, pfx; */ |
| 1014 | /* OBSOLETE int l; */ |
| 1015 | /* OBSOLETE */ |
| 1016 | /* OBSOLETE read_memory (memaddr, &inst, sizeof inst); */ |
| 1017 | /* OBSOLETE */ |
| 1018 | /* OBSOLETE /* Remove and note prefix, if present *x/ */ |
| 1019 | /* OBSOLETE */ |
| 1020 | /* OBSOLETE pfx = inst.half[0]; */ |
| 1021 | /* OBSOLETE if ((pfx & 0xfff0) == 0x7ef0) */ |
| 1022 | /* OBSOLETE { */ |
| 1023 | /* OBSOLETE pfx = ((pfx >> 3) & 1) + 1; */ |
| 1024 | /* OBSOLETE *(long long *) &inst = *(long long *) &inst.half[1]; */ |
| 1025 | /* OBSOLETE } */ |
| 1026 | /* OBSOLETE else pfx = 0; */ |
| 1027 | /* OBSOLETE */ |
| 1028 | /* OBSOLETE /* Split opcode into format.op1 and look up in appropriate table *x/ */ |
| 1029 | /* OBSOLETE */ |
| 1030 | /* OBSOLETE format = formdecode[inst.byte[0]]; */ |
| 1031 | /* OBSOLETE op1 = (inst.half[0] & opdecode[format].mask) >> opdecode[format].shift; */ |
| 1032 | /* OBSOLETE if (format == 9) */ |
| 1033 | /* OBSOLETE { */ |
| 1034 | /* OBSOLETE if (pfx) */ |
| 1035 | /* OBSOLETE fmt = formatx; */ |
| 1036 | /* OBSOLETE else if (inst.f1.j == 0) */ |
| 1037 | /* OBSOLETE fmt = &format1a[op1]; */ |
| 1038 | /* OBSOLETE else if (inst.f1.j == 1) */ |
| 1039 | /* OBSOLETE fmt = &format1b[op1]; */ |
| 1040 | /* OBSOLETE else */ |
| 1041 | /* OBSOLETE fmt = formatx; */ |
| 1042 | /* OBSOLETE } */ |
| 1043 | /* OBSOLETE else */ |
| 1044 | /* OBSOLETE fmt = &opdecode[format].formstr[pfx][op1]; */ |
| 1045 | /* OBSOLETE */ |
| 1046 | /* OBSOLETE /* Print it *x/ */ |
| 1047 | /* OBSOLETE */ |
| 1048 | /* OBSOLETE if (fmt->fmt == xxx) */ |
| 1049 | /* OBSOLETE { */ |
| 1050 | /* OBSOLETE /* noninstruction *x/ */ |
| 1051 | /* OBSOLETE fprintf (stream, "0x%04x", pfx ? pfx : inst.half[0]); */ |
| 1052 | /* OBSOLETE return 2; */ |
| 1053 | /* OBSOLETE } */ |
| 1054 | /* OBSOLETE */ |
| 1055 | /* OBSOLETE if (pfx) */ |
| 1056 | /* OBSOLETE pfx = 2; */ |
| 1057 | /* OBSOLETE */ |
| 1058 | /* OBSOLETE fprintf (stream, "%s%s%s", lop[fmt->lop], rop[fmt->rop], */ |
| 1059 | /* OBSOLETE &" "[strlen(lop[fmt->lop]) + strlen(rop[fmt->rop])]); */ |
| 1060 | /* OBSOLETE */ |
| 1061 | /* OBSOLETE switch (fmt->fmt) */ |
| 1062 | /* OBSOLETE { */ |
| 1063 | /* OBSOLETE case rrr: /* three register *x/ */ |
| 1064 | /* OBSOLETE fprintf (stream, "%s,%s,%s", reg(i,i), reg(j,j), reg(k,k)); */ |
| 1065 | /* OBSOLETE return pfx + 2; */ |
| 1066 | /* OBSOLETE */ |
| 1067 | /* OBSOLETE case rr: /* two register *x/ */ |
| 1068 | /* OBSOLETE fprintf (stream, "%s,%s", reg(i,j), reg(j,k)); */ |
| 1069 | /* OBSOLETE return pfx + 2; */ |
| 1070 | /* OBSOLETE */ |
| 1071 | /* OBSOLETE case rxr: /* two register, reversed i and j fields *x/ */ |
| 1072 | /* OBSOLETE fprintf (stream, "%s,%s", reg(i,k), reg(j,j)); */ |
| 1073 | /* OBSOLETE return pfx + 2; */ |
| 1074 | /* OBSOLETE */ |
| 1075 | /* OBSOLETE case r: /* one register *x/ */ |
| 1076 | /* OBSOLETE fprintf (stream, "%s", reg(i,k)); */ |
| 1077 | /* OBSOLETE return pfx + 2; */ |
| 1078 | /* OBSOLETE */ |
| 1079 | /* OBSOLETE case nops: /* no operands *x/ */ |
| 1080 | /* OBSOLETE return pfx + 2; */ |
| 1081 | /* OBSOLETE */ |
| 1082 | /* OBSOLETE case nr: /* short immediate, one register *x/ */ |
| 1083 | /* OBSOLETE fprintf (stream, "#%d,%s", inst.f0.j, reg(i,k)); */ |
| 1084 | /* OBSOLETE return pfx + 2; */ |
| 1085 | /* OBSOLETE */ |
| 1086 | /* OBSOLETE case pcrel: /* pc relative *x/ */ |
| 1087 | /* OBSOLETE print_address (memaddr + 2 * inst.signed_byte[1], stream); */ |
| 1088 | /* OBSOLETE return pfx + 2; */ |
| 1089 | /* OBSOLETE */ |
| 1090 | /* OBSOLETE case lr: /* literal, one register *x/ */ |
| 1091 | /* OBSOLETE fprintf (stream, "%s,%s", lit(i), reg(j,k)); */ |
| 1092 | /* OBSOLETE return pfx + 2; */ |
| 1093 | /* OBSOLETE */ |
| 1094 | /* OBSOLETE case rxl: /* one register, literal *x/ */ |
| 1095 | /* OBSOLETE fprintf (stream, "%s,%s", reg(i,k), lit(j)); */ |
| 1096 | /* OBSOLETE return pfx + 2; */ |
| 1097 | /* OBSOLETE */ |
| 1098 | /* OBSOLETE case rlr: /* register, literal, register *x/ */ |
| 1099 | /* OBSOLETE fprintf (stream, "%s,%s,%s", reg(i,j), lit(j), reg(k,k)); */ |
| 1100 | /* OBSOLETE return pfx + 2; */ |
| 1101 | /* OBSOLETE */ |
| 1102 | /* OBSOLETE case rrl: /* register, register, literal *x/ */ |
| 1103 | /* OBSOLETE fprintf (stream, "%s,%s,%s", reg(i,j), reg(j,k), lit(k)); */ |
| 1104 | /* OBSOLETE return pfx + 2; */ |
| 1105 | /* OBSOLETE */ |
| 1106 | /* OBSOLETE case iml: /* immediate, literal *x/ */ |
| 1107 | /* OBSOLETE if (inst.f1.len) */ |
| 1108 | /* OBSOLETE { */ |
| 1109 | /* OBSOLETE fprintf (stream, "#%#x,%s", */ |
| 1110 | /* OBSOLETE (inst.signed_half[1] << 16) + inst.half[2], lit(i)); */ |
| 1111 | /* OBSOLETE return pfx + 6; */ |
| 1112 | /* OBSOLETE } */ |
| 1113 | /* OBSOLETE else */ |
| 1114 | /* OBSOLETE { */ |
| 1115 | /* OBSOLETE fprintf (stream, "#%d,%s", inst.signed_half[1], lit(i)); */ |
| 1116 | /* OBSOLETE return pfx + 4; */ |
| 1117 | /* OBSOLETE } */ |
| 1118 | /* OBSOLETE */ |
| 1119 | /* OBSOLETE case imr: /* immediate, register *x/ */ |
| 1120 | /* OBSOLETE if (inst.f1.len) */ |
| 1121 | /* OBSOLETE { */ |
| 1122 | /* OBSOLETE fprintf (stream, "#%#x,%s", */ |
| 1123 | /* OBSOLETE (inst.signed_half[1] << 16) + inst.half[2], reg(i,k)); */ |
| 1124 | /* OBSOLETE return pfx + 6; */ |
| 1125 | /* OBSOLETE } */ |
| 1126 | /* OBSOLETE else */ |
| 1127 | /* OBSOLETE { */ |
| 1128 | /* OBSOLETE fprintf (stream, "#%d,%s", inst.signed_half[1], reg(i,k)); */ |
| 1129 | /* OBSOLETE return pfx + 4; */ |
| 1130 | /* OBSOLETE } */ |
| 1131 | /* OBSOLETE */ |
| 1132 | /* OBSOLETE case a1r: /* memory, register *x/ */ |
| 1133 | /* OBSOLETE l = print_effa (inst, stream); */ |
| 1134 | /* OBSOLETE fprintf (stream, ",%s", reg(i,k)); */ |
| 1135 | /* OBSOLETE return pfx + l; */ |
| 1136 | /* OBSOLETE */ |
| 1137 | /* OBSOLETE case a1l: /* memory, literal *x/ */ |
| 1138 | /* OBSOLETE l = print_effa (inst, stream); */ |
| 1139 | /* OBSOLETE fprintf (stream, ",%s", lit(i)); */ |
| 1140 | /* OBSOLETE return pfx + l; */ |
| 1141 | /* OBSOLETE */ |
| 1142 | /* OBSOLETE case a2r: /* register, memory *x/ */ |
| 1143 | /* OBSOLETE fprintf (stream, "%s,", reg(i,k)); */ |
| 1144 | /* OBSOLETE return pfx + print_effa (inst, stream); */ |
| 1145 | /* OBSOLETE */ |
| 1146 | /* OBSOLETE case a2l: /* literal, memory *x/ */ |
| 1147 | /* OBSOLETE fprintf (stream, "%s,", lit(i)); */ |
| 1148 | /* OBSOLETE return pfx + print_effa (inst, stream); */ |
| 1149 | /* OBSOLETE */ |
| 1150 | /* OBSOLETE case a3: /* memory *x/ */ |
| 1151 | /* OBSOLETE return pfx + print_effa (inst, stream); */ |
| 1152 | /* OBSOLETE */ |
| 1153 | /* OBSOLETE case a4: /* system call *x/ */ |
| 1154 | /* OBSOLETE l = 29; goto a4a5; */ |
| 1155 | /* OBSOLETE case a5: /* trap *x/ */ |
| 1156 | /* OBSOLETE l = 27; */ |
| 1157 | /* OBSOLETE a4a5: */ |
| 1158 | /* OBSOLETE if (inst.f1.len) */ |
| 1159 | /* OBSOLETE { */ |
| 1160 | /* OBSOLETE unsigned int m = (inst.signed_half[1] << 16) + inst.half[2]; */ |
| 1161 | /* OBSOLETE fprintf (stream, "#%d,#%d", m >> l, m & (-1 >> (32-l))); */ |
| 1162 | /* OBSOLETE return pfx + 6; */ |
| 1163 | /* OBSOLETE } */ |
| 1164 | /* OBSOLETE else */ |
| 1165 | /* OBSOLETE { */ |
| 1166 | /* OBSOLETE unsigned int m = inst.signed_half[1]; */ |
| 1167 | /* OBSOLETE fprintf (stream, "#%d,#%d", m >> l, m & (-1 >> (32-l))); */ |
| 1168 | /* OBSOLETE return pfx + 4; */ |
| 1169 | /* OBSOLETE } */ |
| 1170 | /* OBSOLETE } */ |
| 1171 | /* OBSOLETE } */ |
| 1172 | /* OBSOLETE */ |
| 1173 | /* OBSOLETE */ |
| 1174 | /* OBSOLETE /* print effective address @nnn(aj), return instruction length *x/ */ |
| 1175 | /* OBSOLETE */ |
| 1176 | /* OBSOLETE int print_effa (inst, stream) */ |
| 1177 | /* OBSOLETE union inst inst; */ |
| 1178 | /* OBSOLETE FILE *stream; */ |
| 1179 | /* OBSOLETE { */ |
| 1180 | /* OBSOLETE int n, l; */ |
| 1181 | /* OBSOLETE */ |
| 1182 | /* OBSOLETE if (inst.f1.len) */ |
| 1183 | /* OBSOLETE { */ |
| 1184 | /* OBSOLETE n = (inst.signed_half[1] << 16) + inst.half[2]; */ |
| 1185 | /* OBSOLETE l = 6; */ |
| 1186 | /* OBSOLETE } */ |
| 1187 | /* OBSOLETE else */ |
| 1188 | /* OBSOLETE { */ |
| 1189 | /* OBSOLETE n = inst.signed_half[1]; */ |
| 1190 | /* OBSOLETE l = 4; */ |
| 1191 | /* OBSOLETE } */ |
| 1192 | /* OBSOLETE */ |
| 1193 | /* OBSOLETE if (inst.f1.indir) */ |
| 1194 | /* OBSOLETE printf ("@"); */ |
| 1195 | /* OBSOLETE */ |
| 1196 | /* OBSOLETE if (!inst.f1.j) */ |
| 1197 | /* OBSOLETE { */ |
| 1198 | /* OBSOLETE print_address (n, stream); */ |
| 1199 | /* OBSOLETE return l; */ |
| 1200 | /* OBSOLETE } */ |
| 1201 | /* OBSOLETE */ |
| 1202 | /* OBSOLETE fprintf (stream, (n & 0xf0000000) == 0x80000000 ? "%#x(%s)" : "%d(%s)", */ |
| 1203 | /* OBSOLETE n, aj[inst.f1.j]); */ |
| 1204 | /* OBSOLETE */ |
| 1205 | /* OBSOLETE return l; */ |
| 1206 | /* OBSOLETE } */ |
| 1207 | /* OBSOLETE */ |
| 1208 | /* OBSOLETE \f */ |
| 1209 | /* OBSOLETE void */ |
| 1210 | /* OBSOLETE _initialize_convex_dep () */ |
| 1211 | /* OBSOLETE { */ |
| 1212 | /* OBSOLETE add_com ("alias", class_support, alias_command, */ |
| 1213 | /* OBSOLETE "Add a new name for an existing command."); */ |
| 1214 | /* OBSOLETE */ |
| 1215 | /* OBSOLETE add_cmd ("base", class_vars, set_base_command, */ |
| 1216 | /* OBSOLETE "Change the integer output radix to 8, 10 or 16\n\ */ |
| 1217 | /* OBSOLETE or use just `set base' with no args to return to the ad-hoc default,\n\ */ |
| 1218 | /* OBSOLETE which is 16 for integers that look like addresses, 10 otherwise.", */ |
| 1219 | /* OBSOLETE &setlist); */ |
| 1220 | /* OBSOLETE */ |
| 1221 | /* OBSOLETE add_cmd ("pipeline", class_run, set_pipelining_command, */ |
| 1222 | /* OBSOLETE "Enable or disable overlapped execution of instructions.\n\ */ |
| 1223 | /* OBSOLETE With `set pipe off', exceptions are reported with\n\ */ |
| 1224 | /* OBSOLETE $pc pointing at the instruction after the faulting one.\n\ */ |
| 1225 | /* OBSOLETE The default is `set pipe on', which runs faster.", */ |
| 1226 | /* OBSOLETE &setlist); */ |
| 1227 | /* OBSOLETE */ |
| 1228 | /* OBSOLETE add_cmd ("parallel", class_run, set_parallel_command, */ |
| 1229 | /* OBSOLETE "Enable or disable multi-threaded execution of parallel code.\n\ */ |
| 1230 | /* OBSOLETE `set parallel off' means run the program on a single CPU.\n\ */ |
| 1231 | /* OBSOLETE `set parallel fixed' means run the program with all CPUs assigned to it.\n\ */ |
| 1232 | /* OBSOLETE `set parallel on' means run the program on any CPUs that are available.", */ |
| 1233 | /* OBSOLETE &setlist); */ |
| 1234 | /* OBSOLETE */ |
| 1235 | /* OBSOLETE add_com ("1cont", class_run, one_cont_command, */ |
| 1236 | /* OBSOLETE "Continue the program, activating only the current thread.\n\ */ |
| 1237 | /* OBSOLETE Args are the same as the `cont' command."); */ |
| 1238 | /* OBSOLETE */ |
| 1239 | /* OBSOLETE add_com ("thread", class_run, set_thread_command, */ |
| 1240 | /* OBSOLETE "Change the current thread, the one under scrutiny and control.\n\ */ |
| 1241 | /* OBSOLETE With no arg, show the active threads, the current one marked with *."); */ |
| 1242 | /* OBSOLETE */ |
| 1243 | /* OBSOLETE add_info ("threads", thread_info, */ |
| 1244 | /* OBSOLETE "List status of active threads."); */ |
| 1245 | /* OBSOLETE */ |
| 1246 | /* OBSOLETE add_info ("comm-registers", comm_registers_info, */ |
| 1247 | /* OBSOLETE "List communication registers and their contents.\n\ */ |
| 1248 | /* OBSOLETE A communication register name as argument means describe only that register.\n\ */ |
| 1249 | /* OBSOLETE An address as argument means describe the resource structure at that address.\n\ */ |
| 1250 | /* OBSOLETE `Locked' means that the register has been sent to but not yet received from."); */ |
| 1251 | /* OBSOLETE */ |
| 1252 | /* OBSOLETE add_info ("psw", psw_info, */ |
| 1253 | /* OBSOLETE "Display $ps, the processor status word, bit by bit.\n\ */ |
| 1254 | /* OBSOLETE An argument means display that value's interpretation as a psw."); */ |
| 1255 | /* OBSOLETE */ |
| 1256 | /* OBSOLETE add_cmd ("convex", no_class, 0, "Convex-specific commands.\n\ */ |
| 1257 | /* OBSOLETE 32-bit registers $pc $ps $sp $ap $fp $a1-5 $s0-7 $v0-7 $vl $vs $vm $c0-63\n\ */ |
| 1258 | /* OBSOLETE 64-bit registers $S0-7 $V0-7 $C0-63\n\ */ |
| 1259 | /* OBSOLETE \n\ */ |
| 1260 | /* OBSOLETE info threads display info on stopped threads waiting to signal\n\ */ |
| 1261 | /* OBSOLETE thread display list of active threads\n\ */ |
| 1262 | /* OBSOLETE thread N select thread N (its registers, stack, memory, etc.)\n\ */ |
| 1263 | /* OBSOLETE step, next, etc step selected thread only\n\ */ |
| 1264 | /* OBSOLETE 1cont continue selected thread only\n\ */ |
| 1265 | /* OBSOLETE cont continue all threads\n\ */ |
| 1266 | /* OBSOLETE info comm-registers display contents of comm register(s) or a resource struct\n\ */ |
| 1267 | /* OBSOLETE info psw display processor status word $ps\n\ */ |
| 1268 | /* OBSOLETE set base N change integer radix used by `print' without a format\n\ */ |
| 1269 | /* OBSOLETE set pipeline off exceptions are precise, $pc points after the faulting insn\n\ */ |
| 1270 | /* OBSOLETE set pipeline on normal mode, $pc is somewhere ahead of faulting insn\n\ */ |
| 1271 | /* OBSOLETE set parallel off program runs on a single CPU\n\ */ |
| 1272 | /* OBSOLETE set parallel fixed all CPUs are assigned to the program\n\ */ |
| 1273 | /* OBSOLETE set parallel on normal mode, parallel execution on random available CPUs\n\ */ |
| 1274 | /* OBSOLETE ", */ |
| 1275 | /* OBSOLETE &cmdlist); */ |
| 1276 | /* OBSOLETE */ |
| 1277 | /* OBSOLETE } */ |