1 /* OBSOLETE /* Convex stuff for GDB. */
2 /* OBSOLETE Copyright (C) 1990, 1991, 1996, 2000 Free Software Foundation, Inc. */
4 /* OBSOLETE This file is part of GDB. */
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. */
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. */
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/ */
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" */
28 /* OBSOLETE #include <signal.h> */
29 /* OBSOLETE #include <fcntl.h> */
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> */
43 /* OBSOLETE #include "gdbcmd.h" */
45 /* OBSOLETE CORE_ADDR */
46 /* OBSOLETE convex_skip_prologue (pc) */
47 /* OBSOLETE CORE_ADDR pc; */
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 (;;) */
65 /* OBSOLETE op = read_memory_integer (pc, 2); */
66 /* OBSOLETE ix = (op >> 3) & 7; */
67 /* OBSOLETE if (ix != 6) */
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; */
80 /* OBSOLETE return pc; */
84 /* OBSOLETE convex_frameless_function_invocation (fi) */
85 /* OBSOLETE struct frame_info *fi; */
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; */
96 /* OBSOLETE convex_frame_num_args (fi) */
97 /* OBSOLETE struct frame_info *fi; */
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; */
105 /* OBSOLETE exec_file_command (filename, from_tty) */
106 /* OBSOLETE char *filename; */
107 /* OBSOLETE int from_tty; */
109 /* OBSOLETE int val; */
110 /* OBSOLETE int n; */
111 /* OBSOLETE struct stat st_exec; */
113 /* OBSOLETE /* Eliminate all traces of old exec file. */
114 /* OBSOLETE Mark text segment as empty. *x/ */
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; */
129 /* OBSOLETE n_exec = 0; */
131 /* OBSOLETE /* Now open and digest the file the user requested, if any. *x/ */
133 /* OBSOLETE if (filename) */
135 /* OBSOLETE filename = tilde_expand (filename); */
136 /* OBSOLETE make_cleanup (free, filename); */
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); */
143 /* OBSOLETE if (myread (execchan, &filehdr, sizeof filehdr) < 0) */
144 /* OBSOLETE perror_with_name (filename); */
146 /* OBSOLETE if (! IS_SOFF_MAGIC (filehdr.h_magic)) */
147 /* OBSOLETE error ("%s: not an executable file.", filename); */
149 /* OBSOLETE if (myread (execchan, &opthdr, filehdr.h_opthdr) <= 0) */
150 /* OBSOLETE perror_with_name (filename); */
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/ */
156 /* OBSOLETE lseek (execchan, (long) filehdr.h_scnptr, 0); */
158 /* OBSOLETE for (n = 0; n < filehdr.h_nscns; n++) */
160 /* OBSOLETE if (myread (execchan, &scnhdr, sizeof scnhdr) < 0) */
161 /* OBSOLETE perror_with_name (filename); */
163 /* OBSOLETE if ((scnhdr.s_flags & S_TYPMASK) >= S_TEXT */
164 /* OBSOLETE && (scnhdr.s_flags & S_TYPMASK) <= S_COMON) */
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++; */
172 /* OBSOLETE if ((scnhdr.s_flags & S_TYPMASK) == S_TEXT) */
174 /* OBSOLETE text_start = scnhdr.s_vaddr; */
175 /* OBSOLETE text_end = scnhdr.s_vaddr + scnhdr.s_size; */
180 /* OBSOLETE fstat (execchan, &st_exec); */
181 /* OBSOLETE exec_mtime = st_exec.st_mtime; */
183 /* OBSOLETE validate_files (); */
185 /* OBSOLETE else if (from_tty) */
186 /* OBSOLETE printf_filtered ("No executable file now.\n"); */
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); */
194 /* OBSOLETE /* Read data from SOFF exec or core file. */
195 /* OBSOLETE Return 0 on success, EIO if address out of bounds. *x/ */
198 /* OBSOLETE xfer_core_file (memaddr, myaddr, len) */
199 /* OBSOLETE CORE_ADDR memaddr; */
200 /* OBSOLETE char *myaddr; */
201 /* OBSOLETE int len; */
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; */
211 /* OBSOLETE while (len > 0) */
213 /* OBSOLETE xferfile = 0; */
214 /* OBSOLETE xferchan = 0; */
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/ */
224 /* OBSOLETE i = len; */
226 /* OBSOLETE for (n = 0; n < n_core; n++) */
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)) */
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) */
236 /* OBSOLETE xferfile = &corefile; */
237 /* OBSOLETE xferchan = corechan; */
239 /* OBSOLETE break; */
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; */
246 /* OBSOLETE if (!xferfile) */
247 /* OBSOLETE for (n = 0; n < n_exec; n++) */
249 /* OBSOLETE if (memaddr >= exec_map[n].mem_addr */
250 /* OBSOLETE && memaddr < exec_map[n].mem_end) */
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) */
257 /* OBSOLETE xferfile = &execfile; */
258 /* OBSOLETE xferchan = execchan; */
260 /* OBSOLETE break; */
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; */
267 /* OBSOLETE /* Now we know which file to use. */
268 /* OBSOLETE Set up its pointer and transfer the data. *x/ */
269 /* OBSOLETE if (xferfile) */
271 /* OBSOLETE if (*xferfile == 0) */
272 /* OBSOLETE if (xferfile == &execfile) */
273 /* OBSOLETE error ("No program file to examine."); */
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); */
283 /* OBSOLETE /* If this address is for nonexistent memory, */
284 /* OBSOLETE read zeros if reading, or do nothing if writing. *x/ */
287 /* OBSOLETE memset (myaddr, '\0', i); */
288 /* OBSOLETE returnval = EIO; */
291 /* OBSOLETE memaddr += i; */
292 /* OBSOLETE myaddr += i; */
293 /* OBSOLETE len -= i; */
295 /* OBSOLETE return returnval; */
297 /* OBSOLETE #endif */
299 /* OBSOLETE /* Here from info files command to print an address map. *x/ */
301 /* OBSOLETE print_maps () */
303 /* OBSOLETE struct pmap ptrs[200]; */
304 /* OBSOLETE int n; */
306 /* OBSOLETE /* ID strings for core and executable file sections *x/ */
308 /* OBSOLETE static char *idstr[] = */
310 /* OBSOLETE "0", "text", "data", "tdata", "bss", "tbss", */
311 /* OBSOLETE "common", "ttext", "ctx", "tctx", "10", "11", "12", */
314 /* OBSOLETE for (n = 0; n < n_core; n++) */
316 /* OBSOLETE core_map[n].which = 0; */
317 /* OBSOLETE ptrs[n] = core_map[n]; */
319 /* OBSOLETE for (n = 0; n < n_exec; n++) */
321 /* OBSOLETE exec_map[n].which = 1; */
322 /* OBSOLETE ptrs[n_core+n] = exec_map[n]; */
325 /* OBSOLETE qsort (ptrs, n_core + n_exec, sizeof *ptrs, ptr_cmp); */
327 /* OBSOLETE for (n = 0; n < n_core + n_exec; n++) */
329 /* OBSOLETE struct pmap *p = &ptrs[n]; */
330 /* OBSOLETE if (n > 0) */
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; */
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); */
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/ */
347 /* OBSOLETE static ptr_cmp (a, b) */
348 /* OBSOLETE struct pmap *a, *b; */
350 /* OBSOLETE if (a->mem_addr != b->mem_addr) return a->mem_addr - b->mem_addr; */
351 /* OBSOLETE return a->which - b->which; */
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. */
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/ */
365 /* OBSOLETE /* Return 1 if NAME is a trapped internal variable, else 0. *x/ */
368 /* OBSOLETE is_trapped_internalvar (name) */
369 /* OBSOLETE char *name; */
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; */
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; */
387 /* OBSOLETE /* Return the value of trapped internal variable VAR *x/ */
390 /* OBSOLETE value_of_trapped_internalvar (var) */
391 /* OBSOLETE struct internalvar *var; */
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; */
400 /* OBSOLETE if (STREQ (name, "vl")) */
402 /* OBSOLETE val = value_from_longest (builtin_type_int, */
403 /* OBSOLETE (LONGEST) *read_vector_register_1 (VL_REGNUM)); */
405 /* OBSOLETE else if (STREQ (name, "vs")) */
407 /* OBSOLETE val = value_from_longest (builtin_type_int, */
408 /* OBSOLETE (LONGEST) *read_vector_register_1 (VS_REGNUM)); */
410 /* OBSOLETE else if (STREQ (name, "vm")) */
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))); */
424 /* OBSOLETE else if (name[0] == 'V') */
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)); */
436 /* OBSOLETE else if (name[0] == 'v') */
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++;} */
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]))); */
457 /* OBSOLETE VALUE_LVAL (val) = lval_internalvar; */
458 /* OBSOLETE VALUE_INTERNALVAR (val) = var; */
459 /* OBSOLETE return val; */
462 /* OBSOLETE /* Handle a new value assigned to a trapped internal variable *x/ */
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; */
470 /* OBSOLETE char *name = var->name; */
471 /* OBSOLETE long long newval = value_as_long (val); */
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"); */
483 /* OBSOLETE offset /= bitsize / 8; */
484 /* OBSOLETE write_vector_register (name[1] - '0', offset, newval); */
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/ */
493 /* OBSOLETE decout (stream, type, val) */
494 /* OBSOLETE struct ui_file *stream; */
495 /* OBSOLETE struct type *type; */
496 /* OBSOLETE LONGEST val; */
498 /* OBSOLETE long lv = val; */
500 /* OBSOLETE switch (output_radix) */
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))) */
507 /* OBSOLETE print_longest (stream, "x", 0, val); */
508 /* OBSOLETE return; */
511 /* OBSOLETE case 10: */
512 /* OBSOLETE print_longest (stream, TYPE_UNSIGNED (type) ? "u" : "d", 0, val); */
513 /* OBSOLETE return; */
515 /* OBSOLETE case 8: */
516 /* OBSOLETE print_longest (stream, "o", 0, val); */
517 /* OBSOLETE return; */
519 /* OBSOLETE case 16: */
520 /* OBSOLETE print_longest (stream, "x", 0, val); */
521 /* OBSOLETE return; */
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/ */
529 /* OBSOLETE static void */
530 /* OBSOLETE set_base_command (arg) */
531 /* OBSOLETE char *arg; */
533 /* OBSOLETE int new_radix; */
535 /* OBSOLETE if (!arg) */
536 /* OBSOLETE output_radix = 0; */
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; */
546 /* OBSOLETE /* Turn pipelining on or off in the inferior. *x/ */
548 /* OBSOLETE static void */
549 /* OBSOLETE set_pipelining_command (arg) */
550 /* OBSOLETE char *arg; */
552 /* OBSOLETE if (!arg) */
554 /* OBSOLETE sequential = !sequential; */
555 /* OBSOLETE printf_filtered ("%s\n", sequential ? "off" : "on"); */
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."); */
565 /* OBSOLETE /* Enable, disable, or force parallel execution in the inferior. *x/ */
567 /* OBSOLETE static void */
568 /* OBSOLETE set_parallel_command (arg) */
569 /* OBSOLETE char *arg; */
571 /* OBSOLETE struct rlimit rl; */
572 /* OBSOLETE int prevparallel = parallel; */
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."); */
584 /* OBSOLETE if ((prevparallel == 0) != (parallel == 0) && inferior_pid) */
585 /* OBSOLETE printf_filtered ("will take effect at next run.\n"); */
587 /* OBSOLETE getrlimit (RLIMIT_CONCUR, &rl); */
588 /* OBSOLETE rl.rlim_cur = parallel ? rl.rlim_max : 1; */
589 /* OBSOLETE setrlimit (RLIMIT_CONCUR, &rl); */
591 /* OBSOLETE if (inferior_pid) */
592 /* OBSOLETE set_fixed_scheduling (inferior_pid, parallel == 2); */
595 /* OBSOLETE /* Add a new name for an existing command. *x/ */
597 /* OBSOLETE static void */
598 /* OBSOLETE alias_command (arg) */
599 /* OBSOLETE char *arg; */
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; */
605 /* OBSOLETE if (!arg) */
606 /* OBSOLETE error_no_arg ("newname oldname"); */
608 /* OBSOLETE new = lookup_cmd (&arg, cmdlist, "", -1); */
609 /* OBSOLETE if (new && !strncmp (newname, new->name, strlen (new->name))) */
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); */
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++; */
632 /* OBSOLETE old = lookup_cmd (&arg, cmdlist, "", 0); */
634 /* OBSOLETE if (*arg != '\0') */
635 /* OBSOLETE error (aliaserr); */
637 /* OBSOLETE if (new && !strncmp (newname, new->name, strlen (new->name))) */
639 /* OBSOLETE char *tem; */
640 /* OBSOLETE if (new->class == (int) class_user || new->class == (int) class_alias) */
641 /* OBSOLETE tem = "Redefine command \"%s\"? "; */
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); */
648 /* OBSOLETE add_com (newname, class_alias, old->function, old->doc); */
653 /* OBSOLETE /* Print the current thread number, and any threads with signals in the */
654 /* OBSOLETE queue. *x/ */
656 /* OBSOLETE thread_info () */
658 /* OBSOLETE struct threadpid *p; */
660 /* OBSOLETE if (have_inferior_p ()) */
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); */
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)); */
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)); */
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)); */
685 /* OBSOLETE /* Return string describing a signal.subcode number *x/ */
687 /* OBSOLETE static char * */
688 /* OBSOLETE subsig_name (signo, subcode) */
689 /* OBSOLETE int signo, subcode; */
691 /* OBSOLETE static char *subsig4[] = { */
692 /* OBSOLETE "error exit", "privileged instruction", "unknown", */
693 /* OBSOLETE "unknown", "undefined opcode", */
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", */
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", */
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", */
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", */
717 /* OBSOLETE static char **subsig_list[] = */
718 /* OBSOLETE {0, 0, 0, 0, subsig4, subsig5, 0, 0, subsig8, 0, subsig10, subsig11, 0}; */
720 /* OBSOLETE int i; */
721 /* OBSOLETE char *p; */
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; */
735 /* OBSOLETE /* Print a compact display of thread status, essentially x/i $pc */
736 /* OBSOLETE for all active threads. *x/ */
738 /* OBSOLETE static void */
739 /* OBSOLETE threadstat () */
741 /* OBSOLETE int t; */
743 /* OBSOLETE for (t = 0; t < n_threads; t++) */
744 /* OBSOLETE if (thread_state[t] == PI_TALIVE) */
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"); */
755 /* OBSOLETE /* Change the current thread to ARG. *x/ */
757 /* OBSOLETE set_thread_command (arg) */
758 /* OBSOLETE char *arg; */
760 /* OBSOLETE int thread; */
762 /* OBSOLETE if (!arg) */
764 /* OBSOLETE threadstat (); */
765 /* OBSOLETE return; */
768 /* OBSOLETE thread = parse_and_eval_address (arg); */
770 /* OBSOLETE if (thread < 0 || thread > n_threads || thread_state[thread] != PI_TALIVE) */
771 /* OBSOLETE error ("no such thread."); */
773 /* OBSOLETE select_thread (thread); */
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); */
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/ */
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; */
791 /* OBSOLETE all_continue = 1; */
792 /* OBSOLETE cont_command (proc_count_exp, from_tty); */
795 /* OBSOLETE /* Here on 1CONT command. Resume only the current thread. *x/ */
797 /* OBSOLETE one_cont_command (proc_count_exp, from_tty) */
798 /* OBSOLETE char *proc_count_exp; */
799 /* OBSOLETE int from_tty; */
801 /* OBSOLETE cont_command (proc_count_exp, from_tty); */
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/ */
808 /* OBSOLETE comm_registers_info (arg) */
809 /* OBSOLETE char *arg; */
811 /* OBSOLETE int i, regnum; */
813 /* OBSOLETE if (arg) */
815 /* OBSOLETE if (sscanf (arg, "$c%d", ®num) == 1) { */
817 /* OBSOLETE } else if (sscanf (arg, "$C%d", ®num) == 1) { */
819 /* OBSOLETE } else { */
820 /* OBSOLETE regnum = parse_and_eval_address (arg); */
821 /* OBSOLETE if (regnum > 0) */
822 /* OBSOLETE regnum &= ~0x8000; */
825 /* OBSOLETE if (regnum >= 64) */
826 /* OBSOLETE error ("%s: invalid register name.", arg); */
828 /* OBSOLETE /* if we got a (user) address, examine the resource struct there *x/ */
830 /* OBSOLETE if (regnum < 0) */
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; */
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); */
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" : "")); */
854 /* OBSOLETE /* Print the psw *x/ */
856 /* OBSOLETE static void */
857 /* OBSOLETE psw_info (arg) */
858 /* OBSOLETE char *arg; */
860 /* OBSOLETE struct pswbit */
862 /* OBSOLETE int bit; */
863 /* OBSOLETE int pos; */
864 /* OBSOLETE char *text; */
867 /* OBSOLETE static struct pswbit pswbit[] = */
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}, */
897 /* OBSOLETE long psw; */
898 /* OBSOLETE struct pswbit *p; */
900 /* OBSOLETE if (arg) */
901 /* OBSOLETE psw = parse_and_eval_address (arg); */
903 /* OBSOLETE psw = read_register (PS_REGNUM); */
905 /* OBSOLETE for (p = pswbit; p->bit; p++) */
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); */
911 /* OBSOLETE printf_filtered ("%08x %3d %s\n", p->bit, */
912 /* OBSOLETE (psw & p->bit) >> p->pos, p->text); */
916 /* OBSOLETE #include "symtab.h" */
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/ */
922 /* OBSOLETE #define reg(a,b) ((char (*)[3])(op[fmt->a]))[inst.f0.b] */
924 /* OBSOLETE /* lit (fmt_field) -- field [ijk] is a literal (PSW, VL, eg) *x/ */
926 /* OBSOLETE #define lit(i) op[fmt->i] */
928 /* OBSOLETE /* aj[j] -- name for A register j *x/ */
930 /* OBSOLETE #define aj ((char (*)[3])(op[A])) */
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; */
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; */
950 /* OBSOLETE unsigned char byte[8]; */
951 /* OBSOLETE unsigned short half[4]; */
952 /* OBSOLETE char signed_byte[8]; */
953 /* OBSOLETE short signed_half[4]; */
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/ */
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/ */
968 /* OBSOLETE #include "opcode/convex.h" */
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, */
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, */
1003 /* OBSOLETE /* Print the instruction at address MEMADDR in debugged memory, */
1004 /* OBSOLETE on STREAM. Returns length of the instruction, in bytes. *x/ */
1007 /* OBSOLETE convex_print_insn (memaddr, stream) */
1008 /* OBSOLETE CORE_ADDR memaddr; */
1009 /* OBSOLETE FILE *stream; */
1011 /* OBSOLETE union inst inst; */
1012 /* OBSOLETE struct formstr *fmt; */
1013 /* OBSOLETE register int format, op1, pfx; */
1014 /* OBSOLETE int l; */
1016 /* OBSOLETE read_memory (memaddr, &inst, sizeof inst); */
1018 /* OBSOLETE /* Remove and note prefix, if present *x/ */
1020 /* OBSOLETE pfx = inst.half[0]; */
1021 /* OBSOLETE if ((pfx & 0xfff0) == 0x7ef0) */
1023 /* OBSOLETE pfx = ((pfx >> 3) & 1) + 1; */
1024 /* OBSOLETE *(long long *) &inst = *(long long *) &inst.half[1]; */
1026 /* OBSOLETE else pfx = 0; */
1028 /* OBSOLETE /* Split opcode into format.op1 and look up in appropriate table *x/ */
1030 /* OBSOLETE format = formdecode[inst.byte[0]]; */
1031 /* OBSOLETE op1 = (inst.half[0] & opdecode[format].mask) >> opdecode[format].shift; */
1032 /* OBSOLETE if (format == 9) */
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]; */
1041 /* OBSOLETE fmt = formatx; */
1044 /* OBSOLETE fmt = &opdecode[format].formstr[pfx][op1]; */
1046 /* OBSOLETE /* Print it *x/ */
1048 /* OBSOLETE if (fmt->fmt == xxx) */
1050 /* OBSOLETE /* noninstruction *x/ */
1051 /* OBSOLETE fprintf (stream, "0x%04x", pfx ? pfx : inst.half[0]); */
1052 /* OBSOLETE return 2; */
1055 /* OBSOLETE if (pfx) */
1056 /* OBSOLETE pfx = 2; */
1058 /* OBSOLETE fprintf (stream, "%s%s%s", lop[fmt->lop], rop[fmt->rop], */
1059 /* OBSOLETE &" "[strlen(lop[fmt->lop]) + strlen(rop[fmt->rop])]); */
1061 /* OBSOLETE switch (fmt->fmt) */
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; */
1067 /* OBSOLETE case rr: /* two register *x/ */
1068 /* OBSOLETE fprintf (stream, "%s,%s", reg(i,j), reg(j,k)); */
1069 /* OBSOLETE return pfx + 2; */
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; */
1075 /* OBSOLETE case r: /* one register *x/ */
1076 /* OBSOLETE fprintf (stream, "%s", reg(i,k)); */
1077 /* OBSOLETE return pfx + 2; */
1079 /* OBSOLETE case nops: /* no operands *x/ */
1080 /* OBSOLETE return pfx + 2; */
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; */
1086 /* OBSOLETE case pcrel: /* pc relative *x/ */
1087 /* OBSOLETE print_address (memaddr + 2 * inst.signed_byte[1], stream); */
1088 /* OBSOLETE return pfx + 2; */
1090 /* OBSOLETE case lr: /* literal, one register *x/ */
1091 /* OBSOLETE fprintf (stream, "%s,%s", lit(i), reg(j,k)); */
1092 /* OBSOLETE return pfx + 2; */
1094 /* OBSOLETE case rxl: /* one register, literal *x/ */
1095 /* OBSOLETE fprintf (stream, "%s,%s", reg(i,k), lit(j)); */
1096 /* OBSOLETE return pfx + 2; */
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; */
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; */
1106 /* OBSOLETE case iml: /* immediate, literal *x/ */
1107 /* OBSOLETE if (inst.f1.len) */
1109 /* OBSOLETE fprintf (stream, "#%#x,%s", */
1110 /* OBSOLETE (inst.signed_half[1] << 16) + inst.half[2], lit(i)); */
1111 /* OBSOLETE return pfx + 6; */
1115 /* OBSOLETE fprintf (stream, "#%d,%s", inst.signed_half[1], lit(i)); */
1116 /* OBSOLETE return pfx + 4; */
1119 /* OBSOLETE case imr: /* immediate, register *x/ */
1120 /* OBSOLETE if (inst.f1.len) */
1122 /* OBSOLETE fprintf (stream, "#%#x,%s", */
1123 /* OBSOLETE (inst.signed_half[1] << 16) + inst.half[2], reg(i,k)); */
1124 /* OBSOLETE return pfx + 6; */
1128 /* OBSOLETE fprintf (stream, "#%d,%s", inst.signed_half[1], reg(i,k)); */
1129 /* OBSOLETE return pfx + 4; */
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; */
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; */
1142 /* OBSOLETE case a2r: /* register, memory *x/ */
1143 /* OBSOLETE fprintf (stream, "%s,", reg(i,k)); */
1144 /* OBSOLETE return pfx + print_effa (inst, stream); */
1146 /* OBSOLETE case a2l: /* literal, memory *x/ */
1147 /* OBSOLETE fprintf (stream, "%s,", lit(i)); */
1148 /* OBSOLETE return pfx + print_effa (inst, stream); */
1150 /* OBSOLETE case a3: /* memory *x/ */
1151 /* OBSOLETE return pfx + print_effa (inst, stream); */
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) */
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; */
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; */
1174 /* OBSOLETE /* print effective address @nnn(aj), return instruction length *x/ */
1176 /* OBSOLETE int print_effa (inst, stream) */
1177 /* OBSOLETE union inst inst; */
1178 /* OBSOLETE FILE *stream; */
1180 /* OBSOLETE int n, l; */
1182 /* OBSOLETE if (inst.f1.len) */
1184 /* OBSOLETE n = (inst.signed_half[1] << 16) + inst.half[2]; */
1185 /* OBSOLETE l = 6; */
1189 /* OBSOLETE n = inst.signed_half[1]; */
1190 /* OBSOLETE l = 4; */
1193 /* OBSOLETE if (inst.f1.indir) */
1194 /* OBSOLETE printf ("@"); */
1196 /* OBSOLETE if (!inst.f1.j) */
1198 /* OBSOLETE print_address (n, stream); */
1199 /* OBSOLETE return l; */
1202 /* OBSOLETE fprintf (stream, (n & 0xf0000000) == 0x80000000 ? "%#x(%s)" : "%d(%s)", */
1203 /* OBSOLETE n, aj[inst.f1.j]); */
1205 /* OBSOLETE return l; */
1210 /* OBSOLETE _initialize_convex_dep () */
1212 /* OBSOLETE add_com ("alias", class_support, alias_command, */
1213 /* OBSOLETE "Add a new name for an existing command."); */
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); */
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); */
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); */
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."); */
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 *."); */
1243 /* OBSOLETE add_info ("threads", thread_info, */
1244 /* OBSOLETE "List status of active threads."); */
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."); */
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."); */
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\ */
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\ */
1275 /* OBSOLETE &cmdlist); */
This page took 0.057528 seconds and 4 git commands to generate.