diff options
author | Jason Molenda <jmolenda@apple.com> | 1999-07-07 17:31:57 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 1999-07-07 17:31:57 +0000 |
commit | 9846de1bb5d61521885ef51fa6b99121ec1be577 (patch) | |
tree | 56c938421752cf160876766aaee7e729a8e47050 /gdb | |
parent | f04894943e847e4c9dec6a7a73b9e03a3c0aa90a (diff) | |
download | fsf-binutils-gdb-9846de1bb5d61521885ef51fa6b99121ec1be577.zip fsf-binutils-gdb-9846de1bb5d61521885ef51fa6b99121ec1be577.tar.gz fsf-binutils-gdb-9846de1bb5d61521885ef51fa6b99121ec1be577.tar.bz2 |
import gdb-1999-07-07 pre reformat
Diffstat (limited to 'gdb')
52 files changed, 1651 insertions, 1561 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ac6d4d2..b1d8b8f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,56 @@ +1999-07-07 Stan Shebs <shebs@andros.cygnus.com> + + * gnu-regex.c, gnu-regex.h: Don't let indent mess with these. + +Wed Jul 7 13:06:24 1999 Andrew Cagney <cagney@b1.cygnus.com> + + * remote-mips.c (fputs_readable): Rename puts_readable, add struct + gdb_file argument. + (fputc_readable): Rename putc_readable, add struct gdb_file + argument. + + * remote-mips.c (mips_expect_timeout, mips_receive_header, + mips_send_packet, mips_receive_packet), remote-rdp.c (put_byte, + get_byte, put_word, rdp_init, rdp_init), remote-sds.c + (sds_interrupt, sds_wait, readchar, putmessage, read_frame, + getmessage), remote-udi.c (udi_store_registers, fetch_register): + (store_register), xmodem.c (readchar), utils.c (puts_debug), + gnu-nat.h (debug), parse.c (parse_exp_1): Cleanup - send debug/log + messages to gdb_stdlog. + +1999-07-06 Stan Shebs <shebs@andros.cygnus.com> + + * exec.c: Remove long-#ifed-out section of code that confuses + indent. + * gdbtypes.c (add_mangled_type): Add some braces to indicate + grouping better. + * gnu-nat.c: Remove literal newlines embedded in strings, + causes indent to weird out. + * language.c (binop_result_type): Remove extra paren. + * lynx-nat.c: Add a missing paren to fetch_core_registers decl. + * nec4102rom.c (vr4102_insert_step): Fix typos. + (_initialize_vr4102_rom): Remove literal newline in string. + * config/a29k/tm-a29k.h: Suppress formatting of pictures. + * config/m68k/xm-3b1.h: Remove excess #endif. + + Declare Pyramid configuration obsolete. + * configure.host, configure.tgt: Comment out Pyramid configs. + * Makefile.in: Comment out Pyramid-related actions. + * pyr-xdep.c, pyr-tdep.c, config/pyr/*: Comment out. + * NEWS: Mention obsolete status. + +1999-07-06 Jason Molenda (jsm@bugshack.cygnus.com) + + * remote.c: Include <sys/time.h> to pick up FD_SET et al defns on + some old Linux distributions. + * remote-os9k.c, remote-st.c, ser-tcp.c, ser-unix.c, + sparcl-tdep.c, remote.c: Back out inclusion of <sys/select.h>. + It isn't necessary after all. + +1999-07-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com> + + * infcmd.c (strip_bg_char): Remove assignment from 'if' condition. + 1999-07-05 Jason Molenda (jsm@bugshack.cygnus.com) * remote.c: Include <sys/select.h> if it exists in order to pick up diff --git a/gdb/Makefile.in b/gdb/Makefile.in index b13fa01..a46d01a 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -224,7 +224,7 @@ CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \ ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) -VERSION = 19990705 +VERSION = 19990707 DIST=gdb LINT=/usr/5bin/lint @@ -1368,9 +1368,9 @@ printcmd.o: printcmd.c $(breakpoint_h) $(defs_h) $(expression_h) \ procfs.o: procfs.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \ target.h gdb_string.h -pyr-tdep.o: pyr-tdep.c $(defs_h) +# OBSOLETE pyr-tdep.o: pyr-tdep.c $(defs_h) -pyr-xdep.o: pyr-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h) +# OBSOLETE pyr-xdep.o: pyr-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h) gnu-regex.o: gnu-regex.c gnu-regex.h $(defs_h) gdb_string.h @@ -11,6 +11,7 @@ TI TMS320C80 tic80-*-* Altos 3068 m68*-altos-* Convex c1-*-*, c2-*-* +Pyramid pyramid-*-* *** Changes in GDB-4.18: diff --git a/gdb/config/a29k/tm-a29k.h b/gdb/config/a29k/tm-a29k.h index 8fae020..8eb476e 100644 --- a/gdb/config/a29k/tm-a29k.h +++ b/gdb/config/a29k/tm-a29k.h @@ -310,6 +310,7 @@ extern use_struct_convention_fn a29k_use_struct_convention; TYPE_LENGTH (TYPE)); \ } +/* *INDENT-OFF* */ /* The a29k user's guide documents well what the stacks look like. But what isn't so clear there is how this interracts with the symbols, or with GDB. @@ -410,6 +411,7 @@ extern use_struct_convention_fn a29k_use_struct_convention; computed by adding msize to the saved_msp of the next frame. * msize is in the frame cache only for high C's sake. */ +/* *INDENT-ON* */ void read_register_stack (); long read_register_stack_integer (); @@ -513,7 +515,7 @@ void a29k_get_saved_register PARAMS ((char *raw_buffer, int *optimized, CORE_ADD a29k_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval) /* Call function stuff. */ - +/* *INDENT-OFF* */ /* The dummy frame looks like this (see also the general frame picture above): @@ -563,6 +565,7 @@ void a29k_get_saved_register PARAMS ((char *raw_buffer, int *optimized, CORE_ADD retaddr_sproc: Contains the PC at the time we call the function. set by PUSH_DUMMY_FRAME and read by POP_FRAME. retaddr_dummy: This points to a breakpoint instruction in the dummy. */ +/* *INDENT-ON* */ /* Rsize for dummy frame, in bytes. */ diff --git a/gdb/config/m68k/xm-3b1.h b/gdb/config/m68k/xm-3b1.h index d1cc7f1..ad4b5b7 100644 --- a/gdb/config/m68k/xm-3b1.h +++ b/gdb/config/m68k/xm-3b1.h @@ -81,5 +81,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ { asm ("subil $8,28(sp)"); \ asm ("movem (sp),$ 0xffff"); \ asm ("rte"); } - -#endif diff --git a/gdb/config/pyr/pyramid.mh b/gdb/config/pyr/pyramid.mh index cd25e57..d7ebc37 100644 --- a/gdb/config/pyr/pyramid.mh +++ b/gdb/config/pyr/pyramid.mh @@ -1,8 +1,8 @@ -# Host: Pyramid under OSx 4.0 (4.2bsd). - -#msg If you don't compile GDB with GCC, you'll need to add -#msg ALLOCA=alloca.o and ALLOCA1=alloca.o to the Makefile. -#msg - -XDEPFILES= pyr-xdep.o infptrace.o inftarg.o fork-child.o -XM_FILE= xm-pyr.h +# OBSOLETE # Host: Pyramid under OSx 4.0 (4.2bsd). +# OBSOLETE +# OBSOLETE #msg If you don't compile GDB with GCC, you'll need to add +# OBSOLETE #msg ALLOCA=alloca.o and ALLOCA1=alloca.o to the Makefile.# +# OBSOLETE msg +# OBSOLETE +# OBSOLETE XDEPFILES= pyr-xdep.o infptrace.o inftarg.o fork-child.o +# OBSOLETE XM_FILE= xm-pyr.h diff --git a/gdb/config/pyr/pyramid.mt b/gdb/config/pyr/pyramid.mt index 48f9557..342a77d 100644 --- a/gdb/config/pyr/pyramid.mt +++ b/gdb/config/pyr/pyramid.mt @@ -1,3 +1,3 @@ -# Target: Pyramid under OSx 4.0 (4.2bsd). -TDEPFILES= pyr-tdep.o -TM_FILE= tm-pyr.h +# OBSOLETE # Target: Pyramid under OSx 4.0 (4.2bsd). +# OBSOLETE TDEPFILES= pyr-tdep.o +# OBSOLETE TM_FILE= tm-pyr.h diff --git a/gdb/config/pyr/tm-pyr.h b/gdb/config/pyr/tm-pyr.h index b1deeed..e28d6fb 100644 --- a/gdb/config/pyr/tm-pyr.h +++ b/gdb/config/pyr/tm-pyr.h @@ -1,483 +1,483 @@ -/* Definitions to make GDB run on a Pyramid under OSx 4.0 (4.2bsd). - Copyright 1988, 1989, 1991, 1993 Free Software Foundation, Inc. - -This file is part of GDB. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#define TARGET_BYTE_ORDER BIG_ENDIAN - -/* Traditional Unix virtual address spaces have thre regions: text, - data and stack. The text, initialised data, and uninitialised data - are represented in separate segments of the a.out file. - When a process dumps core, the data and stack regions are written - to a core file. This gives a debugger enough information to - reconstruct (and debug) the virtual address space at the time of - the coredump. - Pyramids have an distinct fourth region of the virtual address - space, in which the contents of the windowed registers are stacked - in fixed-size frames. Pyramid refer to this region as the control - stack. Each call (or trap) automatically allocates a new register - frame; each return deallocates the current frame and restores the - windowed registers to their values before the call. - - When dumping core, the control stack is written to a core files as - a third segment. The core-handling functions need to know to deal - with it. */ - -/* Tell corefile.c there is an extra segment. */ -#define REG_STACK_SEGMENT - -/* Floating point is IEEE compatible on most Pyramid hardware - (Older processors do not have IEEE NaNs). */ -#define IEEE_FLOAT - -/* Offset from address of function to start of its code. - Zero on most machines. */ - -#define FUNCTION_START_OFFSET 0 - -/* Advance PC across any function entry prologue instructions - to reach some "real" code. */ - -/* FIXME -- do we want to skip insns to allocate the local frame? - If so, what do they look like? - This is becoming harder, since tege@sics.SE wants to change - gcc to not output a prologue when no frame is needed. */ -#define SKIP_PROLOGUE(pc) (pc) - - -/* Immediately after a function call, return the saved pc. - Can't always go through the frames for this because on some machines - the new frame is not set up until the new function executes - some instructions. */ - -#define SAVED_PC_AFTER_CALL(frame) FRAME_SAVED_PC(frame) - -/* Address of end of stack space. */ -/* This seems to be right for the 90x comp.vuw.ac.nz. - The correct value at any site may be a function of the configured - maximum control stack depth. If so, I don't know where the - control-stack depth is configured, so I can't #include it here. */ -#define STACK_END_ADDR (0xc00cc000) - -/* Register window stack (Control stack) stack definitions - - Address of beginning of control stack. - - size of control stack frame - (Note that since crts0 is usually the first function called, - main()'s control stack is one frame (0x80 bytes) beyond this value. */ - -#define CONTROL_STACK_ADDR (0xc00cd000) - -/* Bytes in a register window -- 16 parameter regs, 16 local regs - for each call, is 32 regs * 4 bytes */ - -#define CONTROL_STACK_FRAME_SIZE (32*4) - -/* FIXME. On a pyr, Data Stack grows downward; control stack goes upwards. - Which direction should we use for INNER_THAN, PC_INNER_THAN ?? */ - -#define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) - -/* Stack must be aligned on 32-bit boundaries when synthesizing - function calls. */ - -#define STACK_ALIGN(ADDR) (((ADDR) + 3) & -4) - -/* Sequence of bytes for breakpoint instruction. */ - -#define BREAKPOINT {0xf0, 00, 00, 00} - -/* Amount PC must be decremented by after a breakpoint. - This is often the number of bytes in BREAKPOINT - but not always. */ - -#define DECR_PC_AFTER_BREAK 0 - -/* Say how long (ordinary) registers are. This is a piece of bogosity - used in push_word and a few other places; REGISTER_RAW_SIZE is the - real way to know how big a register is. */ - -#define REGISTER_SIZE 4 - -/* Number of machine registers */ -/* pyramids have 64, plus one for the PSW; plus perhaps one more for the - kernel stack pointer (ksp) and control-stack pointer (CSP) */ - -#define NUM_REGS 67 - -/* Initializer for an array of names of registers. - There should be NUM_REGS strings in this initializer. */ - -#define REGISTER_NAMES \ -{"gr0", "gr1", "gr2", "gr3", "gr4", "gr5", "gr6", "gr7", \ - "gr8", "gr9", "gr10", "gr11", "logpsw", "cfp", "sp", "pc", \ - "pr0", "pr1", "pr2", "pr3", "pr4", "pr5", "pr6", "pr7", \ - "pr8", "pr9", "pr10", "pr11", "pr12", "pr13", "pr14", "pr15", \ - "lr0", "lr1", "lr2", "lr3", "lr4", "lr5", "lr6", "lr7", \ - "lr8", "lr9", "lr10", "lr11", "lr12", "lr13", "lr14", "lr15", \ - "tr0", "tr1", "tr2", "tr3", "tr4", "tr5", "tr6", "tr7", \ - "tr8", "tr9", "tr10", "tr11", "tr12", "tr13", "tr14", "tr15", \ - "psw", "ksp", "csp"} - -/* Register numbers of various important registers. - Note that some of these values are "real" register numbers, - and correspond to the general registers of the machine, - and some are "phony" register numbers which are too large - to be actual register numbers as far as the user is concerned - but do serve to get the desired values when passed to read_register. */ - -/* pseudo-registers: */ -#define PS_REGNUM 64 /* Contains processor status */ -#define PSW_REGNUM 64 /* Contains current psw, whatever it is.*/ -#define CSP_REGNUM 65 /* address of this control stack frame*/ -#define KSP_REGNUM 66 /* Contains process's Kernel Stack Pointer */ - -#define CFP_REGNUM 13 /* Current data-stack frame ptr */ -#define TR0_REGNUM 48 /* After function call, contains - function result */ - -/* Registers interesting to the machine-independent part of gdb*/ - -#define FP_REGNUM CSP_REGNUM /* Contains address of executing (control) - stack frame */ -#define SP_REGNUM 14 /* Contains address of top of stack -??*/ -#define PC_REGNUM 15 /* Contains program counter */ - -/* Define DO_REGISTERS_INFO() to do machine-specific formatting - of register dumps. */ - -#define DO_REGISTERS_INFO(_regnum, fp) pyr_do_registers_info(_regnum, fp) - -/* need this so we can find the global registers: they never get saved. */ -extern unsigned int global_reg_offset; -extern unsigned int last_frame_offset; - -/* Total amount of space needed to store our copies of the machine's - register state, the array `registers'. */ -#define REGISTER_BYTES (NUM_REGS*4) - -/* the Pyramid has register windows. */ - -#define HAVE_REGISTER_WINDOWS - -/* Is this register part of the register window system? A yes answer - implies that 1) The name of this register will not be the same in - other frames, and 2) This register is automatically "saved" (out - registers shifting into ins counts) upon subroutine calls and thus - there is no need to search more than one stack frame for it. */ - -#define REGISTER_IN_WINDOW_P(regnum) \ - ((regnum) >= 16 && (regnum) < 64) - -/* Index within `registers' of the first byte of the space for - register N. */ - -#define REGISTER_BYTE(N) ((N) * 4) - -/* Number of bytes of storage in the actual machine representation - for register N. On the Pyramid, all regs are 4 bytes. */ - -#define REGISTER_RAW_SIZE(N) 4 - -/* Number of bytes of storage in the program's representation - for register N. On the Pyramid, all regs are 4 bytes. */ - -#define REGISTER_VIRTUAL_SIZE(N) 4 - -/* Largest value REGISTER_RAW_SIZE can have. */ - -#define MAX_REGISTER_RAW_SIZE 4 - -/* Largest value REGISTER_VIRTUAL_SIZE can have. */ - -#define MAX_REGISTER_VIRTUAL_SIZE 4 - -/* Return the GDB type object for the "standard" data type - of data in register N. */ - -#define REGISTER_VIRTUAL_TYPE(N) builtin_type_int - -/* FIXME: It seems impossible for both EXTRACT_RETURN_VALUE and - STORE_RETURN_VALUE to be correct. */ - -/* Store the address of the place in which to copy the structure the - subroutine will return. This is called from call_function. */ - -/****FIXME****/ -#define STORE_STRUCT_RETURN(ADDR, SP) \ - { write_register (TR0_REGNUM, (ADDR)); } - -/* Extract from an array REGBUF containing the (raw) register state - a function return value of type TYPE, and copy that, in virtual format, - into VALBUF. */ - -/* Note that on a register-windowing machine (eg, Pyr, SPARC), this is - where the value is found after the function call -- ie, it should - correspond to GNU CC's FUNCTION_VALUE rather than FUNCTION_OUTGOING_VALUE.*/ - -#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ - memcpy (VALBUF, ((int *)(REGBUF))+TR0_REGNUM, TYPE_LENGTH (TYPE)) - -/* Write into appropriate registers a function return value - of type TYPE, given in virtual format. */ -/* on pyrs, values are returned in */ - -#define STORE_RETURN_VALUE(TYPE,VALBUF) \ - write_register_bytes (REGISTER_BYTE(TR0_REGNUM), VALBUF, TYPE_LENGTH (TYPE)) - -/* Extract from an array REGBUF containing the (raw) register state - the address in which a function should return its structure value, - as a CORE_ADDR (or an expression that can be used as one). */ -/* FIXME */ -#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ - ( ((int *)(REGBUF)) [TR0_REGNUM]) - - -/* Describe the pointer in each stack frame to the previous stack frame - (its caller). */ - -#define EXTRA_FRAME_INFO \ - CORE_ADDR bottom; \ - CORE_ADDR frame_cfp; \ - CORE_ADDR frame_window_addr; - -/* The bottom field is misnamed, since it might imply that memory from - bottom to frame contains this frame. That need not be true if - stack frames are allocated in different segments (e.g. some on a - stack, some on a heap in the data segment). */ - -#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \ -do { \ - (fci)->frame_window_addr = (fci)->frame; \ - (fci)->bottom = \ - ((fci)->next ? \ - ((fci)->frame == (fci)->next->frame ? \ - (fci)->next->bottom : (fci)->next->frame) : \ - read_register (SP_REGNUM)); \ - (fci)->frame_cfp = \ - read_register (CFP_REGNUM); \ - /***fprintf (stderr, \ - "[[creating new frame for %0x,pc=%0x,csp=%0x]]\n", \ - (fci)->frame, (fci)->pc,(fci)->frame_cfp);*/ \ -} while (0); - -/* FRAME_CHAIN takes a frame's nominal address - and produces the frame's chain-pointer. */ - -/* In the case of the pyr, the frame's nominal address is the address - of parameter register 0. The previous frame is found 32 words up. */ - -#define FRAME_CHAIN(thisframe) \ - ( (thisframe) -> frame - CONTROL_STACK_FRAME_SIZE) - - /*((thisframe) >= CONTROL_STACK_ADDR))*/ - -/* Define other aspects of the stack frame. */ - -/* A macro that tells us whether the function invocation represented - by FI does not have a frame on the stack associated with it. If it - does not, FRAMELESS is set to 1, else 0. - - I do not understand what this means on a Pyramid, where functions - *always* have a control-stack frame, but may or may not have a - frame on the data stack. Since GBD uses the value of the - control stack pointer as its "address" of a frame, FRAMELESS - is always 1, so does not need to be defined. */ - - -/* Where is the PC for a specific frame */ - -#define FRAME_SAVED_PC(fi) \ - ((CORE_ADDR) (read_memory_integer ( (fi) -> frame + 60, 4))) - -/* There may be bugs in FRAME_ARGS_ADDRESS and FRAME_LOCALS_ADDRESS; - or there may be bugs in accessing the registers that break - their definitions. - Having the macros expand into functions makes them easier to debug. - When the bug is finally located, the inline macro defintions can - be un-#if 0ed, and frame_args_addr and frame_locals_address can - be deleted from pyr-dep.c */ - -/* If the argument is on the stack, it will be here. */ -#define FRAME_ARGS_ADDRESS(fi) \ - frame_args_addr(fi) - -#define FRAME_LOCALS_ADDRESS(fi) \ - frame_locals_address(fi) - -/* The following definitions doesn't seem to work. - I don't understand why. */ -#if 0 -#define FRAME_ARGS_ADDRESS(fi) \ - /*(FRAME_FP(fi) + (13*4))*/ (read_register (CFP_REGNUM)) - -#define FRAME_LOCALS_ADDRESS(fi) \ - ((fi)->frame +(16*4)) - -#endif /* 0 */ - -/* Return number of args passed to a frame. - Can return -1, meaning no way to tell. */ - -#define FRAME_NUM_ARGS(fi) (-1) - -/* Return number of bytes at start of arglist that are not really args. */ - -#define FRAME_ARGS_SKIP 0 - -/* Put here the code to store, into a struct frame_saved_regs, - the addresses of the saved registers of frame described by FRAME_INFO. - This includes special registers such as pc and fp saved in special - ways in the stack frame. sp is even more special: - the address we return for it IS the sp for the next frame. - - Note that on register window machines, we are currently making the - assumption that window registers are being saved somewhere in the - frame in which they are being used. If they are stored in an - inferior frame, find_saved_register will break. - - On pyrs, frames of window registers are stored contiguously on a - separate stack. All window registers are always stored. - The pc and psw (gr15 and gr14) are also always saved: the call - insn saves them in pr15 and pr14 of the new frame (tr15,tr14 of the - old frame). - The data-stack frame pointer (CFP) is only saved in functions which - allocate a (data)stack frame (with "adsf"). We detect them by - looking at the first insn of the procedure. - - Other non-window registers (gr0-gr11) are never saved. Pyramid's C - compiler and gcc currently ignore them, so it's not an issue. */ - -#define FRAME_FIND_SAVED_REGS(fi_p, frame_saved_regs) \ -{ register int regnum; \ - register CORE_ADDR pc; \ - register CORE_ADDR fn_start_pc; \ - register int first_insn; \ - register CORE_ADDR prev_cf_addr; \ - register int window_ptr; \ - if (!fi_p) fatal ("Bad frame info struct in FRAME_FIND_SAVED_REGS"); \ - memset (&(frame_saved_regs), '\0', sizeof (frame_saved_regs)); \ - \ - window_ptr = prev_cf_addr = FRAME_FP(fi_p); \ - \ - for (regnum = 16 ; regnum < 64; regnum++,window_ptr+=4) \ - { \ - (frame_saved_regs).regs[regnum] = window_ptr; \ - } \ - \ - /* In each window, psw, and pc are "saved" in tr14,tr15. */ \ - /*** psw is sometimes saved in gr12 (so sez <sys/pcb.h>) */ \ - (frame_saved_regs).regs[PS_REGNUM] = FRAME_FP(fi_p) + (14*4); \ - \ -/*(frame_saved_regs).regs[PC_REGNUM] = (frame_saved_regs).regs[31];*/ \ - (frame_saved_regs).regs[PC_REGNUM] = FRAME_FP(fi_p) + ((15+32)*4); \ - \ - /* Functions that allocate a frame save sp *where*? */ \ -/*first_insn = read_memory_integer (get_pc_function_start ((fi_p)->pc),4); */ \ - \ - fn_start_pc = (get_pc_function_start ((fi_p)->pc)); \ - first_insn = read_memory_integer(fn_start_pc, 4); \ - \ - if (0x08 == ((first_insn >> 20) &0x0ff)) { \ - /* NB: because WINDOW_REGISTER_P(cfp) is false, a saved cfp \ - in this frame is only visible in this frame's callers. \ - That means the cfp we mark saved is my caller's cfp, ie pr13. \ - I don't understand why we don't have to do that for pc, too. */ \ - \ - (frame_saved_regs).regs[CFP_REGNUM] = FRAME_FP(fi_p)+(13*4); \ - \ - (frame_saved_regs).regs[SP_REGNUM] = \ - read_memory_integer (FRAME_FP(fi_p)+((13+32)*4),4); \ - } \ - \ -/* \ - *(frame_saved_regs).regs[CFP_REGNUM] = (frame_saved_regs).regs[61]; \ - * (frame_saved_regs).regs[SP_REGNUM] = \ - * read_memory_integer (FRAME_FP(fi_p)+((13+32)*4),4); \ - */ \ - \ - (frame_saved_regs).regs[CSP_REGNUM] = prev_cf_addr; \ -} - -/* Things needed for making the inferior call functions. */ -#if 0 -/* These are all lies. These macro definitions are appropriate for a - SPARC. On a pyramid, pushing a dummy frame will - surely involve writing the control stack pointer, - then saving the pc. This requires a privileged instruction. - Maybe one day Pyramid can be persuaded to add a syscall to do this. - Until then, we are out of luck. */ - -/* Push an empty stack frame, to record the current PC, etc. */ - -#define PUSH_DUMMY_FRAME \ -{ register CORE_ADDR sp = read_register (SP_REGNUM);\ - register int regnum; \ - sp = push_word (sp, 0); /* arglist */ \ - for (regnum = 11; regnum >= 0; regnum--) \ - sp = push_word (sp, read_register (regnum)); \ - sp = push_word (sp, read_register (PC_REGNUM)); \ - sp = push_word (sp, read_register (FP_REGNUM)); \ -/* sp = push_word (sp, read_register (AP_REGNUM));*/ \ - sp = push_word (sp, (read_register (PS_REGNUM) & 0xffef) \ - + 0x2fff0000); \ - sp = push_word (sp, 0); \ - write_register (SP_REGNUM, sp); \ - write_register (FP_REGNUM, sp); \ -/* write_register (AP_REGNUM, sp + 17 * sizeof (int));*/ } - -/* Discard from the stack the innermost frame, restoring all registers. */ - -#define POP_FRAME \ -{ register CORE_ADDR fp = read_register (FP_REGNUM); \ - register int regnum; \ - register int regmask = read_memory_integer (fp + 4, 4); \ - write_register (PS_REGNUM, \ - (regmask & 0xffff) \ - | (read_register (PS_REGNUM) & 0xffff0000)); \ - write_register (PC_REGNUM, read_memory_integer (fp + 16, 4)); \ - write_register (FP_REGNUM, read_memory_integer (fp + 12, 4)); \ -/* write_register (AP_REGNUM, read_memory_integer (fp + 8, 4));*/ \ - fp += 16; \ - for (regnum = 0; regnum < 12; regnum++) \ - if (regmask & (0x10000 << regnum)) \ - write_register (regnum, read_memory_integer (fp += 4, 4)); \ - fp = fp + 4 + ((regmask >> 30) & 3); \ - if (regmask & 0x20000000) \ - { regnum = read_memory_integer (fp, 4); \ - fp += (regnum + 1) * 4; } \ - write_register (SP_REGNUM, fp); \ - set_current_frame (read_register (FP_REGNUM)); } - -/* This sequence of words is the instructions - calls #69, @#32323232 - bpt - Note this is 8 bytes. */ - -#define CALL_DUMMY {0x329f69fb, 0x03323232} - -#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */ - -/* Insert the specified number of args and function address - into a call sequence of the above form stored at DUMMYNAME. */ - -#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ -{ *((char *) dummyname + 1) = nargs; \ - *(int *)((char *) dummyname + 3) = fun; } -#endif /* 0 */ - -#define POP_FRAME \ - { error ("The return command is not supported on this machine."); } +/* OBSOLETE /* Definitions to make GDB run on a Pyramid under OSx 4.0 (4.2bsd). */ +/* OBSOLETE Copyright 1988, 1989, 1991, 1993 Free Software Foundation, Inc. */ +/* OBSOLETE */ +/* OBSOLETE This file is part of GDB. */ +/* OBSOLETE */ +/* OBSOLETE This program is free software; you can redistribute it and/or modify */ +/* OBSOLETE it under the terms of the GNU General Public License as published by */ +/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */ +/* OBSOLETE (at your option) any later version. */ +/* OBSOLETE */ +/* OBSOLETE This program is distributed in the hope that it will be useful, */ +/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* OBSOLETE GNU General Public License for more details. */ +/* OBSOLETE */ +/* OBSOLETE You should have received a copy of the GNU General Public License */ +/* OBSOLETE along with this program; if not, write to the Free Software */ +/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define TARGET_BYTE_ORDER BIG_ENDIAN */ +/* OBSOLETE */ +/* OBSOLETE /* Traditional Unix virtual address spaces have thre regions: text, */ +/* OBSOLETE data and stack. The text, initialised data, and uninitialised data */ +/* OBSOLETE are represented in separate segments of the a.out file. */ +/* OBSOLETE When a process dumps core, the data and stack regions are written */ +/* OBSOLETE to a core file. This gives a debugger enough information to */ +/* OBSOLETE reconstruct (and debug) the virtual address space at the time of */ +/* OBSOLETE the coredump. */ +/* OBSOLETE Pyramids have an distinct fourth region of the virtual address */ +/* OBSOLETE space, in which the contents of the windowed registers are stacked */ +/* OBSOLETE in fixed-size frames. Pyramid refer to this region as the control */ +/* OBSOLETE stack. Each call (or trap) automatically allocates a new register */ +/* OBSOLETE frame; each return deallocates the current frame and restores the */ +/* OBSOLETE windowed registers to their values before the call. */ +/* OBSOLETE */ +/* OBSOLETE When dumping core, the control stack is written to a core files as */ +/* OBSOLETE a third segment. The core-handling functions need to know to deal */ +/* OBSOLETE with it. *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* Tell corefile.c there is an extra segment. *x/ */ +/* OBSOLETE #define REG_STACK_SEGMENT */ +/* OBSOLETE */ +/* OBSOLETE /* Floating point is IEEE compatible on most Pyramid hardware */ +/* OBSOLETE (Older processors do not have IEEE NaNs). *x/ */ +/* OBSOLETE #define IEEE_FLOAT */ +/* OBSOLETE */ +/* OBSOLETE /* Offset from address of function to start of its code. */ +/* OBSOLETE Zero on most machines. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define FUNCTION_START_OFFSET 0 */ +/* OBSOLETE */ +/* OBSOLETE /* Advance PC across any function entry prologue instructions */ +/* OBSOLETE to reach some "real" code. *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* FIXME -- do we want to skip insns to allocate the local frame? */ +/* OBSOLETE If so, what do they look like? */ +/* OBSOLETE This is becoming harder, since tege@sics.SE wants to change */ +/* OBSOLETE gcc to not output a prologue when no frame is needed. *x/ */ +/* OBSOLETE #define SKIP_PROLOGUE(pc) (pc) */ +/* OBSOLETE */ +/* OBSOLETE */ +/* OBSOLETE /* Immediately after a function call, return the saved pc. */ +/* OBSOLETE Can't always go through the frames for this because on some machines */ +/* OBSOLETE the new frame is not set up until the new function executes */ +/* OBSOLETE some instructions. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define SAVED_PC_AFTER_CALL(frame) FRAME_SAVED_PC(frame) */ +/* OBSOLETE */ +/* OBSOLETE /* Address of end of stack space. *x/ */ +/* OBSOLETE /* This seems to be right for the 90x comp.vuw.ac.nz. */ +/* OBSOLETE The correct value at any site may be a function of the configured */ +/* OBSOLETE maximum control stack depth. If so, I don't know where the */ +/* OBSOLETE control-stack depth is configured, so I can't #include it here. *x/ */ +/* OBSOLETE #define STACK_END_ADDR (0xc00cc000) */ +/* OBSOLETE */ +/* OBSOLETE /* Register window stack (Control stack) stack definitions */ +/* OBSOLETE - Address of beginning of control stack. */ +/* OBSOLETE - size of control stack frame */ +/* OBSOLETE (Note that since crts0 is usually the first function called, */ +/* OBSOLETE main()'s control stack is one frame (0x80 bytes) beyond this value. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define CONTROL_STACK_ADDR (0xc00cd000) */ +/* OBSOLETE */ +/* OBSOLETE /* Bytes in a register window -- 16 parameter regs, 16 local regs */ +/* OBSOLETE for each call, is 32 regs * 4 bytes *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define CONTROL_STACK_FRAME_SIZE (32*4) */ +/* OBSOLETE */ +/* OBSOLETE /* FIXME. On a pyr, Data Stack grows downward; control stack goes upwards. */ +/* OBSOLETE Which direction should we use for INNER_THAN, PC_INNER_THAN ?? *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) */ +/* OBSOLETE */ +/* OBSOLETE /* Stack must be aligned on 32-bit boundaries when synthesizing */ +/* OBSOLETE function calls. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define STACK_ALIGN(ADDR) (((ADDR) + 3) & -4) */ +/* OBSOLETE */ +/* OBSOLETE /* Sequence of bytes for breakpoint instruction. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define BREAKPOINT {0xf0, 00, 00, 00} */ +/* OBSOLETE */ +/* OBSOLETE /* Amount PC must be decremented by after a breakpoint. */ +/* OBSOLETE This is often the number of bytes in BREAKPOINT */ +/* OBSOLETE but not always. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define DECR_PC_AFTER_BREAK 0 */ +/* OBSOLETE */ +/* OBSOLETE /* Say how long (ordinary) registers are. This is a piece of bogosity */ +/* OBSOLETE used in push_word and a few other places; REGISTER_RAW_SIZE is the */ +/* OBSOLETE real way to know how big a register is. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define REGISTER_SIZE 4 */ +/* OBSOLETE */ +/* OBSOLETE /* Number of machine registers *x/ */ +/* OBSOLETE /* pyramids have 64, plus one for the PSW; plus perhaps one more for the */ +/* OBSOLETE kernel stack pointer (ksp) and control-stack pointer (CSP) *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define NUM_REGS 67 */ +/* OBSOLETE */ +/* OBSOLETE /* Initializer for an array of names of registers. */ +/* OBSOLETE There should be NUM_REGS strings in this initializer. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define REGISTER_NAMES \ */ +/* OBSOLETE {"gr0", "gr1", "gr2", "gr3", "gr4", "gr5", "gr6", "gr7", \ */ +/* OBSOLETE "gr8", "gr9", "gr10", "gr11", "logpsw", "cfp", "sp", "pc", \ */ +/* OBSOLETE "pr0", "pr1", "pr2", "pr3", "pr4", "pr5", "pr6", "pr7", \ */ +/* OBSOLETE "pr8", "pr9", "pr10", "pr11", "pr12", "pr13", "pr14", "pr15", \ */ +/* OBSOLETE "lr0", "lr1", "lr2", "lr3", "lr4", "lr5", "lr6", "lr7", \ */ +/* OBSOLETE "lr8", "lr9", "lr10", "lr11", "lr12", "lr13", "lr14", "lr15", \ */ +/* OBSOLETE "tr0", "tr1", "tr2", "tr3", "tr4", "tr5", "tr6", "tr7", \ */ +/* OBSOLETE "tr8", "tr9", "tr10", "tr11", "tr12", "tr13", "tr14", "tr15", \ */ +/* OBSOLETE "psw", "ksp", "csp"} */ +/* OBSOLETE */ +/* OBSOLETE /* Register numbers of various important registers. */ +/* OBSOLETE Note that some of these values are "real" register numbers, */ +/* OBSOLETE and correspond to the general registers of the machine, */ +/* OBSOLETE and some are "phony" register numbers which are too large */ +/* OBSOLETE to be actual register numbers as far as the user is concerned */ +/* OBSOLETE but do serve to get the desired values when passed to read_register. *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* pseudo-registers: *x/ */ +/* OBSOLETE #define PS_REGNUM 64 /* Contains processor status *x/ */ +/* OBSOLETE #define PSW_REGNUM 64 /* Contains current psw, whatever it is.*x/ */ +/* OBSOLETE #define CSP_REGNUM 65 /* address of this control stack frame*x/ */ +/* OBSOLETE #define KSP_REGNUM 66 /* Contains process's Kernel Stack Pointer *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define CFP_REGNUM 13 /* Current data-stack frame ptr *x/ */ +/* OBSOLETE #define TR0_REGNUM 48 /* After function call, contains */ +/* OBSOLETE function result *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* Registers interesting to the machine-independent part of gdb*x/ */ +/* OBSOLETE */ +/* OBSOLETE #define FP_REGNUM CSP_REGNUM /* Contains address of executing (control) */ +/* OBSOLETE stack frame *x/ */ +/* OBSOLETE #define SP_REGNUM 14 /* Contains address of top of stack -??*x/ */ +/* OBSOLETE #define PC_REGNUM 15 /* Contains program counter *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* Define DO_REGISTERS_INFO() to do machine-specific formatting */ +/* OBSOLETE of register dumps. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define DO_REGISTERS_INFO(_regnum, fp) pyr_do_registers_info(_regnum, fp) */ +/* OBSOLETE */ +/* OBSOLETE /* need this so we can find the global registers: they never get saved. *x/ */ +/* OBSOLETE extern unsigned int global_reg_offset; */ +/* OBSOLETE extern unsigned int last_frame_offset; */ +/* OBSOLETE */ +/* OBSOLETE /* Total amount of space needed to store our copies of the machine's */ +/* OBSOLETE register state, the array `registers'. *x/ */ +/* OBSOLETE #define REGISTER_BYTES (NUM_REGS*4) */ +/* OBSOLETE */ +/* OBSOLETE /* the Pyramid has register windows. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define HAVE_REGISTER_WINDOWS */ +/* OBSOLETE */ +/* OBSOLETE /* Is this register part of the register window system? A yes answer */ +/* OBSOLETE implies that 1) The name of this register will not be the same in */ +/* OBSOLETE other frames, and 2) This register is automatically "saved" (out */ +/* OBSOLETE registers shifting into ins counts) upon subroutine calls and thus */ +/* OBSOLETE there is no need to search more than one stack frame for it. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define REGISTER_IN_WINDOW_P(regnum) \ */ +/* OBSOLETE ((regnum) >= 16 && (regnum) < 64) */ +/* OBSOLETE */ +/* OBSOLETE /* Index within `registers' of the first byte of the space for */ +/* OBSOLETE register N. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define REGISTER_BYTE(N) ((N) * 4) */ +/* OBSOLETE */ +/* OBSOLETE /* Number of bytes of storage in the actual machine representation */ +/* OBSOLETE for register N. On the Pyramid, all regs are 4 bytes. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define REGISTER_RAW_SIZE(N) 4 */ +/* OBSOLETE */ +/* OBSOLETE /* Number of bytes of storage in the program's representation */ +/* OBSOLETE for register N. On the Pyramid, all regs are 4 bytes. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) 4 */ +/* OBSOLETE */ +/* OBSOLETE /* Largest value REGISTER_RAW_SIZE can have. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define MAX_REGISTER_RAW_SIZE 4 */ +/* OBSOLETE */ +/* OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE 4 */ +/* OBSOLETE */ +/* OBSOLETE /* Return the GDB type object for the "standard" data type */ +/* OBSOLETE of data in register N. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) builtin_type_int */ +/* OBSOLETE */ +/* OBSOLETE /* FIXME: It seems impossible for both EXTRACT_RETURN_VALUE and */ +/* OBSOLETE STORE_RETURN_VALUE to be correct. *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* Store the address of the place in which to copy the structure the */ +/* OBSOLETE subroutine will return. This is called from call_function. *x/ */ +/* OBSOLETE */ +/* OBSOLETE /****FIXME****x/ */ +/* OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) \ */ +/* OBSOLETE { write_register (TR0_REGNUM, (ADDR)); } */ +/* OBSOLETE */ +/* OBSOLETE /* Extract from an array REGBUF containing the (raw) register state */ +/* OBSOLETE a function return value of type TYPE, and copy that, in virtual format, */ +/* OBSOLETE into VALBUF. *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* Note that on a register-windowing machine (eg, Pyr, SPARC), this is */ +/* OBSOLETE where the value is found after the function call -- ie, it should */ +/* OBSOLETE correspond to GNU CC's FUNCTION_VALUE rather than FUNCTION_OUTGOING_VALUE.*x/ */ +/* OBSOLETE */ +/* OBSOLETE #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ */ +/* OBSOLETE memcpy (VALBUF, ((int *)(REGBUF))+TR0_REGNUM, TYPE_LENGTH (TYPE)) */ +/* OBSOLETE */ +/* OBSOLETE /* Write into appropriate registers a function return value */ +/* OBSOLETE of type TYPE, given in virtual format. *x/ */ +/* OBSOLETE /* on pyrs, values are returned in *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \ */ +/* OBSOLETE write_register_bytes (REGISTER_BYTE(TR0_REGNUM), VALBUF, TYPE_LENGTH (TYPE)) */ +/* OBSOLETE */ +/* OBSOLETE /* Extract from an array REGBUF containing the (raw) register state */ +/* OBSOLETE the address in which a function should return its structure value, */ +/* OBSOLETE as a CORE_ADDR (or an expression that can be used as one). *x/ */ +/* OBSOLETE /* FIXME *x/ */ +/* OBSOLETE #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ */ +/* OBSOLETE ( ((int *)(REGBUF)) [TR0_REGNUM]) */ +/* OBSOLETE */ +/* OBSOLETE */ +/* OBSOLETE /* Describe the pointer in each stack frame to the previous stack frame */ +/* OBSOLETE (its caller). *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define EXTRA_FRAME_INFO \ */ +/* OBSOLETE CORE_ADDR bottom; \ */ +/* OBSOLETE CORE_ADDR frame_cfp; \ */ +/* OBSOLETE CORE_ADDR frame_window_addr; */ +/* OBSOLETE */ +/* OBSOLETE /* The bottom field is misnamed, since it might imply that memory from */ +/* OBSOLETE bottom to frame contains this frame. That need not be true if */ +/* OBSOLETE stack frames are allocated in different segments (e.g. some on a */ +/* OBSOLETE stack, some on a heap in the data segment). *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \ */ +/* OBSOLETE do { \ */ +/* OBSOLETE (fci)->frame_window_addr = (fci)->frame; \ */ +/* OBSOLETE (fci)->bottom = \ */ +/* OBSOLETE ((fci)->next ? \ */ +/* OBSOLETE ((fci)->frame == (fci)->next->frame ? \ */ +/* OBSOLETE (fci)->next->bottom : (fci)->next->frame) : \ */ +/* OBSOLETE read_register (SP_REGNUM)); \ */ +/* OBSOLETE (fci)->frame_cfp = \ */ +/* OBSOLETE read_register (CFP_REGNUM); \ */ +/* OBSOLETE /***fprintf (stderr, \ */ +/* OBSOLETE "[[creating new frame for %0x,pc=%0x,csp=%0x]]\n", \ */ +/* OBSOLETE (fci)->frame, (fci)->pc,(fci)->frame_cfp);*x/ \ */ +/* OBSOLETE } while (0); */ +/* OBSOLETE */ +/* OBSOLETE /* FRAME_CHAIN takes a frame's nominal address */ +/* OBSOLETE and produces the frame's chain-pointer. *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* In the case of the pyr, the frame's nominal address is the address */ +/* OBSOLETE of parameter register 0. The previous frame is found 32 words up. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define FRAME_CHAIN(thisframe) \ */ +/* OBSOLETE ( (thisframe) -> frame - CONTROL_STACK_FRAME_SIZE) */ +/* OBSOLETE */ +/* OBSOLETE /*((thisframe) >= CONTROL_STACK_ADDR))*x/ */ +/* OBSOLETE */ +/* OBSOLETE /* Define other aspects of the stack frame. *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* A macro that tells us whether the function invocation represented */ +/* OBSOLETE by FI does not have a frame on the stack associated with it. If it */ +/* OBSOLETE does not, FRAMELESS is set to 1, else 0. */ +/* OBSOLETE */ +/* OBSOLETE I do not understand what this means on a Pyramid, where functions */ +/* OBSOLETE *always* have a control-stack frame, but may or may not have a */ +/* OBSOLETE frame on the data stack. Since GBD uses the value of the */ +/* OBSOLETE control stack pointer as its "address" of a frame, FRAMELESS */ +/* OBSOLETE is always 1, so does not need to be defined. *x/ */ +/* OBSOLETE */ +/* OBSOLETE */ +/* OBSOLETE /* Where is the PC for a specific frame *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define FRAME_SAVED_PC(fi) \ */ +/* OBSOLETE ((CORE_ADDR) (read_memory_integer ( (fi) -> frame + 60, 4))) */ +/* OBSOLETE */ +/* OBSOLETE /* There may be bugs in FRAME_ARGS_ADDRESS and FRAME_LOCALS_ADDRESS; */ +/* OBSOLETE or there may be bugs in accessing the registers that break */ +/* OBSOLETE their definitions. */ +/* OBSOLETE Having the macros expand into functions makes them easier to debug. */ +/* OBSOLETE When the bug is finally located, the inline macro defintions can */ +/* OBSOLETE be un-#if 0ed, and frame_args_addr and frame_locals_address can */ +/* OBSOLETE be deleted from pyr-dep.c *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* If the argument is on the stack, it will be here. *x/ */ +/* OBSOLETE #define FRAME_ARGS_ADDRESS(fi) \ */ +/* OBSOLETE frame_args_addr(fi) */ +/* OBSOLETE */ +/* OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) \ */ +/* OBSOLETE frame_locals_address(fi) */ +/* OBSOLETE */ +/* OBSOLETE /* The following definitions doesn't seem to work. */ +/* OBSOLETE I don't understand why. *x/ */ +/* OBSOLETE #if 0 */ +/* OBSOLETE #define FRAME_ARGS_ADDRESS(fi) \ */ +/* OBSOLETE /*(FRAME_FP(fi) + (13*4))*x/ (read_register (CFP_REGNUM)) */ +/* OBSOLETE */ +/* OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) \ */ +/* OBSOLETE ((fi)->frame +(16*4)) */ +/* OBSOLETE */ +/* OBSOLETE #endif /* 0 *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* Return number of args passed to a frame. */ +/* OBSOLETE Can return -1, meaning no way to tell. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define FRAME_NUM_ARGS(fi) (-1) */ +/* OBSOLETE */ +/* OBSOLETE /* Return number of bytes at start of arglist that are not really args. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define FRAME_ARGS_SKIP 0 */ +/* OBSOLETE */ +/* OBSOLETE /* Put here the code to store, into a struct frame_saved_regs, */ +/* OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO. */ +/* OBSOLETE This includes special registers such as pc and fp saved in special */ +/* OBSOLETE ways in the stack frame. sp is even more special: */ +/* OBSOLETE the address we return for it IS the sp for the next frame. */ +/* OBSOLETE */ +/* OBSOLETE Note that on register window machines, we are currently making the */ +/* OBSOLETE assumption that window registers are being saved somewhere in the */ +/* OBSOLETE frame in which they are being used. If they are stored in an */ +/* OBSOLETE inferior frame, find_saved_register will break. */ +/* OBSOLETE */ +/* OBSOLETE On pyrs, frames of window registers are stored contiguously on a */ +/* OBSOLETE separate stack. All window registers are always stored. */ +/* OBSOLETE The pc and psw (gr15 and gr14) are also always saved: the call */ +/* OBSOLETE insn saves them in pr15 and pr14 of the new frame (tr15,tr14 of the */ +/* OBSOLETE old frame). */ +/* OBSOLETE The data-stack frame pointer (CFP) is only saved in functions which */ +/* OBSOLETE allocate a (data)stack frame (with "adsf"). We detect them by */ +/* OBSOLETE looking at the first insn of the procedure. */ +/* OBSOLETE */ +/* OBSOLETE Other non-window registers (gr0-gr11) are never saved. Pyramid's C */ +/* OBSOLETE compiler and gcc currently ignore them, so it's not an issue. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define FRAME_FIND_SAVED_REGS(fi_p, frame_saved_regs) \ */ +/* OBSOLETE { register int regnum; \ */ +/* OBSOLETE register CORE_ADDR pc; \ */ +/* OBSOLETE register CORE_ADDR fn_start_pc; \ */ +/* OBSOLETE register int first_insn; \ */ +/* OBSOLETE register CORE_ADDR prev_cf_addr; \ */ +/* OBSOLETE register int window_ptr; \ */ +/* OBSOLETE if (!fi_p) fatal ("Bad frame info struct in FRAME_FIND_SAVED_REGS"); \ */ +/* OBSOLETE memset (&(frame_saved_regs), '\0', sizeof (frame_saved_regs)); \ */ +/* OBSOLETE \ */ +/* OBSOLETE window_ptr = prev_cf_addr = FRAME_FP(fi_p); \ */ +/* OBSOLETE \ */ +/* OBSOLETE for (regnum = 16 ; regnum < 64; regnum++,window_ptr+=4) \ */ +/* OBSOLETE { \ */ +/* OBSOLETE (frame_saved_regs).regs[regnum] = window_ptr; \ */ +/* OBSOLETE } \ */ +/* OBSOLETE \ */ +/* OBSOLETE /* In each window, psw, and pc are "saved" in tr14,tr15. *x/ \ */ +/* OBSOLETE /*** psw is sometimes saved in gr12 (so sez <sys/pcb.h>) *x/ \ */ +/* OBSOLETE (frame_saved_regs).regs[PS_REGNUM] = FRAME_FP(fi_p) + (14*4); \ */ +/* OBSOLETE \ */ +/* OBSOLETE /*(frame_saved_regs).regs[PC_REGNUM] = (frame_saved_regs).regs[31];*x/ \ */ +/* OBSOLETE (frame_saved_regs).regs[PC_REGNUM] = FRAME_FP(fi_p) + ((15+32)*4); \ */ +/* OBSOLETE \ */ +/* OBSOLETE /* Functions that allocate a frame save sp *where*? *x/ \ */ +/* OBSOLETE /*first_insn = read_memory_integer (get_pc_function_start ((fi_p)->pc),4); *x/ \ */ +/* OBSOLETE \ */ +/* OBSOLETE fn_start_pc = (get_pc_function_start ((fi_p)->pc)); \ */ +/* OBSOLETE first_insn = read_memory_integer(fn_start_pc, 4); \ */ +/* OBSOLETE \ */ +/* OBSOLETE if (0x08 == ((first_insn >> 20) &0x0ff)) { \ */ +/* OBSOLETE /* NB: because WINDOW_REGISTER_P(cfp) is false, a saved cfp \ */ +/* OBSOLETE in this frame is only visible in this frame's callers. \ */ +/* OBSOLETE That means the cfp we mark saved is my caller's cfp, ie pr13. \ */ +/* OBSOLETE I don't understand why we don't have to do that for pc, too. *x/ \ */ +/* OBSOLETE \ */ +/* OBSOLETE (frame_saved_regs).regs[CFP_REGNUM] = FRAME_FP(fi_p)+(13*4); \ */ +/* OBSOLETE \ */ +/* OBSOLETE (frame_saved_regs).regs[SP_REGNUM] = \ */ +/* OBSOLETE read_memory_integer (FRAME_FP(fi_p)+((13+32)*4),4); \ */ +/* OBSOLETE } \ */ +/* OBSOLETE \ */ +/* OBSOLETE /* \ */ +/* OBSOLETE *(frame_saved_regs).regs[CFP_REGNUM] = (frame_saved_regs).regs[61]; \ */ +/* OBSOLETE * (frame_saved_regs).regs[SP_REGNUM] = \ */ +/* OBSOLETE * read_memory_integer (FRAME_FP(fi_p)+((13+32)*4),4); \ */ +/* OBSOLETE *x/ \ */ +/* OBSOLETE \ */ +/* OBSOLETE (frame_saved_regs).regs[CSP_REGNUM] = prev_cf_addr; \ */ +/* OBSOLETE } */ +/* OBSOLETE */ +/* OBSOLETE /* Things needed for making the inferior call functions. *x/ */ +/* OBSOLETE #if 0 */ +/* OBSOLETE /* These are all lies. These macro definitions are appropriate for a */ +/* OBSOLETE SPARC. On a pyramid, pushing a dummy frame will */ +/* OBSOLETE surely involve writing the control stack pointer, */ +/* OBSOLETE then saving the pc. This requires a privileged instruction. */ +/* OBSOLETE Maybe one day Pyramid can be persuaded to add a syscall to do this. */ +/* OBSOLETE Until then, we are out of luck. *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* Push an empty stack frame, to record the current PC, etc. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define PUSH_DUMMY_FRAME \ */ +/* OBSOLETE { register CORE_ADDR sp = read_register (SP_REGNUM);\ */ +/* OBSOLETE register int regnum; \ */ +/* OBSOLETE sp = push_word (sp, 0); /* arglist *x/ \ */ +/* OBSOLETE for (regnum = 11; regnum >= 0; regnum--) \ */ +/* OBSOLETE sp = push_word (sp, read_register (regnum)); \ */ +/* OBSOLETE sp = push_word (sp, read_register (PC_REGNUM)); \ */ +/* OBSOLETE sp = push_word (sp, read_register (FP_REGNUM)); \ */ +/* OBSOLETE /* sp = push_word (sp, read_register (AP_REGNUM));*x/ \ */ +/* OBSOLETE sp = push_word (sp, (read_register (PS_REGNUM) & 0xffef) \ */ +/* OBSOLETE + 0x2fff0000); \ */ +/* OBSOLETE sp = push_word (sp, 0); \ */ +/* OBSOLETE write_register (SP_REGNUM, sp); \ */ +/* OBSOLETE write_register (FP_REGNUM, sp); \ */ +/* OBSOLETE /* write_register (AP_REGNUM, sp + 17 * sizeof (int));*x/ } */ +/* OBSOLETE */ +/* OBSOLETE /* Discard from the stack the innermost frame, restoring all registers. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define POP_FRAME \ */ +/* OBSOLETE { register CORE_ADDR fp = read_register (FP_REGNUM); \ */ +/* OBSOLETE register int regnum; \ */ +/* OBSOLETE register int regmask = read_memory_integer (fp + 4, 4); \ */ +/* OBSOLETE write_register (PS_REGNUM, \ */ +/* OBSOLETE (regmask & 0xffff) \ */ +/* OBSOLETE | (read_register (PS_REGNUM) & 0xffff0000)); \ */ +/* OBSOLETE write_register (PC_REGNUM, read_memory_integer (fp + 16, 4)); \ */ +/* OBSOLETE write_register (FP_REGNUM, read_memory_integer (fp + 12, 4)); \ */ +/* OBSOLETE /* write_register (AP_REGNUM, read_memory_integer (fp + 8, 4));*x/ \ */ +/* OBSOLETE fp += 16; \ */ +/* OBSOLETE for (regnum = 0; regnum < 12; regnum++) \ */ +/* OBSOLETE if (regmask & (0x10000 << regnum)) \ */ +/* OBSOLETE write_register (regnum, read_memory_integer (fp += 4, 4)); \ */ +/* OBSOLETE fp = fp + 4 + ((regmask >> 30) & 3); \ */ +/* OBSOLETE if (regmask & 0x20000000) \ */ +/* OBSOLETE { regnum = read_memory_integer (fp, 4); \ */ +/* OBSOLETE fp += (regnum + 1) * 4; } \ */ +/* OBSOLETE write_register (SP_REGNUM, fp); \ */ +/* OBSOLETE set_current_frame (read_register (FP_REGNUM)); } */ +/* OBSOLETE */ +/* OBSOLETE /* This sequence of words is the instructions */ +/* OBSOLETE calls #69, @#32323232 */ +/* OBSOLETE bpt */ +/* OBSOLETE Note this is 8 bytes. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define CALL_DUMMY {0x329f69fb, 0x03323232} */ +/* OBSOLETE */ +/* OBSOLETE #define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* Insert the specified number of args and function address */ +/* OBSOLETE into a call sequence of the above form stored at DUMMYNAME. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ */ +/* OBSOLETE { *((char *) dummyname + 1) = nargs; \ */ +/* OBSOLETE *(int *)((char *) dummyname + 3) = fun; } */ +/* OBSOLETE #endif /* 0 *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define POP_FRAME \ */ +/* OBSOLETE { error ("The return command is not supported on this machine."); } */ diff --git a/gdb/config/pyr/xm-pyr.h b/gdb/config/pyr/xm-pyr.h index f45d10a..d10afc5 100644 --- a/gdb/config/pyr/xm-pyr.h +++ b/gdb/config/pyr/xm-pyr.h @@ -1,92 +1,92 @@ -/* Definitions to make GDB run on a Pyramidax under OSx 4.0 (4.2bsd). - Copyright 1988, 1989, 1992 Free Software Foundation, Inc. - -This file is part of GDB. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#define HOST_BYTE_ORDER BIG_ENDIAN - -/* Define PYRAMID_CONTROL_FRAME_DEBUGGING to get copious messages - about reading the control stack on standard output. This - makes gdb unusable as a debugger. */ - -/* #define PYRAMID_CONTROL_FRAME_DEBUGGING */ - -/* Define PYRAMID_FRAME_DEBUGGING for ? */ - -/* use Pyramid's slightly strange ptrace */ -#define PYRAMID_PTRACE - -/* Traditional Unix virtual address spaces have thre regions: text, - data and stack. The text, initialised data, and uninitialised data - are represented in separate segments of the a.out file. - When a process dumps core, the data and stack regions are written - to a core file. This gives a debugger enough information to - reconstruct (and debug) the virtual address space at the time of - the coredump. - Pyramids have an distinct fourth region of the virtual address - space, in which the contents of the windowed registers are stacked - in fixed-size frames. Pyramid refer to this region as the control - stack. Each call (or trap) automatically allocates a new register - frame; each return deallocates the current frame and restores the - windowed registers to their values before the call. - - When dumping core, the control stack is written to a core files as - a third segment. The core-handling functions need to know to deal - with it. */ - -/* Tell dep.c what the extra segment is. */ -#define PYRAMID_CORE - -#define NO_SIGINTERRUPT - -#define HAVE_WAIT_STRUCT - -/* This is the amount to subtract from u.u_ar0 - to get the offset in the core file of the register values. */ - -#define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG)) - -/* Define offsets of registers in the core file (or maybe u area) */ -#define REGISTER_U_ADDR(addr, blockend, regno) \ -{ struct user __u; \ - addr = blockend + (regno - 16 ) * 4; \ - if (regno == 67) { \ - printf("\\geting reg 67\\"); \ - addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u; \ - } else if (regno == KSP_REGNUM) { \ - printf("\\geting KSP (reg %d)\\", KSP_REGNUM); \ - addr = (int)(&__u.u_pcb.pcb_ksp) - (int) &__u; \ - } else if (regno == CSP_REGNUM) { \ - printf("\\geting CSP (reg %d\\",CSP_REGNUM); \ - addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u; \ - } else if (regno == 64) { \ - printf("\\geting reg 64\\"); \ - addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u; \ - } else if (regno == PS_REGNUM) \ - addr = blockend - 4; \ - else if (1 && ((16 > regno) && (regno > 11))) \ - addr = last_frame_offset + (4 *(regno+32)); \ - else if (0 && (12 > regno)) \ - addr = global_reg_offset + (4 *regno); \ - else if (16 > regno) \ - addr = global_reg_offset + (4 *regno); \ - else \ - addr = blockend + (regno - 16 ) * 4; \ -} - -/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ -#define FETCH_INFERIOR_REGISTERS +/* OBSOLETE /* Definitions to make GDB run on a Pyramidax under OSx 4.0 (4.2bsd). */ +/* OBSOLETE Copyright 1988, 1989, 1992 Free Software Foundation, Inc. */ +/* OBSOLETE */ +/* OBSOLETE This file is part of GDB. */ +/* OBSOLETE */ +/* OBSOLETE This program is free software; you can redistribute it and/or modify */ +/* OBSOLETE it under the terms of the GNU General Public License as published by */ +/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */ +/* OBSOLETE (at your option) any later version. */ +/* OBSOLETE */ +/* OBSOLETE This program is distributed in the hope that it will be useful, */ +/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* OBSOLETE GNU General Public License for more details. */ +/* OBSOLETE */ +/* OBSOLETE You should have received a copy of the GNU General Public License */ +/* OBSOLETE along with this program; if not, write to the Free Software */ +/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define HOST_BYTE_ORDER BIG_ENDIAN */ +/* OBSOLETE */ +/* OBSOLETE /* Define PYRAMID_CONTROL_FRAME_DEBUGGING to get copious messages */ +/* OBSOLETE about reading the control stack on standard output. This */ +/* OBSOLETE makes gdb unusable as a debugger. *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* #define PYRAMID_CONTROL_FRAME_DEBUGGING *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* Define PYRAMID_FRAME_DEBUGGING for ? *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* use Pyramid's slightly strange ptrace *x/ */ +/* OBSOLETE #define PYRAMID_PTRACE */ +/* OBSOLETE */ +/* OBSOLETE /* Traditional Unix virtual address spaces have thre regions: text, */ +/* OBSOLETE data and stack. The text, initialised data, and uninitialised data */ +/* OBSOLETE are represented in separate segments of the a.out file. */ +/* OBSOLETE When a process dumps core, the data and stack regions are written */ +/* OBSOLETE to a core file. This gives a debugger enough information to */ +/* OBSOLETE reconstruct (and debug) the virtual address space at the time of */ +/* OBSOLETE the coredump. */ +/* OBSOLETE Pyramids have an distinct fourth region of the virtual address */ +/* OBSOLETE space, in which the contents of the windowed registers are stacked */ +/* OBSOLETE in fixed-size frames. Pyramid refer to this region as the control */ +/* OBSOLETE stack. Each call (or trap) automatically allocates a new register */ +/* OBSOLETE frame; each return deallocates the current frame and restores the */ +/* OBSOLETE windowed registers to their values before the call. */ +/* OBSOLETE */ +/* OBSOLETE When dumping core, the control stack is written to a core files as */ +/* OBSOLETE a third segment. The core-handling functions need to know to deal */ +/* OBSOLETE with it. *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* Tell dep.c what the extra segment is. *x/ */ +/* OBSOLETE #define PYRAMID_CORE */ +/* OBSOLETE */ +/* OBSOLETE #define NO_SIGINTERRUPT */ +/* OBSOLETE */ +/* OBSOLETE #define HAVE_WAIT_STRUCT */ +/* OBSOLETE */ +/* OBSOLETE /* This is the amount to subtract from u.u_ar0 */ +/* OBSOLETE to get the offset in the core file of the register values. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG)) */ +/* OBSOLETE */ +/* OBSOLETE /* Define offsets of registers in the core file (or maybe u area) *x/ */ +/* OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) \ */ +/* OBSOLETE { struct user __u; \ */ +/* OBSOLETE addr = blockend + (regno - 16 ) * 4; \ */ +/* OBSOLETE if (regno == 67) { \ */ +/* OBSOLETE printf("\\geting reg 67\\"); \ */ +/* OBSOLETE addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u; \ */ +/* OBSOLETE } else if (regno == KSP_REGNUM) { \ */ +/* OBSOLETE printf("\\geting KSP (reg %d)\\", KSP_REGNUM); \ */ +/* OBSOLETE addr = (int)(&__u.u_pcb.pcb_ksp) - (int) &__u; \ */ +/* OBSOLETE } else if (regno == CSP_REGNUM) { \ */ +/* OBSOLETE printf("\\geting CSP (reg %d\\",CSP_REGNUM); \ */ +/* OBSOLETE addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u; \ */ +/* OBSOLETE } else if (regno == 64) { \ */ +/* OBSOLETE printf("\\geting reg 64\\"); \ */ +/* OBSOLETE addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u; \ */ +/* OBSOLETE } else if (regno == PS_REGNUM) \ */ +/* OBSOLETE addr = blockend - 4; \ */ +/* OBSOLETE else if (1 && ((16 > regno) && (regno > 11))) \ */ +/* OBSOLETE addr = last_frame_offset + (4 *(regno+32)); \ */ +/* OBSOLETE else if (0 && (12 > regno)) \ */ +/* OBSOLETE addr = global_reg_offset + (4 *regno); \ */ +/* OBSOLETE else if (16 > regno) \ */ +/* OBSOLETE addr = global_reg_offset + (4 *regno); \ */ +/* OBSOLETE else \ */ +/* OBSOLETE addr = blockend + (regno - 16 ) * 4; \ */ +/* OBSOLETE } */ +/* OBSOLETE */ +/* OBSOLETE /* Override copies of {fetch,store}_inferior_registers in infptrace.c. *x/ */ +/* OBSOLETE #define FETCH_INFERIOR_REGISTERS */ diff --git a/gdb/configure.host b/gdb/configure.host index 84df8fa..47e8603 100644 --- a/gdb/configure.host +++ b/gdb/configure.host @@ -17,7 +17,7 @@ i[3456]86*) gdb_host_cpu=i386 ;; m68*) gdb_host_cpu=m68k ;; m88*) gdb_host_cpu=m88k ;; # OBSOLETE np1) gdb_host_cpu=gould ;; -pyramid) gdb_host_cpu=pyr ;; +# OBSOLETE pyramid) gdb_host_cpu=pyr ;; powerpc*) gdb_host_cpu=powerpc ;; sparc64) gdb_host_cpu=sparc ;; *) gdb_host_cpu=$host_cpu ;; @@ -133,9 +133,9 @@ powerpcle-*-cygwin*) gdb_host=cygwin ;; powerpcle-*-solaris*) gdb_host=solaris ;; powerpc-*-linux*) gdb_host=linux ;; -# OBSOLETE pn-*-*) gdb_host=pn ;; +# OBSOLETE pn-*-*) gdb_host=pn ;; -pyramid-*-*) gdb_host=pyramid ;; +# OBSOLETE pyramid-*-*) gdb_host=pyramid ;; romp-*-*) gdb_host=rtbsd ;; diff --git a/gdb/configure.tgt b/gdb/configure.tgt index dbe822a..3f23a73 100644 --- a/gdb/configure.tgt +++ b/gdb/configure.tgt @@ -22,7 +22,7 @@ mips*) gdb_target_cpu=mips ;; # OBSOLETE np1) gdb_target_cpu=gould ;; powerpc*) gdb_target_cpu=powerpc ;; # OBSOLETE pn) gdb_target_cpu=gould ;; -pyramid) gdb_target_cpu=pyr ;; +# OBSOLETE pyramid) gdb_target_cpu=pyr ;; sparc*) gdb_target_cpu=sparc ;; thumb*) gdb_target_cpu=arm ;; strongarm*) gdb_target_cpu=arm ;; @@ -225,7 +225,7 @@ powerpcle-*-eabi* | powerpcle-*-sysv* | powerpcle-*-elf*) gdb_target=ppcle-eabi fi ;; -pyramid-*-*) gdb_target=pyramid ;; +# OBSOLETE pyramid-*-*) gdb_target=pyramid ;; rs6000-*-lynxos*) gdb_target=rs6000lynx ;; rs6000-*-aix4*) gdb_target=aix4 ;; @@ -1,3 +1,4 @@ +/* *INDENT-OFF* */ /* ATTR_FORMAT confuses indent, avoid running it for now */ /* Basic, host-specific, and target-specific definitions for GDB. Copyright (C) 1986, 89, 91, 92, 93, 94, 95, 96, 1998 Free Software Foundation, Inc. @@ -1224,3 +1225,4 @@ extern int use_windows; #endif #endif /* #ifndef DEFS_H */ +/* *INDENT-ON* */ diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c index 9de0312..45a0e23 100644 --- a/gdb/dwarfread.c +++ b/gdb/dwarfread.c @@ -2658,6 +2658,7 @@ add_partial_symbol (dip, objfile) } } +/* *INDENT-OFF* */ /* LOCAL FUNCTION @@ -2721,6 +2722,7 @@ NOTES where the actual definition occurs, rather than just a reference to an external. */ +/* *INDENT-ON* */ static void scan_partial_symbols (thisdie, enddie, objfile) diff --git a/gdb/event-loop.h b/gdb/event-loop.h index b53f8e2..86abb22 100644 --- a/gdb/event-loop.h +++ b/gdb/event-loop.h @@ -255,3 +255,4 @@ extern char *new_async_prompt; extern struct prompts the_prompts; extern void (*call_readline) PARAMS ((void)); extern void (*input_handler) PARAMS ((char *)); +extern int input_fd; @@ -570,20 +570,6 @@ xfer_memory (memaddr, myaddr, len, write, target) return - (nextsectaddr - memaddr); /* Next boundary where we can help */ } -#ifdef FIXME -#ifdef REG_STACK_SEGMENT -/* MOVE TO BFD... */ - /* Pyramids and AM29000s have an extra segment in the virtual address space - for the (control) stack of register-window frames. The AM29000 folk - call it the "register stack" rather than the "memory stack". */ - else if (memaddr >= reg_stack_start && memaddr < reg_stack_end) - { - i = min (len, reg_stack_end - memaddr); - fileptr = memaddr - reg_stack_start + reg_stack_offset; - wanna_xfer = coredata; - } -#endif /* REG_STACK_SEGMENT */ -#endif /* FIXME */ void print_section_info (t, abfd) diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 1037be7..dc026a4 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -1211,10 +1211,14 @@ add_mangled_type(pextras,t) { char* pname; if ((pname=strrchr(tname,'l'),pname) && !strcmp(pname,"long")) - ADD_EXTRA('l') - else - ADD_EXTRA('i') - } + { + ADD_EXTRA ('l'); + } + else + { + ADD_EXTRA ('i'); + } + } break; default: { diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c index 2c5843b..f50b64f 100644 --- a/gdb/gnu-nat.c +++ b/gdb/gnu-nat.c @@ -2524,8 +2524,7 @@ struct cmd_list_element *show_thread_default_cmd_list = NULL; static void set_thread_cmd (char *args, int from_tty) { - printf_unfiltered ("\"set thread\" must be followed by the name of a thread -property, or \"default\".\n"); + printf_unfiltered ("\"set thread\" must be followed by the name of a thread property, or \"default\".\n"); } static void @@ -2952,8 +2951,7 @@ static void add_task_commands () "Set whether new threads are allowed to run (once gdb has noticed them).", &set_thread_default_cmd_list); add_cmd ("run", no_class, show_thread_default_run_cmd, - "Show whether new threads are allowed to run (once gdb has noticed -them).", + "Show whether new threads are allowed to run (once gdb has noticed them).", &show_thread_default_cmd_list); add_cmd ("detach-suspend-count", class_run, set_thread_default_detach_sc_cmd, "Set the default detach-suspend-count value for new threads.", diff --git a/gdb/gnu-nat.h b/gdb/gnu-nat.h index f50ba60..3a32ab6 100644 --- a/gdb/gnu-nat.h +++ b/gdb/gnu-nat.h @@ -85,6 +85,6 @@ extern int gnu_debug_flag; #define debug(msg, args...) \ do { if (gnu_debug_flag) \ - fprintf (stderr, "%s: " msg "\r\n", __FUNCTION__ , ##args); } while (0) + fprintf_unfiltered (gdb_stdlog, "%s: " msg "\r\n", __FUNCTION__ , ##args); } while (0) #endif /* __GNU_NAT_H__ */ diff --git a/gdb/gnu-regex.c b/gdb/gnu-regex.c index 84db70f..3b83327 100644 --- a/gdb/gnu-regex.c +++ b/gdb/gnu-regex.c @@ -1,3 +1,4 @@ +/* *INDENT-OFF* */ /* keep in sync with glibc */ /* Extended regular expression matching and search library, version 0.12. (Implements POSIX draft P1003.2/D11.2, except for some of the diff --git a/gdb/gnu-regex.h b/gdb/gnu-regex.h index 9153ea1..4d62b03 100644 --- a/gdb/gnu-regex.h +++ b/gdb/gnu-regex.h @@ -1,3 +1,4 @@ +/* *INDENT-OFF* */ /* keep in sync with glibc */ /* Definitions for data structures and routines for the regular expression library, version 0.12. Copyright (C) 1985,89,90,91,92,93,95,96,97,98 Free Software Foundation, Inc. diff --git a/gdb/infcmd.c b/gdb/infcmd.c index ba4e798..17c3d6d 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -198,8 +198,10 @@ strip_bg_char (args) char **args; { char *p = NULL; - - if (p = strchr (*args, '&')) + + p = strchr (*args, '&'); + + if (p) { if (p == (*args + strlen (*args) - 1)) { diff --git a/gdb/language.c b/gdb/language.c index 394a500..011fa21 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -488,7 +488,7 @@ binop_result_type (v1, v2) return TYPE_CODE(t2) == TYPE_CODE_FLT && l2 > l1 ? VALUE_TYPE(v2) : VALUE_TYPE(v1); else if (TYPE_CODE(t2)==TYPE_CODE_FLT) - return TYPE_CODE(t1)) == TYPE_CODE_FLT && l1 > l2 ? + return TYPE_CODE(t1) == TYPE_CODE_FLT && l1 > l2 ? VALUE_TYPE(v1) : VALUE_TYPE(v2); else if (TYPE_UNSIGNED(t1) && l1 > l2) return VALUE_TYPE(v1); diff --git a/gdb/lynx-nat.c b/gdb/lynx-nat.c index f006aa4..38f72ea 100644 --- a/gdb/lynx-nat.c +++ b/gdb/lynx-nat.c @@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <sys/fpp.h> static unsigned long registers_addr PARAMS ((int pid)); -static void fetch_core_registers PARAMS ((char *, unsigned, int, CORE_ADDR); +static void fetch_core_registers PARAMS ((char *, unsigned, int, CORE_ADDR)); #define X(ENTRY)(offsetof(struct econtext, ENTRY)) diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index d472b18..5d75e48 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -123,6 +123,7 @@ mips_register_name (i) } +/* *INDENT-OFF* */ /* Names of IDT R3041 registers. */ char *mips_r3041_reg_names[] = { @@ -203,6 +204,7 @@ struct { { "lsi33k", mips_lsi33k_reg_names }, { NULL, NULL } }; +/* *INDENT-ON* */ /* Table to translate MIPS16 register field to actual register number. */ static int mips16_to_32_reg[8] = { 16, 17, 2, 3, 4, 5, 6, 7 }; diff --git a/gdb/mn10200-tdep.c b/gdb/mn10200-tdep.c index bdc3e94..44188ba 100644 --- a/gdb/mn10200-tdep.c +++ b/gdb/mn10200-tdep.c @@ -39,7 +39,7 @@ mn10200_use_struct_convention (gcc_p, type) } - +/* *INDENT-OFF* */ /* The main purpose of this file is dealing with prologues to extract information about stack frames and saved registers. @@ -102,6 +102,7 @@ mn10200_use_struct_convention (gcc_p, type) NO_MORE_FRAMES: Set this if the current frame is "start" or if the first instruction looks like mov <imm>,sp. This tells frame chain to not bother trying to unwind past this frame. */ +/* *INDENT-ON* */ #define MY_FRAME_IN_SP 0x1 #define MY_FRAME_IN_FP 0x2 diff --git a/gdb/parse.c b/gdb/parse.c index 6f5a93e..86267ea 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -1168,13 +1168,13 @@ parse_exp_1 (stringptr, block, comma) parser, to a prefix form. */ if (expressiondebug) - dump_prefix_expression (expout, gdb_stdout, + dump_prefix_expression (expout, gdb_stdlog, "before conversion to prefix form"); prefixify_expression (expout); if (expressiondebug) - dump_postfix_expression (expout, gdb_stdout, + dump_postfix_expression (expout, gdb_stdlog, "after conversion to prefix form"); *stringptr = lexptr; diff --git a/gdb/pyr-tdep.c b/gdb/pyr-tdep.c index 85e9a07..f8c570e 100644 --- a/gdb/pyr-tdep.c +++ b/gdb/pyr-tdep.c @@ -1,452 +1,452 @@ -/* Pyramid target-dependent code for GDB. - Copyright (C) 1988, 1989, 1991 Free Software Foundation, Inc. - -This file is part of GDB. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include "defs.h" - -/*** Prettier register printing. ***/ - -/* Print registers in the same format as pyramid's dbx, adb, sdb. */ -pyr_print_registers(reg_buf, regnum) - long *reg_buf[]; -{ - register int regno; - int usp, ksp; - struct user u; - - for (regno = 0; regno < 16; regno++) { - printf_unfiltered/*_filtered*/ ("%6.6s: %8x %6.6s: %8x %6s: %8x %6s: %8x\n", - REGISTER_NAME (regno), reg_buf[regno], - REGISTER_NAME (regno+16), reg_buf[regno+16], - REGISTER_NAME (regno+32), reg_buf[regno+32], - REGISTER_NAME (regno+48), reg_buf[regno+48]); - } - usp = ptrace (3, inferior_pid, - (PTRACE_ARG3_TYPE) ((char *)&u.u_pcb.pcb_usp) - - ((char *)&u), 0); - ksp = ptrace (3, inferior_pid, - (PTRACE_ARG3_TYPE) ((char *)&u.u_pcb.pcb_ksp) - - ((char *)&u), 0); - printf_unfiltered/*_filtered*/ ("\n%6.6s: %8x %6.6s: %8x (%08x) %6.6s %8x\n", - REGISTER_NAME (CSP_REGNUM),reg_buf[CSP_REGNUM], - REGISTER_NAME (KSP_REGNUM), reg_buf[KSP_REGNUM], ksp, - "usp", usp); -} - -/* Print the register regnum, or all registers if regnum is -1. - fpregs is currently ignored. */ - -pyr_do_registers_info (regnum, fpregs) - int regnum; - int fpregs; -{ - /* On a pyr, we know a virtual register can always fit in an long. - Here (and elsewhere) we take advantage of that. Yuk. */ - long raw_regs[MAX_REGISTER_RAW_SIZE*NUM_REGS]; - register int i; - - for (i = 0 ; i < 64 ; i++) { - read_relative_register_raw_bytes(i, raw_regs+i); - } - if (regnum == -1) - pyr_print_registers (raw_regs, regnum); - else - for (i = 0; i < NUM_REGS; i++) - if (i == regnum) { - long val = raw_regs[i]; - - fputs_filtered (REGISTER_NAME (i), gdb_stdout); - printf_filtered(":"); - print_spaces_filtered (6 - strlen (REGISTER_NAME (i)), gdb_stdout); - if (val == 0) - printf_filtered ("0"); - else - printf_filtered ("%s %d", local_hex_string_custom(val,"08"), val); - printf_filtered("\n"); - } -} - -/*** Debugging editions of various macros from m-pyr.h ****/ - -CORE_ADDR frame_locals_address (frame) - struct frame_info *frame; -{ - register int addr = find_saved_register (frame,CFP_REGNUM); - register int result = read_memory_integer (addr, 4); -#ifdef PYRAMID_CONTROL_FRAME_DEBUGGING - fprintf_unfiltered (gdb_stderr, - "\t[[..frame_locals:%8x, %s= %x @%x fcfp= %x foo= %x\n\t gr13=%x pr13=%x tr13=%x @%x]]\n", - frame->frame, - REGISTER_NAME (CFP_REGNUM), - result, addr, - frame->frame_cfp, (CFP_REGNUM), - - - read_register(13), read_register(29), read_register(61), - find_saved_register(frame, 61)); -#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */ - - /* FIXME: I thought read_register (CFP_REGNUM) should be the right answer; - or at least CFP_REGNUM relative to FRAME (ie, result). - There seems to be a bug in the way the innermost frame is set up. */ - - return ((frame->next) ? result: frame->frame_cfp); -} - -CORE_ADDR frame_args_addr (frame) - struct frame_info *frame; -{ - register int addr = find_saved_register (frame,CFP_REGNUM); - register int result = read_memory_integer (addr, 4); - -#ifdef PYRAMID_CONTROL_FRAME_DEBUGGING - fprintf_unfiltered (gdb_stderr, - "\t[[..frame_args:%8x, %s= %x @%x fcfp= %x r_r= %x\n\t gr13=%x pr13=%x tr13=%x @%x]]\n", - frame->frame, - REGISTER_NAME (CFP_REGNUM), - result, addr, - frame->frame_cfp, read_register(CFP_REGNUM), - - read_register(13), read_register(29), read_register(61), - find_saved_register(frame, 61)); -#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */ - - /* FIXME: I thought read_register (CFP_REGNUM) should be the right answer; - or at least CFP_REGNUM relative to FRAME (ie, result). - There seems to be a bug in the way the innermost frame is set up. */ - return ((frame->next) ? result: frame->frame_cfp); -} - -#include "symtab.h" -#include "opcode/pyr.h" -#include "gdbcore.h" - - -/* A couple of functions used for debugging frame-handling on - Pyramids. (The Pyramid-dependent handling of register values for - windowed registers is known to be buggy.) - - When debugging, these functions can supplant the normal definitions of some - of the macros in tm-pyramid.h The quantity of information produced - when these functions are used makes the gdb unusable as a - debugger for user programs. */ - -extern unsigned pyr_saved_pc(), pyr_frame_chain(); - -CORE_ADDR pyr_frame_chain(frame) - CORE_ADDR frame; -{ - int foo=frame - CONTROL_STACK_FRAME_SIZE; - /* printf_unfiltered ("...following chain from %x: got %x\n", frame, foo);*/ - return foo; -} - -CORE_ADDR pyr_saved_pc(frame) - CORE_ADDR frame; -{ - int foo=0; - foo = read_memory_integer (((CORE_ADDR)(frame))+60, 4); - printf_unfiltered ("..reading pc from frame 0x%0x+%d regs: got %0x\n", - frame, 60/4, foo); - return foo; -} - -/* Pyramid instructions are never longer than this many bytes. */ -#define MAXLEN 24 - -/* Number of elements in the opcode table. */ -/*const*/ static int nopcodes = (sizeof (pyr_opcodes) / sizeof( pyr_opcodes[0])); -#define NOPCODES (nopcodes) - -/* Let's be byte-independent so we can use this as a cross-assembler. */ - -#define NEXTLONG(p) \ - (p += 4, (((((p[-4] << 8) + p[-3]) << 8) + p[-2]) << 8) + p[-1]) - -/* Print one instruction at address MEMADDR in debugged memory, - on STREAM. Returns length of the instruction, in bytes. */ - -int -pyr_print_insn (memaddr, stream) - CORE_ADDR memaddr; - GDB_FILE *stream; -{ - unsigned char buffer[MAXLEN]; - register int i, nargs, insn_size =4; - register unsigned char *p; - register char *d; - register int insn_opcode, operand_mode; - register int index_multiplier, index_reg_regno, op_1_regno, op_2_regno ; - long insn; /* first word of the insn, not broken down. */ - pyr_insn_format insn_decode; /* the same, broken out into op{code,erands} */ - long extra_1, extra_2; - - read_memory (memaddr, buffer, MAXLEN); - insn_decode = *((pyr_insn_format *) buffer); - insn = * ((int *) buffer); - insn_opcode = insn_decode.operator; - operand_mode = insn_decode.mode; - index_multiplier = insn_decode.index_scale; - index_reg_regno = insn_decode.index_reg; - op_1_regno = insn_decode.operand_1; - op_2_regno = insn_decode.operand_2; - - - if (*((int *)buffer) == 0x0) { - /* "halt" looks just like an invalid "jump" to the insn decoder, - so is dealt with as a special case */ - fprintf_unfiltered (stream, "halt"); - return (4); - } - - for (i = 0; i < NOPCODES; i++) - if (pyr_opcodes[i].datum.code == insn_opcode) - break; - - if (i == NOPCODES) - /* FIXME: Handle unrecognised instructions better. */ - fprintf_unfiltered (stream, "???\t#%08x\t(op=%x mode =%x)", - insn, insn_decode.operator, insn_decode.mode); - else - { - /* Print the mnemonic for the instruction. Pyramid insn operands - are so regular that we can deal with almost all of them - separately. - Unconditional branches are an exception: they are encoded as - conditional branches (branch if false condition, I think) - with no condition specified. The average user will not be - aware of this. To maintain their illusion that an - unconditional branch insn exists, we will have to FIXME to - treat the insn mnemnonic of all branch instructions here as a - special case: check the operands of branch insn and print an - appropriate mnemonic. */ - - fprintf_unfiltered (stream, "%s\t", pyr_opcodes[i].name); - - /* Print the operands of the insn (as specified in - insn.operand_mode). - Branch operands of branches are a special case: they are a word - offset, not a byte offset. */ - - if (insn_decode.operator == 0x01 || insn_decode.operator == 0x02) { - register int bit_codes=(insn >> 16)&0xf; - register int i; - register int displacement = (insn & 0x0000ffff) << 2; - - static char cc_bit_names[] = "cvzn"; /* z,n,c,v: strange order? */ - - /* Is bfc and no bits specified an unconditional branch?*/ - for (i=0;i<4;i++) { - if ((bit_codes) & 0x1) - fputc_unfiltered (cc_bit_names[i], stream); - bit_codes >>= 1; - } - - fprintf_unfiltered (stream, ",%0x", - displacement + memaddr); - return (insn_size); - } - - switch (operand_mode) { - case 0: - fprintf_unfiltered (stream, "%s,%s", - REGISTER_NAME (op_1_regno), - REGISTER_NAME (op_2_regno)); - break; - - case 1: - fprintf_unfiltered (stream, " 0x%0x,%s", - op_1_regno, - REGISTER_NAME (op_2_regno)); - break; - - case 2: - read_memory (memaddr+4, buffer, MAXLEN); - insn_size += 4; - extra_1 = * ((int *) buffer); - fprintf_unfiltered (stream, " $0x%0x,%s", - extra_1, - REGISTER_NAME (op_2_regno)); - break; - case 3: - fprintf_unfiltered (stream, " (%s),%s", - REGISTER_NAME (op_1_regno), - REGISTER_NAME (op_2_regno)); - break; - - case 4: - read_memory (memaddr+4, buffer, MAXLEN); - insn_size += 4; - extra_1 = * ((int *) buffer); - fprintf_unfiltered (stream, " 0x%0x(%s),%s", - extra_1, - REGISTER_NAME (op_1_regno), - REGISTER_NAME (op_2_regno)); - break; - - /* S1 destination mode */ - case 5: - fprintf_unfiltered (stream, - ((index_reg_regno) ? "%s,(%s)[%s*%1d]" : "%s,(%s)"), - REGISTER_NAME (op_1_regno), - REGISTER_NAME (op_2_regno), - REGISTER_NAME (index_reg_regno), - index_multiplier); - break; - - case 6: - fprintf_unfiltered (stream, - ((index_reg_regno) ? " $%#0x,(%s)[%s*%1d]" - : " $%#0x,(%s)"), - op_1_regno, - REGISTER_NAME (op_2_regno), - REGISTER_NAME (index_reg_regno), - index_multiplier); - break; - - case 7: - read_memory (memaddr+4, buffer, MAXLEN); - insn_size += 4; - extra_1 = * ((int *) buffer); - fprintf_unfiltered (stream, - ((index_reg_regno) ? " $%#0x,(%s)[%s*%1d]" - : " $%#0x,(%s)"), - extra_1, - REGISTER_NAME (op_2_regno), - REGISTER_NAME (index_reg_regno), - index_multiplier); - break; - - case 8: - fprintf_unfiltered (stream, - ((index_reg_regno) ? " (%s),(%s)[%s*%1d]" : " (%s),(%s)"), - REGISTER_NAME (op_1_regno), - REGISTER_NAME (op_2_regno), - REGISTER_NAME (index_reg_regno), - index_multiplier); - break; - - case 9: - read_memory (memaddr+4, buffer, MAXLEN); - insn_size += 4; - extra_1 = * ((int *) buffer); - fprintf_unfiltered (stream, - ((index_reg_regno) - ? "%#0x(%s),(%s)[%s*%1d]" - : "%#0x(%s),(%s)"), - extra_1, - REGISTER_NAME (op_1_regno), - REGISTER_NAME (op_2_regno), - REGISTER_NAME (index_reg_regno), - index_multiplier); - break; - - /* S2 destination mode */ - case 10: - read_memory (memaddr+4, buffer, MAXLEN); - insn_size += 4; - extra_1 = * ((int *) buffer); - fprintf_unfiltered (stream, - ((index_reg_regno) ? "%s,%#0x(%s)[%s*%1d]" : "%s,%#0x(%s)"), - REGISTER_NAME (op_1_regno), - extra_1, - REGISTER_NAME (op_2_regno), - REGISTER_NAME (index_reg_regno), - index_multiplier); - break; - case 11: - read_memory (memaddr+4, buffer, MAXLEN); - insn_size += 4; - extra_1 = * ((int *) buffer); - fprintf_unfiltered (stream, - ((index_reg_regno) ? - " $%#0x,%#0x(%s)[%s*%1d]" : " $%#0x,%#0x(%s)"), - op_1_regno, - extra_1, - REGISTER_NAME (op_2_regno), - REGISTER_NAME (index_reg_regno), - index_multiplier); - break; - case 12: - read_memory (memaddr+4, buffer, MAXLEN); - insn_size += 4; - extra_1 = * ((int *) buffer); - read_memory (memaddr+8, buffer, MAXLEN); - insn_size += 4; - extra_2 = * ((int *) buffer); - fprintf_unfiltered (stream, - ((index_reg_regno) ? - " $%#0x,%#0x(%s)[%s*%1d]" : " $%#0x,%#0x(%s)"), - extra_1, - extra_2, - REGISTER_NAME (op_2_regno), - REGISTER_NAME (index_reg_regno), - index_multiplier); - break; - - case 13: - read_memory (memaddr+4, buffer, MAXLEN); - insn_size += 4; - extra_1 = * ((int *) buffer); - fprintf_unfiltered (stream, - ((index_reg_regno) - ? " (%s),%#0x(%s)[%s*%1d]" - : " (%s),%#0x(%s)"), - REGISTER_NAME (op_1_regno), - extra_1, - REGISTER_NAME (op_2_regno), - REGISTER_NAME (index_reg_regno), - index_multiplier); - break; - case 14: - read_memory (memaddr+4, buffer, MAXLEN); - insn_size += 4; - extra_1 = * ((int *) buffer); - read_memory (memaddr+8, buffer, MAXLEN); - insn_size += 4; - extra_2 = * ((int *) buffer); - fprintf_unfiltered (stream, - ((index_reg_regno) ? "%#0x(%s),%#0x(%s)[%s*%1d]" - : "%#0x(%s),%#0x(%s) "), - extra_1, - REGISTER_NAME (op_1_regno), - extra_2, - REGISTER_NAME (op_2_regno), - REGISTER_NAME (index_reg_regno), - index_multiplier); - break; - - default: - fprintf_unfiltered (stream, - ((index_reg_regno) ? "%s,%s [%s*%1d]" : "%s,%s"), - REGISTER_NAME (op_1_regno), - REGISTER_NAME (op_2_regno), - REGISTER_NAME (index_reg_regno), - index_multiplier); - fprintf_unfiltered (stream, - "\t\t# unknown mode in %08x", - insn); - break; - } /* switch */ - } - - { - return insn_size; - } - abort (); -} +/* OBSOLETE /* Pyramid target-dependent code for GDB. */ +/* OBSOLETE Copyright (C) 1988, 1989, 1991 Free Software Foundation, Inc. */ +/* OBSOLETE */ +/* OBSOLETE This file is part of GDB. */ +/* OBSOLETE */ +/* OBSOLETE This program is free software; you can redistribute it and/or modify */ +/* OBSOLETE it under the terms of the GNU General Public License as published by */ +/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */ +/* OBSOLETE (at your option) any later version. */ +/* OBSOLETE */ +/* OBSOLETE This program is distributed in the hope that it will be useful, */ +/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* OBSOLETE GNU General Public License for more details. */ +/* OBSOLETE */ +/* OBSOLETE You should have received a copy of the GNU General Public License */ +/* OBSOLETE along with this program; if not, write to the Free Software */ +/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #include "defs.h" */ +/* OBSOLETE */ +/* OBSOLETE /*** Prettier register printing. ***x/ */ +/* OBSOLETE */ +/* OBSOLETE /* Print registers in the same format as pyramid's dbx, adb, sdb. *x/ */ +/* OBSOLETE pyr_print_registers(reg_buf, regnum) */ +/* OBSOLETE long *reg_buf[]; */ +/* OBSOLETE { */ +/* OBSOLETE register int regno; */ +/* OBSOLETE int usp, ksp; */ +/* OBSOLETE struct user u; */ +/* OBSOLETE */ +/* OBSOLETE for (regno = 0; regno < 16; regno++) { */ +/* OBSOLETE printf_unfiltered/*_filtered*x/ ("%6.6s: %8x %6.6s: %8x %6s: %8x %6s: %8x\n", */ +/* OBSOLETE REGISTER_NAME (regno), reg_buf[regno], */ +/* OBSOLETE REGISTER_NAME (regno+16), reg_buf[regno+16], */ +/* OBSOLETE REGISTER_NAME (regno+32), reg_buf[regno+32], */ +/* OBSOLETE REGISTER_NAME (regno+48), reg_buf[regno+48]); */ +/* OBSOLETE } */ +/* OBSOLETE usp = ptrace (3, inferior_pid, */ +/* OBSOLETE (PTRACE_ARG3_TYPE) ((char *)&u.u_pcb.pcb_usp) - */ +/* OBSOLETE ((char *)&u), 0); */ +/* OBSOLETE ksp = ptrace (3, inferior_pid, */ +/* OBSOLETE (PTRACE_ARG3_TYPE) ((char *)&u.u_pcb.pcb_ksp) - */ +/* OBSOLETE ((char *)&u), 0); */ +/* OBSOLETE printf_unfiltered/*_filtered*x/ ("\n%6.6s: %8x %6.6s: %8x (%08x) %6.6s %8x\n", */ +/* OBSOLETE REGISTER_NAME (CSP_REGNUM),reg_buf[CSP_REGNUM], */ +/* OBSOLETE REGISTER_NAME (KSP_REGNUM), reg_buf[KSP_REGNUM], ksp, */ +/* OBSOLETE "usp", usp); */ +/* OBSOLETE } */ +/* OBSOLETE */ +/* OBSOLETE /* Print the register regnum, or all registers if regnum is -1. */ +/* OBSOLETE fpregs is currently ignored. *x/ */ +/* OBSOLETE */ +/* OBSOLETE pyr_do_registers_info (regnum, fpregs) */ +/* OBSOLETE int regnum; */ +/* OBSOLETE int fpregs; */ +/* OBSOLETE { */ +/* OBSOLETE /* On a pyr, we know a virtual register can always fit in an long. */ +/* OBSOLETE Here (and elsewhere) we take advantage of that. Yuk. *x/ */ +/* OBSOLETE long raw_regs[MAX_REGISTER_RAW_SIZE*NUM_REGS]; */ +/* OBSOLETE register int i; */ +/* OBSOLETE */ +/* OBSOLETE for (i = 0 ; i < 64 ; i++) { */ +/* OBSOLETE read_relative_register_raw_bytes(i, raw_regs+i); */ +/* OBSOLETE } */ +/* OBSOLETE if (regnum == -1) */ +/* OBSOLETE pyr_print_registers (raw_regs, regnum); */ +/* OBSOLETE else */ +/* OBSOLETE for (i = 0; i < NUM_REGS; i++) */ +/* OBSOLETE if (i == regnum) { */ +/* OBSOLETE long val = raw_regs[i]; */ +/* OBSOLETE */ +/* OBSOLETE fputs_filtered (REGISTER_NAME (i), gdb_stdout); */ +/* OBSOLETE printf_filtered(":"); */ +/* OBSOLETE print_spaces_filtered (6 - strlen (REGISTER_NAME (i)), gdb_stdout); */ +/* OBSOLETE if (val == 0) */ +/* OBSOLETE printf_filtered ("0"); */ +/* OBSOLETE else */ +/* OBSOLETE printf_filtered ("%s %d", local_hex_string_custom(val,"08"), val); */ +/* OBSOLETE printf_filtered("\n"); */ +/* OBSOLETE } */ +/* OBSOLETE } */ +/* OBSOLETE */ +/* OBSOLETE /*** Debugging editions of various macros from m-pyr.h ****x/ */ +/* OBSOLETE */ +/* OBSOLETE CORE_ADDR frame_locals_address (frame) */ +/* OBSOLETE struct frame_info *frame; */ +/* OBSOLETE { */ +/* OBSOLETE register int addr = find_saved_register (frame,CFP_REGNUM); */ +/* OBSOLETE register int result = read_memory_integer (addr, 4); */ +/* OBSOLETE #ifdef PYRAMID_CONTROL_FRAME_DEBUGGING */ +/* OBSOLETE fprintf_unfiltered (gdb_stderr, */ +/* OBSOLETE "\t[[..frame_locals:%8x, %s= %x @%x fcfp= %x foo= %x\n\t gr13=%x pr13=%x tr13=%x @%x]]\n", */ +/* OBSOLETE frame->frame, */ +/* OBSOLETE REGISTER_NAME (CFP_REGNUM), */ +/* OBSOLETE result, addr, */ +/* OBSOLETE frame->frame_cfp, (CFP_REGNUM), */ +/* OBSOLETE */ +/* OBSOLETE */ +/* OBSOLETE read_register(13), read_register(29), read_register(61), */ +/* OBSOLETE find_saved_register(frame, 61)); */ +/* OBSOLETE #endif /* PYRAMID_CONTROL_FRAME_DEBUGGING *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* FIXME: I thought read_register (CFP_REGNUM) should be the right answer; */ +/* OBSOLETE or at least CFP_REGNUM relative to FRAME (ie, result). */ +/* OBSOLETE There seems to be a bug in the way the innermost frame is set up. *x/ */ +/* OBSOLETE */ +/* OBSOLETE return ((frame->next) ? result: frame->frame_cfp); */ +/* OBSOLETE } */ +/* OBSOLETE */ +/* OBSOLETE CORE_ADDR frame_args_addr (frame) */ +/* OBSOLETE struct frame_info *frame; */ +/* OBSOLETE { */ +/* OBSOLETE register int addr = find_saved_register (frame,CFP_REGNUM); */ +/* OBSOLETE register int result = read_memory_integer (addr, 4); */ +/* OBSOLETE */ +/* OBSOLETE #ifdef PYRAMID_CONTROL_FRAME_DEBUGGING */ +/* OBSOLETE fprintf_unfiltered (gdb_stderr, */ +/* OBSOLETE "\t[[..frame_args:%8x, %s= %x @%x fcfp= %x r_r= %x\n\t gr13=%x pr13=%x tr13=%x @%x]]\n", */ +/* OBSOLETE frame->frame, */ +/* OBSOLETE REGISTER_NAME (CFP_REGNUM), */ +/* OBSOLETE result, addr, */ +/* OBSOLETE frame->frame_cfp, read_register(CFP_REGNUM), */ +/* OBSOLETE */ +/* OBSOLETE read_register(13), read_register(29), read_register(61), */ +/* OBSOLETE find_saved_register(frame, 61)); */ +/* OBSOLETE #endif /* PYRAMID_CONTROL_FRAME_DEBUGGING *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* FIXME: I thought read_register (CFP_REGNUM) should be the right answer; */ +/* OBSOLETE or at least CFP_REGNUM relative to FRAME (ie, result). */ +/* OBSOLETE There seems to be a bug in the way the innermost frame is set up. *x/ */ +/* OBSOLETE return ((frame->next) ? result: frame->frame_cfp); */ +/* OBSOLETE } */ +/* OBSOLETE */ +/* OBSOLETE #include "symtab.h" */ +/* OBSOLETE #include "opcode/pyr.h" */ +/* OBSOLETE #include "gdbcore.h" */ +/* OBSOLETE */ +/* OBSOLETE */ +/* OBSOLETE /* A couple of functions used for debugging frame-handling on */ +/* OBSOLETE Pyramids. (The Pyramid-dependent handling of register values for */ +/* OBSOLETE windowed registers is known to be buggy.) */ +/* OBSOLETE */ +/* OBSOLETE When debugging, these functions can supplant the normal definitions of some */ +/* OBSOLETE of the macros in tm-pyramid.h The quantity of information produced */ +/* OBSOLETE when these functions are used makes the gdb unusable as a */ +/* OBSOLETE debugger for user programs. *x/ */ +/* OBSOLETE */ +/* OBSOLETE extern unsigned pyr_saved_pc(), pyr_frame_chain(); */ +/* OBSOLETE */ +/* OBSOLETE CORE_ADDR pyr_frame_chain(frame) */ +/* OBSOLETE CORE_ADDR frame; */ +/* OBSOLETE { */ +/* OBSOLETE int foo=frame - CONTROL_STACK_FRAME_SIZE; */ +/* OBSOLETE /* printf_unfiltered ("...following chain from %x: got %x\n", frame, foo);*x/ */ +/* OBSOLETE return foo; */ +/* OBSOLETE } */ +/* OBSOLETE */ +/* OBSOLETE CORE_ADDR pyr_saved_pc(frame) */ +/* OBSOLETE CORE_ADDR frame; */ +/* OBSOLETE { */ +/* OBSOLETE int foo=0; */ +/* OBSOLETE foo = read_memory_integer (((CORE_ADDR)(frame))+60, 4); */ +/* OBSOLETE printf_unfiltered ("..reading pc from frame 0x%0x+%d regs: got %0x\n", */ +/* OBSOLETE frame, 60/4, foo); */ +/* OBSOLETE return foo; */ +/* OBSOLETE } */ +/* OBSOLETE */ +/* OBSOLETE /* Pyramid instructions are never longer than this many bytes. *x/ */ +/* OBSOLETE #define MAXLEN 24 */ +/* OBSOLETE */ +/* OBSOLETE /* Number of elements in the opcode table. *x/ */ +/* OBSOLETE /*const*x/ static int nopcodes = (sizeof (pyr_opcodes) / sizeof( pyr_opcodes[0])); */ +/* OBSOLETE #define NOPCODES (nopcodes) */ +/* OBSOLETE */ +/* OBSOLETE /* Let's be byte-independent so we can use this as a cross-assembler. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #define NEXTLONG(p) \ */ +/* OBSOLETE (p += 4, (((((p[-4] << 8) + p[-3]) << 8) + p[-2]) << 8) + p[-1]) */ +/* OBSOLETE */ +/* OBSOLETE /* Print one instruction at address MEMADDR in debugged memory, */ +/* OBSOLETE on STREAM. Returns length of the instruction, in bytes. *x/ */ +/* OBSOLETE */ +/* OBSOLETE int */ +/* OBSOLETE pyr_print_insn (memaddr, stream) */ +/* OBSOLETE CORE_ADDR memaddr; */ +/* OBSOLETE GDB_FILE *stream; */ +/* OBSOLETE { */ +/* OBSOLETE unsigned char buffer[MAXLEN]; */ +/* OBSOLETE register int i, nargs, insn_size =4; */ +/* OBSOLETE register unsigned char *p; */ +/* OBSOLETE register char *d; */ +/* OBSOLETE register int insn_opcode, operand_mode; */ +/* OBSOLETE register int index_multiplier, index_reg_regno, op_1_regno, op_2_regno ; */ +/* OBSOLETE long insn; /* first word of the insn, not broken down. *x/ */ +/* OBSOLETE pyr_insn_format insn_decode; /* the same, broken out into op{code,erands} *x/ */ +/* OBSOLETE long extra_1, extra_2; */ +/* OBSOLETE */ +/* OBSOLETE read_memory (memaddr, buffer, MAXLEN); */ +/* OBSOLETE insn_decode = *((pyr_insn_format *) buffer); */ +/* OBSOLETE insn = * ((int *) buffer); */ +/* OBSOLETE insn_opcode = insn_decode.operator; */ +/* OBSOLETE operand_mode = insn_decode.mode; */ +/* OBSOLETE index_multiplier = insn_decode.index_scale; */ +/* OBSOLETE index_reg_regno = insn_decode.index_reg; */ +/* OBSOLETE op_1_regno = insn_decode.operand_1; */ +/* OBSOLETE op_2_regno = insn_decode.operand_2; */ +/* OBSOLETE */ +/* OBSOLETE */ +/* OBSOLETE if (*((int *)buffer) == 0x0) { */ +/* OBSOLETE /* "halt" looks just like an invalid "jump" to the insn decoder, */ +/* OBSOLETE so is dealt with as a special case *x/ */ +/* OBSOLETE fprintf_unfiltered (stream, "halt"); */ +/* OBSOLETE return (4); */ +/* OBSOLETE } */ +/* OBSOLETE */ +/* OBSOLETE for (i = 0; i < NOPCODES; i++) */ +/* OBSOLETE if (pyr_opcodes[i].datum.code == insn_opcode) */ +/* OBSOLETE break; */ +/* OBSOLETE */ +/* OBSOLETE if (i == NOPCODES) */ +/* OBSOLETE /* FIXME: Handle unrecognised instructions better. *x/ */ +/* OBSOLETE fprintf_unfiltered (stream, "???\t#%08x\t(op=%x mode =%x)", */ +/* OBSOLETE insn, insn_decode.operator, insn_decode.mode); */ +/* OBSOLETE else */ +/* OBSOLETE { */ +/* OBSOLETE /* Print the mnemonic for the instruction. Pyramid insn operands */ +/* OBSOLETE are so regular that we can deal with almost all of them */ +/* OBSOLETE separately. */ +/* OBSOLETE Unconditional branches are an exception: they are encoded as */ +/* OBSOLETE conditional branches (branch if false condition, I think) */ +/* OBSOLETE with no condition specified. The average user will not be */ +/* OBSOLETE aware of this. To maintain their illusion that an */ +/* OBSOLETE unconditional branch insn exists, we will have to FIXME to */ +/* OBSOLETE treat the insn mnemnonic of all branch instructions here as a */ +/* OBSOLETE special case: check the operands of branch insn and print an */ +/* OBSOLETE appropriate mnemonic. *x/ */ +/* OBSOLETE */ +/* OBSOLETE fprintf_unfiltered (stream, "%s\t", pyr_opcodes[i].name); */ +/* OBSOLETE */ +/* OBSOLETE /* Print the operands of the insn (as specified in */ +/* OBSOLETE insn.operand_mode). */ +/* OBSOLETE Branch operands of branches are a special case: they are a word */ +/* OBSOLETE offset, not a byte offset. *x/ */ +/* OBSOLETE */ +/* OBSOLETE if (insn_decode.operator == 0x01 || insn_decode.operator == 0x02) { */ +/* OBSOLETE register int bit_codes=(insn >> 16)&0xf; */ +/* OBSOLETE register int i; */ +/* OBSOLETE register int displacement = (insn & 0x0000ffff) << 2; */ +/* OBSOLETE */ +/* OBSOLETE static char cc_bit_names[] = "cvzn"; /* z,n,c,v: strange order? *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* Is bfc and no bits specified an unconditional branch?*x/ */ +/* OBSOLETE for (i=0;i<4;i++) { */ +/* OBSOLETE if ((bit_codes) & 0x1) */ +/* OBSOLETE fputc_unfiltered (cc_bit_names[i], stream); */ +/* OBSOLETE bit_codes >>= 1; */ +/* OBSOLETE } */ +/* OBSOLETE */ +/* OBSOLETE fprintf_unfiltered (stream, ",%0x", */ +/* OBSOLETE displacement + memaddr); */ +/* OBSOLETE return (insn_size); */ +/* OBSOLETE } */ +/* OBSOLETE */ +/* OBSOLETE switch (operand_mode) { */ +/* OBSOLETE case 0: */ +/* OBSOLETE fprintf_unfiltered (stream, "%s,%s", */ +/* OBSOLETE REGISTER_NAME (op_1_regno), */ +/* OBSOLETE REGISTER_NAME (op_2_regno)); */ +/* OBSOLETE break; */ +/* OBSOLETE */ +/* OBSOLETE case 1: */ +/* OBSOLETE fprintf_unfiltered (stream, " 0x%0x,%s", */ +/* OBSOLETE op_1_regno, */ +/* OBSOLETE REGISTER_NAME (op_2_regno)); */ +/* OBSOLETE break; */ +/* OBSOLETE */ +/* OBSOLETE case 2: */ +/* OBSOLETE read_memory (memaddr+4, buffer, MAXLEN); */ +/* OBSOLETE insn_size += 4; */ +/* OBSOLETE extra_1 = * ((int *) buffer); */ +/* OBSOLETE fprintf_unfiltered (stream, " $0x%0x,%s", */ +/* OBSOLETE extra_1, */ +/* OBSOLETE REGISTER_NAME (op_2_regno)); */ +/* OBSOLETE break; */ +/* OBSOLETE case 3: */ +/* OBSOLETE fprintf_unfiltered (stream, " (%s),%s", */ +/* OBSOLETE REGISTER_NAME (op_1_regno), */ +/* OBSOLETE REGISTER_NAME (op_2_regno)); */ +/* OBSOLETE break; */ +/* OBSOLETE */ +/* OBSOLETE case 4: */ +/* OBSOLETE read_memory (memaddr+4, buffer, MAXLEN); */ +/* OBSOLETE insn_size += 4; */ +/* OBSOLETE extra_1 = * ((int *) buffer); */ +/* OBSOLETE fprintf_unfiltered (stream, " 0x%0x(%s),%s", */ +/* OBSOLETE extra_1, */ +/* OBSOLETE REGISTER_NAME (op_1_regno), */ +/* OBSOLETE REGISTER_NAME (op_2_regno)); */ +/* OBSOLETE break; */ +/* OBSOLETE */ +/* OBSOLETE /* S1 destination mode *x/ */ +/* OBSOLETE case 5: */ +/* OBSOLETE fprintf_unfiltered (stream, */ +/* OBSOLETE ((index_reg_regno) ? "%s,(%s)[%s*%1d]" : "%s,(%s)"), */ +/* OBSOLETE REGISTER_NAME (op_1_regno), */ +/* OBSOLETE REGISTER_NAME (op_2_regno), */ +/* OBSOLETE REGISTER_NAME (index_reg_regno), */ +/* OBSOLETE index_multiplier); */ +/* OBSOLETE break; */ +/* OBSOLETE */ +/* OBSOLETE case 6: */ +/* OBSOLETE fprintf_unfiltered (stream, */ +/* OBSOLETE ((index_reg_regno) ? " $%#0x,(%s)[%s*%1d]" */ +/* OBSOLETE : " $%#0x,(%s)"), */ +/* OBSOLETE op_1_regno, */ +/* OBSOLETE REGISTER_NAME (op_2_regno), */ +/* OBSOLETE REGISTER_NAME (index_reg_regno), */ +/* OBSOLETE index_multiplier); */ +/* OBSOLETE break; */ +/* OBSOLETE */ +/* OBSOLETE case 7: */ +/* OBSOLETE read_memory (memaddr+4, buffer, MAXLEN); */ +/* OBSOLETE insn_size += 4; */ +/* OBSOLETE extra_1 = * ((int *) buffer); */ +/* OBSOLETE fprintf_unfiltered (stream, */ +/* OBSOLETE ((index_reg_regno) ? " $%#0x,(%s)[%s*%1d]" */ +/* OBSOLETE : " $%#0x,(%s)"), */ +/* OBSOLETE extra_1, */ +/* OBSOLETE REGISTER_NAME (op_2_regno), */ +/* OBSOLETE REGISTER_NAME (index_reg_regno), */ +/* OBSOLETE index_multiplier); */ +/* OBSOLETE break; */ +/* OBSOLETE */ +/* OBSOLETE case 8: */ +/* OBSOLETE fprintf_unfiltered (stream, */ +/* OBSOLETE ((index_reg_regno) ? " (%s),(%s)[%s*%1d]" : " (%s),(%s)"), */ +/* OBSOLETE REGISTER_NAME (op_1_regno), */ +/* OBSOLETE REGISTER_NAME (op_2_regno), */ +/* OBSOLETE REGISTER_NAME (index_reg_regno), */ +/* OBSOLETE index_multiplier); */ +/* OBSOLETE break; */ +/* OBSOLETE */ +/* OBSOLETE case 9: */ +/* OBSOLETE read_memory (memaddr+4, buffer, MAXLEN); */ +/* OBSOLETE insn_size += 4; */ +/* OBSOLETE extra_1 = * ((int *) buffer); */ +/* OBSOLETE fprintf_unfiltered (stream, */ +/* OBSOLETE ((index_reg_regno) */ +/* OBSOLETE ? "%#0x(%s),(%s)[%s*%1d]" */ +/* OBSOLETE : "%#0x(%s),(%s)"), */ +/* OBSOLETE extra_1, */ +/* OBSOLETE REGISTER_NAME (op_1_regno), */ +/* OBSOLETE REGISTER_NAME (op_2_regno), */ +/* OBSOLETE REGISTER_NAME (index_reg_regno), */ +/* OBSOLETE index_multiplier); */ +/* OBSOLETE break; */ +/* OBSOLETE */ +/* OBSOLETE /* S2 destination mode *x/ */ +/* OBSOLETE case 10: */ +/* OBSOLETE read_memory (memaddr+4, buffer, MAXLEN); */ +/* OBSOLETE insn_size += 4; */ +/* OBSOLETE extra_1 = * ((int *) buffer); */ +/* OBSOLETE fprintf_unfiltered (stream, */ +/* OBSOLETE ((index_reg_regno) ? "%s,%#0x(%s)[%s*%1d]" : "%s,%#0x(%s)"), */ +/* OBSOLETE REGISTER_NAME (op_1_regno), */ +/* OBSOLETE extra_1, */ +/* OBSOLETE REGISTER_NAME (op_2_regno), */ +/* OBSOLETE REGISTER_NAME (index_reg_regno), */ +/* OBSOLETE index_multiplier); */ +/* OBSOLETE break; */ +/* OBSOLETE case 11: */ +/* OBSOLETE read_memory (memaddr+4, buffer, MAXLEN); */ +/* OBSOLETE insn_size += 4; */ +/* OBSOLETE extra_1 = * ((int *) buffer); */ +/* OBSOLETE fprintf_unfiltered (stream, */ +/* OBSOLETE ((index_reg_regno) ? */ +/* OBSOLETE " $%#0x,%#0x(%s)[%s*%1d]" : " $%#0x,%#0x(%s)"), */ +/* OBSOLETE op_1_regno, */ +/* OBSOLETE extra_1, */ +/* OBSOLETE REGISTER_NAME (op_2_regno), */ +/* OBSOLETE REGISTER_NAME (index_reg_regno), */ +/* OBSOLETE index_multiplier); */ +/* OBSOLETE break; */ +/* OBSOLETE case 12: */ +/* OBSOLETE read_memory (memaddr+4, buffer, MAXLEN); */ +/* OBSOLETE insn_size += 4; */ +/* OBSOLETE extra_1 = * ((int *) buffer); */ +/* OBSOLETE read_memory (memaddr+8, buffer, MAXLEN); */ +/* OBSOLETE insn_size += 4; */ +/* OBSOLETE extra_2 = * ((int *) buffer); */ +/* OBSOLETE fprintf_unfiltered (stream, */ +/* OBSOLETE ((index_reg_regno) ? */ +/* OBSOLETE " $%#0x,%#0x(%s)[%s*%1d]" : " $%#0x,%#0x(%s)"), */ +/* OBSOLETE extra_1, */ +/* OBSOLETE extra_2, */ +/* OBSOLETE REGISTER_NAME (op_2_regno), */ +/* OBSOLETE REGISTER_NAME (index_reg_regno), */ +/* OBSOLETE index_multiplier); */ +/* OBSOLETE break; */ +/* OBSOLETE */ +/* OBSOLETE case 13: */ +/* OBSOLETE read_memory (memaddr+4, buffer, MAXLEN); */ +/* OBSOLETE insn_size += 4; */ +/* OBSOLETE extra_1 = * ((int *) buffer); */ +/* OBSOLETE fprintf_unfiltered (stream, */ +/* OBSOLETE ((index_reg_regno) */ +/* OBSOLETE ? " (%s),%#0x(%s)[%s*%1d]" */ +/* OBSOLETE : " (%s),%#0x(%s)"), */ +/* OBSOLETE REGISTER_NAME (op_1_regno), */ +/* OBSOLETE extra_1, */ +/* OBSOLETE REGISTER_NAME (op_2_regno), */ +/* OBSOLETE REGISTER_NAME (index_reg_regno), */ +/* OBSOLETE index_multiplier); */ +/* OBSOLETE break; */ +/* OBSOLETE case 14: */ +/* OBSOLETE read_memory (memaddr+4, buffer, MAXLEN); */ +/* OBSOLETE insn_size += 4; */ +/* OBSOLETE extra_1 = * ((int *) buffer); */ +/* OBSOLETE read_memory (memaddr+8, buffer, MAXLEN); */ +/* OBSOLETE insn_size += 4; */ +/* OBSOLETE extra_2 = * ((int *) buffer); */ +/* OBSOLETE fprintf_unfiltered (stream, */ +/* OBSOLETE ((index_reg_regno) ? "%#0x(%s),%#0x(%s)[%s*%1d]" */ +/* OBSOLETE : "%#0x(%s),%#0x(%s) "), */ +/* OBSOLETE extra_1, */ +/* OBSOLETE REGISTER_NAME (op_1_regno), */ +/* OBSOLETE extra_2, */ +/* OBSOLETE REGISTER_NAME (op_2_regno), */ +/* OBSOLETE REGISTER_NAME (index_reg_regno), */ +/* OBSOLETE index_multiplier); */ +/* OBSOLETE break; */ +/* OBSOLETE */ +/* OBSOLETE default: */ +/* OBSOLETE fprintf_unfiltered (stream, */ +/* OBSOLETE ((index_reg_regno) ? "%s,%s [%s*%1d]" : "%s,%s"), */ +/* OBSOLETE REGISTER_NAME (op_1_regno), */ +/* OBSOLETE REGISTER_NAME (op_2_regno), */ +/* OBSOLETE REGISTER_NAME (index_reg_regno), */ +/* OBSOLETE index_multiplier); */ +/* OBSOLETE fprintf_unfiltered (stream, */ +/* OBSOLETE "\t\t# unknown mode in %08x", */ +/* OBSOLETE insn); */ +/* OBSOLETE break; */ +/* OBSOLETE } /* switch *x/ */ +/* OBSOLETE } */ +/* OBSOLETE */ +/* OBSOLETE { */ +/* OBSOLETE return insn_size; */ +/* OBSOLETE } */ +/* OBSOLETE abort (); */ +/* OBSOLETE } */ diff --git a/gdb/pyr-xdep.c b/gdb/pyr-xdep.c index 5c95bd6..0ca79e1 100644 --- a/gdb/pyr-xdep.c +++ b/gdb/pyr-xdep.c @@ -1,369 +1,369 @@ -/* Low level Pyramid interface to ptrace, for GDB when running under Unix. - Copyright (C) 1988, 1989, 1991 Free Software Foundation, Inc. - -This file is part of GDB. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include "defs.h" -#include "frame.h" -#include "inferior.h" - -#include <sys/param.h> -#include <sys/dir.h> -#include <signal.h> -#include <sys/ioctl.h> -/* #include <fcntl.h> Can we live without this? */ - -#include "gdbcore.h" -#include <sys/user.h> /* After a.out.h */ -#include <sys/file.h> -#include "gdb_stat.h" - - -void -fetch_inferior_registers (regno) - int regno; -{ - register int datum; - register unsigned int regaddr; - int reg_buf[NUM_REGS+1]; - struct user u; - register int skipped_frames = 0; - - registers_fetched (); - - for (regno = 0; regno < 64; regno++) { - reg_buf[regno] = ptrace (3, inferior_pid, (PTRACE_ARG3_TYPE) regno, 0); - -#if defined(PYRAMID_CONTROL_FRAME_DEBUGGING) - printf_unfiltered ("Fetching register %s, got %0x\n", - REGISTER_NAME (regno), - reg_buf[regno]); -#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */ - - if (reg_buf[regno] == -1 && errno == EIO) { - printf_unfiltered("fetch_interior_registers: fetching register %s\n", - REGISTER_NAME (regno)); - errno = 0; - } - supply_register (regno, reg_buf+regno); - } - /* that leaves regs 64, 65, and 66 */ - datum = ptrace (3, inferior_pid, - (PTRACE_ARG3_TYPE) (((char *)&u.u_pcb.pcb_csp) - - ((char *)&u)), 0); - - - - /* FIXME: Find the Current Frame Pointer (CFP). CFP is a global - register (ie, NOT windowed), that gets saved in a frame iff - the code for that frame has a prologue (ie, "adsf N"). If - there is a prologue, the adsf insn saves the old cfp in - pr13, cfp is set to sp, and N bytes of locals are allocated - (sp is decremented by n). - This makes finding CFP hard. I guess the right way to do it - is: - - If this is the innermost frame, believe ptrace() or - the core area. - - Otherwise: - Find the first insn of the current frame. - - find the saved pc; - - find the call insn that saved it; - - figure out where the call is to; - - if the first insn is an adsf, we got a frame - pointer. */ - - - /* Normal processors have separate stack pointers for user and - kernel mode. Getting the last user mode frame on such - machines is easy: the kernel context of the ptrace()'d - process is on the kernel stack, and the USP points to what - we want. But Pyramids only have a single cfp for both user and - kernel mode. And processes being ptrace()'d have some - kernel-context control frames on their stack. - To avoid tracing back into the kernel context of an inferior, - we skip 0 or more contiguous control frames where the pc is - in the kernel. */ - - while (1) { - register int inferior_saved_pc; - inferior_saved_pc = ptrace (1, inferior_pid, - (PTRACE_ARG3_TYPE) (datum+((32+15)*4)), 0); - if (inferior_saved_pc > 0) break; -#if defined(PYRAMID_CONTROL_FRAME_DEBUGGING) - printf_unfiltered("skipping kernel frame %08x, pc=%08x\n", datum, - inferior_saved_pc); -#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */ - skipped_frames++; - datum -= CONTROL_STACK_FRAME_SIZE; - } - - reg_buf[CSP_REGNUM] = datum; - supply_register(CSP_REGNUM, reg_buf+CSP_REGNUM); -#ifdef PYRAMID_CONTROL_FRAME_DEBUGGING - if (skipped_frames) { - fprintf_unfiltered (gdb_stderr, - "skipped %d frames from %x to %x; cfp was %x, now %x\n", - skipped_frames, reg_buf[CSP_REGNUM]); - } -#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */ -} - -/* Store our register values back into the inferior. - If REGNO is -1, do this for all registers. - Otherwise, REGNO specifies which register (so we can save time). */ - -void -store_inferior_registers (regno) - int regno; -{ - register unsigned int regaddr; - char buf[80]; - - if (regno >= 0) - { - if ((0 <= regno) && (regno < 64)) { - /*regaddr = register_addr (regno, offset);*/ - regaddr = regno; - errno = 0; - ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, - read_register (regno)); - if (errno != 0) - { - sprintf (buf, "writing register number %d", regno); - perror_with_name (buf); - } - } - } - else - { - for (regno = 0; regno < NUM_REGS; regno++) - { - /*regaddr = register_addr (regno, offset);*/ - regaddr = regno; - errno = 0; - ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, - read_register (regno)); - if (errno != 0) - { - sprintf (buf, "writing all regs, number %d", regno); - perror_with_name (buf); - } - } -} - -/*** Extensions to core and dump files, for GDB. */ - -extern unsigned int last_frame_offset; - -#ifdef PYRAMID_CORE - -/* Can't make definitions here static, since corefile.c needs them - to do bounds checking on the core-file areas. O well. */ - -/* have two stacks: one for data, one for register windows. */ -extern CORE_ADDR reg_stack_start; -extern CORE_ADDR reg_stack_end; - -/* need this so we can find the global registers: they never get saved. */ -CORE_ADDR global_reg_offset; -static CORE_ADDR last_frame_address; -CORE_ADDR last_frame_offset; - - -/* Address in core file of start of register window stack area. - Don't know if is this any of meaningful, useful or necessary. */ -extern int reg_stack_offset; - -#endif /* PYRAMID_CORE */ - - -/* Work with core dump and executable files, for GDB. - This code would be in corefile.c if it weren't machine-dependent. */ - -void -core_file_command (filename, from_tty) - char *filename; - int from_tty; -{ - int val; - - /* Discard all vestiges of any previous core file - and mark data and stack spaces as empty. */ - - if (corefile) - free (corefile); - corefile = 0; - - if (corechan >= 0) - close (corechan); - corechan = -1; - - data_start = 0; - data_end = 0; - stack_start = STACK_END_ADDR; - stack_end = STACK_END_ADDR; - -#ifdef PYRAMID_CORE - reg_stack_start = CONTROL_STACK_ADDR; - reg_stack_end = CONTROL_STACK_ADDR; /* this isn't strictly true...*/ -#endif /* PYRAMID_CORE */ - - /* Now, if a new core file was specified, open it and digest it. */ - - if (filename) - { - filename = tilde_expand (filename); - make_cleanup (free, filename); - - if (have_inferior_p ()) - error ("To look at a core file, you must kill the program with \"kill\"."); - corechan = open (filename, O_RDONLY, 0); - if (corechan < 0) - perror_with_name (filename); - /* 4.2-style (and perhaps also sysV-style) core dump file. */ - { - struct user u; - - unsigned int reg_offset; - - val = myread (corechan, &u, sizeof u); - if (val < 0) - perror_with_name ("Not a core file: reading upage"); - if (val != sizeof u) - error ("Not a core file: could only read %d bytes", val); - data_start = exec_data_start; - - data_end = data_start + NBPG * u.u_dsize; - data_offset = NBPG * UPAGES; - stack_offset = NBPG * (UPAGES + u.u_dsize); - - /* find registers in core file */ -#ifdef PYRAMID_PTRACE - stack_start = stack_end - NBPG * u.u_ussize; - reg_stack_offset = stack_offset + (NBPG *u.u_ussize); - reg_stack_end = reg_stack_start + NBPG * u.u_cssize; - - last_frame_address = ((int) u.u_pcb.pcb_csp); - last_frame_offset = reg_stack_offset + last_frame_address - - CONTROL_STACK_ADDR ; - global_reg_offset = (char *)&u - (char *)&u.u_pcb.pcb_gr0 ; - - /* skip any control-stack frames that were executed in the - kernel. */ - - while (1) { - char buf[4]; - val = lseek (corechan, last_frame_offset+(47*4), 0); - if (val < 0) - perror_with_name (filename); - val = myread (corechan, buf, sizeof buf); - if (val < 0) - perror_with_name (filename); - - if (*(int *)buf >= 0) - break; - printf_unfiltered ("skipping frame %s\n", local_hex_string (last_frame_address)); - last_frame_offset -= CONTROL_STACK_FRAME_SIZE; - last_frame_address -= CONTROL_STACK_FRAME_SIZE; - } - reg_offset = last_frame_offset; - -#if 1 || defined(PYRAMID_CONTROL_FRAME_DEBUGGING) - printf_unfiltered ("Control stack pointer = %s\n", - local_hex_string (u.u_pcb.pcb_csp)); - printf_unfiltered ("offset to control stack %d outermost frame %d (%s)\n", - reg_stack_offset, reg_offset, local_hex_string (last_frame_address)); -#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */ - -#else /* not PYRAMID_CORE */ - stack_start = stack_end - NBPG * u.u_ssize; - reg_offset = (int) u.u_ar0 - KERNEL_U_ADDR; -#endif /* not PYRAMID_CORE */ - -#ifdef __not_on_pyr_yet - /* Some machines put an absolute address in here and some put - the offset in the upage of the regs. */ - reg_offset = (int) u.u_ar0; - if (reg_offset > NBPG * UPAGES) - reg_offset -= KERNEL_U_ADDR; -#endif - - /* I don't know where to find this info. - So, for now, mark it as not available. */ - N_SET_MAGIC (core_aouthdr, 0); - - /* Read the register values out of the core file and store - them where `read_register' will find them. */ - - { - register int regno; - - for (regno = 0; regno < 64; regno++) - { - char buf[MAX_REGISTER_RAW_SIZE]; - - val = lseek (corechan, register_addr (regno, reg_offset), 0); - if (val < 0 - || (val = myread (corechan, buf, sizeof buf)) < 0) - { - char * buffer = (char *) alloca (strlen (REGISTER_NAME (regno)) - + 30); - strcpy (buffer, "Reading register "); - strcat (buffer, REGISTER_NAME (regno)); - - perror_with_name (buffer); - } - - if (val < 0) - perror_with_name (filename); -#ifdef PYRAMID_CONTROL_FRAME_DEBUGGING - printf_unfiltered ("[reg %s(%d), offset in file %s=0x%0x, addr =0x%0x, =%0x]\n", - REGISTER_NAME (regno), regno, filename, - register_addr(regno, reg_offset), - regno * 4 + last_frame_address, - *((int *)buf)); -#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */ - supply_register (regno, buf); - } - } - } - if (filename[0] == '/') - corefile = savestring (filename, strlen (filename)); - else - { - corefile = concat (current_directory, "/", filename, NULL); - } - -#if 1 || defined(PYRAMID_CONTROL_FRAME_DEBUGGING) - printf_unfiltered ("Providing CSP (%s) as nominal address of current frame.\n", - local_hex_string(last_frame_address)); -#endif PYRAMID_CONTROL_FRAME_DEBUGGING - /* FIXME: Which of the following is correct? */ -#if 0 - set_current_frame ( create_new_frame (read_register (FP_REGNUM), - read_pc ())); -#else - set_current_frame ( create_new_frame (last_frame_address, - read_pc ())); -#endif - - select_frame (get_current_frame (), 0); - validate_files (); - } - else if (from_tty) - printf_unfiltered ("No core file now.\n"); -} +/* OBSOLETE /* Low level Pyramid interface to ptrace, for GDB when running under Unix. */ +/* OBSOLETE Copyright (C) 1988, 1989, 1991 Free Software Foundation, Inc. */ +/* OBSOLETE */ +/* OBSOLETE This file is part of GDB. */ +/* OBSOLETE */ +/* OBSOLETE This program is free software; you can redistribute it and/or modify */ +/* OBSOLETE it under the terms of the GNU General Public License as published by */ +/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */ +/* OBSOLETE (at your option) any later version. */ +/* OBSOLETE */ +/* OBSOLETE This program is distributed in the hope that it will be useful, */ +/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* OBSOLETE GNU General Public License for more details. */ +/* OBSOLETE */ +/* OBSOLETE You should have received a copy of the GNU General Public License */ +/* OBSOLETE along with this program; if not, write to the Free Software */ +/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *x/ */ +/* OBSOLETE */ +/* OBSOLETE #include "defs.h" */ +/* OBSOLETE #include "frame.h" */ +/* OBSOLETE #include "inferior.h" */ +/* OBSOLETE */ +/* OBSOLETE #include <sys/param.h> */ +/* OBSOLETE #include <sys/dir.h> */ +/* OBSOLETE #include <signal.h> */ +/* OBSOLETE #include <sys/ioctl.h> */ +/* OBSOLETE /* #include <fcntl.h> Can we live without this? *x/ */ +/* OBSOLETE */ +/* OBSOLETE #include "gdbcore.h" */ +/* OBSOLETE #include <sys/user.h> /* After a.out.h *x/ */ +/* OBSOLETE #include <sys/file.h> */ +/* OBSOLETE #include "gdb_stat.h" */ +/* OBSOLETE */ +/* OBSOLETE */ +/* OBSOLETE void */ +/* OBSOLETE fetch_inferior_registers (regno) */ +/* OBSOLETE int regno; */ +/* OBSOLETE { */ +/* OBSOLETE register int datum; */ +/* OBSOLETE register unsigned int regaddr; */ +/* OBSOLETE int reg_buf[NUM_REGS+1]; */ +/* OBSOLETE struct user u; */ +/* OBSOLETE register int skipped_frames = 0; */ +/* OBSOLETE */ +/* OBSOLETE registers_fetched (); */ +/* OBSOLETE */ +/* OBSOLETE for (regno = 0; regno < 64; regno++) { */ +/* OBSOLETE reg_buf[regno] = ptrace (3, inferior_pid, (PTRACE_ARG3_TYPE) regno, 0); */ +/* OBSOLETE */ +/* OBSOLETE #if defined(PYRAMID_CONTROL_FRAME_DEBUGGING) */ +/* OBSOLETE printf_unfiltered ("Fetching register %s, got %0x\n", */ +/* OBSOLETE REGISTER_NAME (regno), */ +/* OBSOLETE reg_buf[regno]); */ +/* OBSOLETE #endif /* PYRAMID_CONTROL_FRAME_DEBUGGING *x/ */ +/* OBSOLETE */ +/* OBSOLETE if (reg_buf[regno] == -1 && errno == EIO) { */ +/* OBSOLETE printf_unfiltered("fetch_interior_registers: fetching register %s\n", */ +/* OBSOLETE REGISTER_NAME (regno)); */ +/* OBSOLETE errno = 0; */ +/* OBSOLETE } */ +/* OBSOLETE supply_register (regno, reg_buf+regno); */ +/* OBSOLETE } */ +/* OBSOLETE /* that leaves regs 64, 65, and 66 *x/ */ +/* OBSOLETE datum = ptrace (3, inferior_pid, */ +/* OBSOLETE (PTRACE_ARG3_TYPE) (((char *)&u.u_pcb.pcb_csp) - */ +/* OBSOLETE ((char *)&u)), 0); */ +/* OBSOLETE */ +/* OBSOLETE */ +/* OBSOLETE */ +/* OBSOLETE /* FIXME: Find the Current Frame Pointer (CFP). CFP is a global */ +/* OBSOLETE register (ie, NOT windowed), that gets saved in a frame iff */ +/* OBSOLETE the code for that frame has a prologue (ie, "adsf N"). If */ +/* OBSOLETE there is a prologue, the adsf insn saves the old cfp in */ +/* OBSOLETE pr13, cfp is set to sp, and N bytes of locals are allocated */ +/* OBSOLETE (sp is decremented by n). */ +/* OBSOLETE This makes finding CFP hard. I guess the right way to do it */ +/* OBSOLETE is: */ +/* OBSOLETE - If this is the innermost frame, believe ptrace() or */ +/* OBSOLETE the core area. */ +/* OBSOLETE - Otherwise: */ +/* OBSOLETE Find the first insn of the current frame. */ +/* OBSOLETE - find the saved pc; */ +/* OBSOLETE - find the call insn that saved it; */ +/* OBSOLETE - figure out where the call is to; */ +/* OBSOLETE - if the first insn is an adsf, we got a frame */ +/* OBSOLETE pointer. *x/ */ +/* OBSOLETE */ +/* OBSOLETE */ +/* OBSOLETE /* Normal processors have separate stack pointers for user and */ +/* OBSOLETE kernel mode. Getting the last user mode frame on such */ +/* OBSOLETE machines is easy: the kernel context of the ptrace()'d */ +/* OBSOLETE process is on the kernel stack, and the USP points to what */ +/* OBSOLETE we want. But Pyramids only have a single cfp for both user and */ +/* OBSOLETE kernel mode. And processes being ptrace()'d have some */ +/* OBSOLETE kernel-context control frames on their stack. */ +/* OBSOLETE To avoid tracing back into the kernel context of an inferior, */ +/* OBSOLETE we skip 0 or more contiguous control frames where the pc is */ +/* OBSOLETE in the kernel. *x/ */ +/* OBSOLETE */ +/* OBSOLETE while (1) { */ +/* OBSOLETE register int inferior_saved_pc; */ +/* OBSOLETE inferior_saved_pc = ptrace (1, inferior_pid, */ +/* OBSOLETE (PTRACE_ARG3_TYPE) (datum+((32+15)*4)), 0); */ +/* OBSOLETE if (inferior_saved_pc > 0) break; */ +/* OBSOLETE #if defined(PYRAMID_CONTROL_FRAME_DEBUGGING) */ +/* OBSOLETE printf_unfiltered("skipping kernel frame %08x, pc=%08x\n", datum, */ +/* OBSOLETE inferior_saved_pc); */ +/* OBSOLETE #endif /* PYRAMID_CONTROL_FRAME_DEBUGGING *x/ */ +/* OBSOLETE skipped_frames++; */ +/* OBSOLETE datum -= CONTROL_STACK_FRAME_SIZE; */ +/* OBSOLETE } */ +/* OBSOLETE */ +/* OBSOLETE reg_buf[CSP_REGNUM] = datum; */ +/* OBSOLETE supply_register(CSP_REGNUM, reg_buf+CSP_REGNUM); */ +/* OBSOLETE #ifdef PYRAMID_CONTROL_FRAME_DEBUGGING */ +/* OBSOLETE if (skipped_frames) { */ +/* OBSOLETE fprintf_unfiltered (gdb_stderr, */ +/* OBSOLETE "skipped %d frames from %x to %x; cfp was %x, now %x\n", */ +/* OBSOLETE skipped_frames, reg_buf[CSP_REGNUM]); */ +/* OBSOLETE } */ +/* OBSOLETE #endif /* PYRAMID_CONTROL_FRAME_DEBUGGING *x/ */ +/* OBSOLETE } */ +/* OBSOLETE */ +/* OBSOLETE /* Store our register values back into the inferior. */ +/* OBSOLETE If REGNO is -1, do this for all registers. */ +/* OBSOLETE Otherwise, REGNO specifies which register (so we can save time). *x/ */ +/* OBSOLETE */ +/* OBSOLETE void */ +/* OBSOLETE store_inferior_registers (regno) */ +/* OBSOLETE int regno; */ +/* OBSOLETE { */ +/* OBSOLETE register unsigned int regaddr; */ +/* OBSOLETE char buf[80]; */ +/* OBSOLETE */ +/* OBSOLETE if (regno >= 0) */ +/* OBSOLETE { */ +/* OBSOLETE if ((0 <= regno) && (regno < 64)) { */ +/* OBSOLETE /*regaddr = register_addr (regno, offset);*x/ */ +/* OBSOLETE regaddr = regno; */ +/* OBSOLETE errno = 0; */ +/* OBSOLETE ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, */ +/* OBSOLETE read_register (regno)); */ +/* OBSOLETE if (errno != 0) */ +/* OBSOLETE { */ +/* OBSOLETE sprintf (buf, "writing register number %d", regno); */ +/* OBSOLETE perror_with_name (buf); */ +/* OBSOLETE } */ +/* OBSOLETE } */ +/* OBSOLETE } */ +/* OBSOLETE else */ +/* OBSOLETE { */ +/* OBSOLETE for (regno = 0; regno < NUM_REGS; regno++) */ +/* OBSOLETE { */ +/* OBSOLETE /*regaddr = register_addr (regno, offset);*x/ */ +/* OBSOLETE regaddr = regno; */ +/* OBSOLETE errno = 0; */ +/* OBSOLETE ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, */ +/* OBSOLETE read_register (regno)); */ +/* OBSOLETE if (errno != 0) */ +/* OBSOLETE { */ +/* OBSOLETE sprintf (buf, "writing all regs, number %d", regno); */ +/* OBSOLETE perror_with_name (buf); */ +/* OBSOLETE } */ +/* OBSOLETE } */ +/* OBSOLETE } */ +/* OBSOLETE */ +/* OBSOLETE /*** Extensions to core and dump files, for GDB. *x/ */ +/* OBSOLETE */ +/* OBSOLETE extern unsigned int last_frame_offset; */ +/* OBSOLETE */ +/* OBSOLETE #ifdef PYRAMID_CORE */ +/* OBSOLETE */ +/* OBSOLETE /* Can't make definitions here static, since corefile.c needs them */ +/* OBSOLETE to do bounds checking on the core-file areas. O well. *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* have two stacks: one for data, one for register windows. *x/ */ +/* OBSOLETE extern CORE_ADDR reg_stack_start; */ +/* OBSOLETE extern CORE_ADDR reg_stack_end; */ +/* OBSOLETE */ +/* OBSOLETE /* need this so we can find the global registers: they never get saved. *x/ */ +/* OBSOLETE CORE_ADDR global_reg_offset; */ +/* OBSOLETE static CORE_ADDR last_frame_address; */ +/* OBSOLETE CORE_ADDR last_frame_offset; */ +/* OBSOLETE */ +/* OBSOLETE */ +/* OBSOLETE /* Address in core file of start of register window stack area. */ +/* OBSOLETE Don't know if is this any of meaningful, useful or necessary. *x/ */ +/* OBSOLETE extern int reg_stack_offset; */ +/* OBSOLETE */ +/* OBSOLETE #endif /* PYRAMID_CORE *x/ */ +/* OBSOLETE */ +/* OBSOLETE */ +/* OBSOLETE /* Work with core dump and executable files, for GDB. */ +/* OBSOLETE This code would be in corefile.c if it weren't machine-dependent. *x/ */ +/* OBSOLETE */ +/* OBSOLETE void */ +/* OBSOLETE core_file_command (filename, from_tty) */ +/* OBSOLETE char *filename; */ +/* OBSOLETE int from_tty; */ +/* OBSOLETE { */ +/* OBSOLETE int val; */ +/* OBSOLETE */ +/* OBSOLETE /* Discard all vestiges of any previous core file */ +/* OBSOLETE and mark data and stack spaces as empty. *x/ */ +/* OBSOLETE */ +/* OBSOLETE if (corefile) */ +/* OBSOLETE free (corefile); */ +/* OBSOLETE corefile = 0; */ +/* OBSOLETE */ +/* OBSOLETE if (corechan >= 0) */ +/* OBSOLETE close (corechan); */ +/* OBSOLETE corechan = -1; */ +/* OBSOLETE */ +/* OBSOLETE data_start = 0; */ +/* OBSOLETE data_end = 0; */ +/* OBSOLETE stack_start = STACK_END_ADDR; */ +/* OBSOLETE stack_end = STACK_END_ADDR; */ +/* OBSOLETE */ +/* OBSOLETE #ifdef PYRAMID_CORE */ +/* OBSOLETE reg_stack_start = CONTROL_STACK_ADDR; */ +/* OBSOLETE reg_stack_end = CONTROL_STACK_ADDR; /* this isn't strictly true...*x/ */ +/* OBSOLETE #endif /* PYRAMID_CORE *x/ */ +/* OBSOLETE */ +/* OBSOLETE /* Now, if a new core file was specified, open it and digest it. *x/ */ +/* OBSOLETE */ +/* OBSOLETE if (filename) */ +/* OBSOLETE { */ +/* OBSOLETE filename = tilde_expand (filename); */ +/* OBSOLETE make_cleanup (free, filename); */ +/* OBSOLETE */ +/* OBSOLETE if (have_inferior_p ()) */ +/* OBSOLETE error ("To look at a core file, you must kill the program with \"kill\"."); */ +/* OBSOLETE corechan = open (filename, O_RDONLY, 0); */ +/* OBSOLETE if (corechan < 0) */ +/* OBSOLETE perror_with_name (filename); */ +/* OBSOLETE /* 4.2-style (and perhaps also sysV-style) core dump file. *x/ */ +/* OBSOLETE { */ +/* OBSOLETE struct user u; */ +/* OBSOLETE */ +/* OBSOLETE unsigned int reg_offset; */ +/* OBSOLETE */ +/* OBSOLETE val = myread (corechan, &u, sizeof u); */ +/* OBSOLETE if (val < 0) */ +/* OBSOLETE perror_with_name ("Not a core file: reading upage"); */ +/* OBSOLETE if (val != sizeof u) */ +/* OBSOLETE error ("Not a core file: could only read %d bytes", val); */ +/* OBSOLETE data_start = exec_data_start; */ +/* OBSOLETE */ +/* OBSOLETE data_end = data_start + NBPG * u.u_dsize; */ +/* OBSOLETE data_offset = NBPG * UPAGES; */ +/* OBSOLETE stack_offset = NBPG * (UPAGES + u.u_dsize); */ +/* OBSOLETE */ +/* OBSOLETE /* find registers in core file *x/ */ +/* OBSOLETE #ifdef PYRAMID_PTRACE */ +/* OBSOLETE stack_start = stack_end - NBPG * u.u_ussize; */ +/* OBSOLETE reg_stack_offset = stack_offset + (NBPG *u.u_ussize); */ +/* OBSOLETE reg_stack_end = reg_stack_start + NBPG * u.u_cssize; */ +/* OBSOLETE */ +/* OBSOLETE last_frame_address = ((int) u.u_pcb.pcb_csp); */ +/* OBSOLETE last_frame_offset = reg_stack_offset + last_frame_address */ +/* OBSOLETE - CONTROL_STACK_ADDR ; */ +/* OBSOLETE global_reg_offset = (char *)&u - (char *)&u.u_pcb.pcb_gr0 ; */ +/* OBSOLETE */ +/* OBSOLETE /* skip any control-stack frames that were executed in the */ +/* OBSOLETE kernel. *x/ */ +/* OBSOLETE */ +/* OBSOLETE while (1) { */ +/* OBSOLETE char buf[4]; */ +/* OBSOLETE val = lseek (corechan, last_frame_offset+(47*4), 0); */ +/* OBSOLETE if (val < 0) */ +/* OBSOLETE perror_with_name (filename); */ +/* OBSOLETE val = myread (corechan, buf, sizeof buf); */ +/* OBSOLETE if (val < 0) */ +/* OBSOLETE perror_with_name (filename); */ +/* OBSOLETE */ +/* OBSOLETE if (*(int *)buf >= 0) */ +/* OBSOLETE break; */ +/* OBSOLETE printf_unfiltered ("skipping frame %s\n", local_hex_string (last_frame_address)); */ +/* OBSOLETE last_frame_offset -= CONTROL_STACK_FRAME_SIZE; */ +/* OBSOLETE last_frame_address -= CONTROL_STACK_FRAME_SIZE; */ +/* OBSOLETE } */ +/* OBSOLETE reg_offset = last_frame_offset; */ +/* OBSOLETE */ +/* OBSOLETE #if 1 || defined(PYRAMID_CONTROL_FRAME_DEBUGGING) */ +/* OBSOLETE printf_unfiltered ("Control stack pointer = %s\n", */ +/* OBSOLETE local_hex_string (u.u_pcb.pcb_csp)); */ +/* OBSOLETE printf_unfiltered ("offset to control stack %d outermost frame %d (%s)\n", */ +/* OBSOLETE reg_stack_offset, reg_offset, local_hex_string (last_frame_address)); */ +/* OBSOLETE #endif /* PYRAMID_CONTROL_FRAME_DEBUGGING *x/ */ +/* OBSOLETE */ +/* OBSOLETE #else /* not PYRAMID_CORE *x/ */ +/* OBSOLETE stack_start = stack_end - NBPG * u.u_ssize; */ +/* OBSOLETE reg_offset = (int) u.u_ar0 - KERNEL_U_ADDR; */ +/* OBSOLETE #endif /* not PYRAMID_CORE *x/ */ +/* OBSOLETE */ +/* OBSOLETE #ifdef __not_on_pyr_yet */ +/* OBSOLETE /* Some machines put an absolute address in here and some put */ +/* OBSOLETE the offset in the upage of the regs. *x/ */ +/* OBSOLETE reg_offset = (int) u.u_ar0; */ +/* OBSOLETE if (reg_offset > NBPG * UPAGES) */ +/* OBSOLETE reg_offset -= KERNEL_U_ADDR; */ +/* OBSOLETE #endif */ +/* OBSOLETE */ +/* OBSOLETE /* I don't know where to find this info. */ +/* OBSOLETE So, for now, mark it as not available. *x/ */ +/* OBSOLETE N_SET_MAGIC (core_aouthdr, 0); */ +/* OBSOLETE */ +/* OBSOLETE /* Read the register values out of the core file and store */ +/* OBSOLETE them where `read_register' will find them. *x/ */ +/* OBSOLETE */ +/* OBSOLETE { */ +/* OBSOLETE register int regno; */ +/* OBSOLETE */ +/* OBSOLETE for (regno = 0; regno < 64; regno++) */ +/* OBSOLETE { */ +/* OBSOLETE char buf[MAX_REGISTER_RAW_SIZE]; */ +/* OBSOLETE */ +/* OBSOLETE val = lseek (corechan, register_addr (regno, reg_offset), 0); */ +/* OBSOLETE if (val < 0 */ +/* OBSOLETE || (val = myread (corechan, buf, sizeof buf)) < 0) */ +/* OBSOLETE { */ +/* OBSOLETE char * buffer = (char *) alloca (strlen (REGISTER_NAME (regno)) */ +/* OBSOLETE + 30); */ +/* OBSOLETE strcpy (buffer, "Reading register "); */ +/* OBSOLETE strcat (buffer, REGISTER_NAME (regno)); */ +/* OBSOLETE */ +/* OBSOLETE perror_with_name (buffer); */ +/* OBSOLETE } */ +/* OBSOLETE */ +/* OBSOLETE if (val < 0) */ +/* OBSOLETE perror_with_name (filename); */ +/* OBSOLETE #ifdef PYRAMID_CONTROL_FRAME_DEBUGGING */ +/* OBSOLETE printf_unfiltered ("[reg %s(%d), offset in file %s=0x%0x, addr =0x%0x, =%0x]\n", */ +/* OBSOLETE REGISTER_NAME (regno), regno, filename, */ +/* OBSOLETE register_addr(regno, reg_offset), */ +/* OBSOLETE regno * 4 + last_frame_address, */ +/* OBSOLETE *((int *)buf)); */ +/* OBSOLETE #endif /* PYRAMID_CONTROL_FRAME_DEBUGGING *x/ */ +/* OBSOLETE supply_register (regno, buf); */ +/* OBSOLETE } */ +/* OBSOLETE } */ +/* OBSOLETE } */ +/* OBSOLETE if (filename[0] == '/') */ +/* OBSOLETE corefile = savestring (filename, strlen (filename)); */ +/* OBSOLETE else */ +/* OBSOLETE { */ +/* OBSOLETE corefile = concat (current_directory, "/", filename, NULL); */ +/* OBSOLETE } */ +/* OBSOLETE */ +/* OBSOLETE #if 1 || defined(PYRAMID_CONTROL_FRAME_DEBUGGING) */ +/* OBSOLETE printf_unfiltered ("Providing CSP (%s) as nominal address of current frame.\n", */ +/* OBSOLETE local_hex_string(last_frame_address)); */ +/* OBSOLETE #endif PYRAMID_CONTROL_FRAME_DEBUGGING */ +/* OBSOLETE /* FIXME: Which of the following is correct? *x/ */ +/* OBSOLETE #if 0 */ +/* OBSOLETE set_current_frame ( create_new_frame (read_register (FP_REGNUM), */ +/* OBSOLETE read_pc ())); */ +/* OBSOLETE #else */ +/* OBSOLETE set_current_frame ( create_new_frame (last_frame_address, */ +/* OBSOLETE read_pc ())); */ +/* OBSOLETE #endif */ +/* OBSOLETE */ +/* OBSOLETE select_frame (get_current_frame (), 0); */ +/* OBSOLETE validate_files (); */ +/* OBSOLETE } */ +/* OBSOLETE else if (from_tty) */ +/* OBSOLETE printf_unfiltered ("No core file now.\n"); */ +/* OBSOLETE } */ diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index 5e5a1c5..f5aca89 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -167,6 +167,7 @@ extern struct target_ops mips_ops; extern struct target_ops pmon_ops; extern struct target_ops ddb_ops; +/* *INDENT-OFF* */ /* The MIPS remote debugging interface is built on top of a simple packet protocol. Each packet is organized as follows: @@ -230,6 +231,7 @@ extern struct target_ops ddb_ops; communicates with ASCII strings. Because of this, this implementation doesn't bother to handle the DLE quoting mechanism, since it will never be required. */ +/* *INDENT-ON* */ /* The SYN character which starts each packet. */ #define SYN '\026' @@ -523,19 +525,20 @@ mips_error (va_alist) ^x notation or in hex. */ static void -putc_readable (ch) +fputc_readable (ch, file) int ch; + struct gdb_file *file; { if (ch == '\n') - putchar_unfiltered ('\n'); + fputc_unfiltered ('\n', file); else if (ch == '\r') - printf_unfiltered ("\\r"); + fprintf_unfiltered (file, "\\r"); else if (ch < 0x20) /* ASCII control character */ - printf_unfiltered ("^%c", ch + '@'); + fprintf_unfiltered (file, "^%c", ch + '@'); else if (ch >= 0x7f) /* non-ASCII characters (rubout or greater) */ - printf_unfiltered ("[%02x]", ch & 0xff); + fprintf_unfiltered (file, "[%02x]", ch & 0xff); else - putchar_unfiltered (ch); + fputc_unfiltered (ch, file); } @@ -543,13 +546,14 @@ putc_readable (ch) ^x notation or in hex. */ static void -puts_readable (string) +fputs_readable (string, file) char *string; + struct gdb_file *file; { int c; while ((c = *string++) != '\0') - putc_readable (c); + fputc_readable (c, file); } @@ -566,9 +570,9 @@ mips_expect_timeout (string, timeout) if (remote_debug) { - printf_unfiltered ("Expected \""); - puts_readable (string); - printf_unfiltered ("\", got \""); + fprintf_unfiltered (gdb_stdlog, "Expected \""); + fputs_readable (string, gdb_stdlog); + fprintf_unfiltered (gdb_stdlog, "\", got \""); } immediate_quit = 1; @@ -584,12 +588,12 @@ mips_expect_timeout (string, timeout) if (c == SERIAL_TIMEOUT) { if (remote_debug) - printf_unfiltered ("\": FAIL\n"); + fprintf_unfiltered (gdb_stdlog, "\": FAIL\n"); return 0; } if (remote_debug) - putc_readable (c); + fputc_readable (c, gdb_stdlog); if (c == *p++) { @@ -597,7 +601,7 @@ mips_expect_timeout (string, timeout) { immediate_quit = 0; if (remote_debug) - printf_unfiltered ("\": OK\n"); + fprintf_unfiltered (gdb_stdlog, "\": OK\n"); return 1; } } @@ -699,9 +703,9 @@ mips_readchar (timeout) /* Don't use _filtered; we can't deal with a QUIT out of target_wait, and I think this might be called from there. */ if (ch != SERIAL_TIMEOUT) - printf_unfiltered ("Read '%c' %d 0x%x\n", ch, ch, ch); + fprintf_unfiltered (gdb_stdlog, "Read '%c' %d 0x%x\n", ch, ch, ch); else - printf_unfiltered ("Timed out in read\n"); + fprintf_unfiltered (gdb_stdlog, "Timed out in read\n"); } /* If we have seen mips_monitor_prompt and we either time out, or @@ -717,7 +721,7 @@ mips_readchar (timeout) if (remote_debug > 0) /* Don't use _filtered; we can't deal with a QUIT out of target_wait, and I think this might be called from there. */ - printf_unfiltered ("Reinitializing MIPS debugging mode\n"); + fprintf_unfiltered (gdb_stdlog, "Reinitializing MIPS debugging mode\n"); mips_need_reply = 0; mips_initialize (); @@ -771,8 +775,8 @@ mips_receive_header (hdr, pgarbage, ch, timeout) we can't deal with a QUIT out of target_wait. */ if (! mips_initializing || remote_debug > 0) { - putc_readable (ch); - gdb_flush (gdb_stdout); + fputc_readable (ch, gdb_stdlog); + gdb_flush (gdb_stdlog); } ++*pgarbage; @@ -907,7 +911,7 @@ mips_send_packet (s, get_ack) /* Don't use _filtered; we can't deal with a QUIT out of target_wait, and I think this might be called from there. */ packet[HDR_LENGTH + len + TRLR_LENGTH] = '\0'; - printf_unfiltered ("Writing \"%s\"\n", packet + 1); + fprintf_unfiltered (gdb_stdlog, "Writing \"%s\"\n", packet + 1); } if (SERIAL_WRITE (mips_desc, packet, @@ -997,8 +1001,8 @@ mips_send_packet (s, get_ack) trlr[TRLR_LENGTH] = '\0'; /* Don't use _filtered; we can't deal with a QUIT out of target_wait, and I think this might be called from there. */ - printf_unfiltered ("Got ack %d \"%s%s\"\n", - HDR_GET_SEQ (hdr), hdr + 1, trlr); + fprintf_unfiltered (gdb_stdlog, "Got ack %d \"%s%s\"\n", + HDR_GET_SEQ (hdr), hdr + 1, trlr); } /* If this ack is for the current packet, we're done. */ @@ -1074,7 +1078,7 @@ mips_receive_packet (buff, throw_error, timeout) /* Don't use _filtered; we can't deal with a QUIT out of target_wait, and I think this might be called from there. */ if (remote_debug > 0) - printf_unfiltered ("Ignoring unexpected ACK\n"); + fprintf_unfiltered (gdb_stdlog, "Ignoring unexpected ACK\n"); continue; } @@ -1104,8 +1108,9 @@ mips_receive_packet (buff, throw_error, timeout) /* Don't use _filtered; we can't deal with a QUIT out of target_wait, and I think this might be called from there. */ if (remote_debug > 0) - printf_unfiltered ("Got new SYN after %d chars (wanted %d)\n", - i, len); + fprintf_unfiltered (gdb_stdlog, + "Got new SYN after %d chars (wanted %d)\n", + i, len); continue; } @@ -1122,7 +1127,7 @@ mips_receive_packet (buff, throw_error, timeout) /* Don't use _filtered; we can't deal with a QUIT out of target_wait, and I think this might be called from there. */ if (remote_debug > 0) - printf_unfiltered ("Got SYN when wanted trailer\n"); + fprintf_unfiltered (gdb_stdlog, "Got SYN when wanted trailer\n"); continue; } @@ -1132,8 +1137,9 @@ mips_receive_packet (buff, throw_error, timeout) /* Don't use _filtered; we can't deal with a QUIT out of target_wait, and I think this might be called from there. */ if (remote_debug > 0) - printf_unfiltered ("Ignoring sequence number %d (want %d)\n", - HDR_GET_SEQ (hdr), mips_receive_seq); + fprintf_unfiltered (gdb_stdlog, + "Ignoring sequence number %d (want %d)\n", + HDR_GET_SEQ (hdr), mips_receive_seq); continue; } diff --git a/gdb/remote-os9k.c b/gdb/remote-os9k.c index 714400f..2abfa83 100644 --- a/gdb/remote-os9k.c +++ b/gdb/remote-os9k.c @@ -1,5 +1,5 @@ /* Remote debugging interface for boot monitors, for GDB. - Copyright 1990, 1991, 1992, 1993, 1999 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc. This file is part of GDB. @@ -40,19 +40,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "gdbcore.h" #include "target.h" #include "wait.h" - #ifdef ANSI_PROTOTYPES #include <stdarg.h> #else #include <varargs.h> #endif -#ifdef HAVE_SYS_SELECT_H -#include <sys/select.h> -#endif #include <signal.h> -#include <sys/types.h> - #include "gdb_string.h" +#include <sys/types.h> #include "command.h" #include "serial.h" #include "monitor.h" diff --git a/gdb/remote-rdp.c b/gdb/remote-rdp.c index 1d596a4..7b979d2 100644 --- a/gdb/remote-rdp.c +++ b/gdb/remote-rdp.c @@ -186,7 +186,7 @@ get_byte () int c = SERIAL_READCHAR (io, timeout); if (remote_debug) - printf ("[%02x]\n", c); + fprintf_unfiltered (gdb_stdlog, "[%02x]\n", c); if (c == SERIAL_TIMEOUT) { @@ -220,7 +220,7 @@ put_byte (val) char val; { if (remote_debug) - printf ("(%02x)\n", val); + fprintf_unfiltered (gdb_stdlog, "(%02x)\n", val); SERIAL_WRITE (io, &val, 1); } @@ -236,7 +236,7 @@ put_word (val) b[3] = val >> 24; if (remote_debug) - printf ("(%04x)", val); + fprintf_unfiltered (gdb_stdlog, "(%04x)", val); SERIAL_WRITE (io, b, 4); } @@ -314,7 +314,7 @@ rdp_init (cold, tty) while (!sync && (restype = SERIAL_READCHAR (io, 1)) > 0) { if (remote_debug) - printf_unfiltered ("[%02x]\n", restype); + fprintf_unfiltered (gdb_stdlog, "[%02x]\n", restype); switch (restype) { @@ -349,7 +349,7 @@ rdp_init (cold, tty) int resval = SERIAL_READCHAR (io, 1); if (remote_debug) - printf_unfiltered ("[%02x]\n", resval); + fprintf_unfiltered (gdb_stdlog, "[%02x]\n", resval); switch (resval) { diff --git a/gdb/remote-sds.c b/gdb/remote-sds.c index 74a8680..013b06b 100644 --- a/gdb/remote-sds.c +++ b/gdb/remote-sds.c @@ -394,7 +394,7 @@ sds_interrupt (signo) signal (signo, sds_interrupt_twice); if (remote_debug) - printf_unfiltered ("sds_interrupt called\n"); + fprintf_unfiltered (gdb_stdlog, "sds_interrupt called\n"); buf[0] = 25; sds_send (buf, 1); @@ -471,7 +471,7 @@ sds_wait (pid, status) retlen = sds_send (buf, 1); if (remote_debug) { - fprintf_unfiltered (gdb_stderr, "Signals: %02x%02x %02x %02x\n", + fprintf_unfiltered (gdb_stdlog, "Signals: %02x%02x %02x %02x\n", buf[0], buf[1], buf[2], buf[3]); } @@ -723,7 +723,7 @@ readchar (timeout) ch = SERIAL_READCHAR (sds_desc, timeout); if (remote_debug > 1 && ch >= 0) - printf_unfiltered("%c(%x)", ch, ch); + fprintf_unfiltered (gdb_stdlog, "%c(%x)", ch, ch); switch (ch) { @@ -791,10 +791,10 @@ putmessage (buf, len) if (remote_debug) { - fprintf_unfiltered (gdb_stderr, "Message to send: \""); + fprintf_unfiltered (gdb_stdlog, "Message to send: \""); for (i = 0; i < len; ++i) - fprintf_unfiltered (gdb_stderr, "%02x", buf[i]); - fprintf_unfiltered (gdb_stderr, "\"\n"); + fprintf_unfiltered (gdb_stdlog, "%02x", buf[i]); + fprintf_unfiltered (gdb_stdlog, "\"\n"); } p = buf2; @@ -835,10 +835,11 @@ putmessage (buf, len) if (remote_debug) { *p = '\0'; - printf_unfiltered ("Sending encoded: \"%s\"", buf2); - printf_unfiltered (" (Checksum %d, id %d, length %d)\n", - header[0], header[1], header[2]); - gdb_flush (gdb_stdout); + fprintf_unfiltered (gdb_stdlog, "Sending encoded: \"%s\"", buf2); + fprintf_unfiltered (gdb_stdlog, + " (Checksum %d, id %d, length %d)\n", + header[0], header[1], header[2]); + gdb_flush (gdb_stdlog); } if (SERIAL_WRITE (sds_desc, buf2, p - buf2)) perror_with_name ("putmessage: write failed"); @@ -869,11 +870,12 @@ read_frame (buf) { case SERIAL_TIMEOUT: if (remote_debug) - puts_filtered ("Timeout in mid-message, retrying\n"); + fputs_filtered ("Timeout in mid-message, retrying\n", gdb_stdlog); return 0; case '$': if (remote_debug) - puts_filtered ("Saw new packet start in middle of old one\n"); + fputs_filtered ("Saw new packet start in middle of old one\n", + gdb_stdlog); return 0; /* Start a new packet, count retries */ case '\r': break; @@ -882,7 +884,7 @@ read_frame (buf) { *bp = '\000'; if (remote_debug) - fprintf_unfiltered (gdb_stderr, "Received encoded: \"%s\"\n", + fprintf_unfiltered (gdb_stdlog, "Received encoded: \"%s\"\n", buf); return 1; } @@ -955,7 +957,7 @@ getmessage (buf, forever) error ("Watchdog has expired. Target detached.\n"); } if (remote_debug) - puts_filtered ("Timed out.\n"); + fputs_filtered ("Timed out.\n", gdb_stdlog); goto retry; } } @@ -970,7 +972,7 @@ getmessage (buf, forever) c2 = readchar (timeout); c3 = readchar (timeout); if (remote_debug) - fprintf_unfiltered (gdb_stderr, "Trigraph %c%c%c received\n", + fprintf_unfiltered (gdb_stdlog, "Trigraph %c%c%c received\n", c, c2, c3); if (c3 == '+') { @@ -1004,15 +1006,15 @@ getmessage (buf, forever) if (remote_debug) { - fprintf_unfiltered (gdb_stderr, + fprintf_unfiltered (gdb_stdlog, "... (Got checksum %d, id %d, length %d)\n", header[0], header[1], header[2]); - fprintf_unfiltered (gdb_stderr, "Message received: \""); + fprintf_unfiltered (gdb_stdlog, "Message received: \""); for (i = 0; i < len; ++i) { - fprintf_unfiltered (gdb_stderr, "%02x", (unsigned char) buf[i]); + fprintf_unfiltered (gdb_stdlog, "%02x", (unsigned char) buf[i]); } - fprintf_unfiltered (gdb_stderr, "\"\n"); + fprintf_unfiltered (gdb_stdlog, "\"\n"); } /* no ack required? */ diff --git a/gdb/remote-st.c b/gdb/remote-st.c index 108fa96..1efdbfa 100644 --- a/gdb/remote-st.c +++ b/gdb/remote-st.c @@ -1,5 +1,5 @@ /* Remote debugging interface for Tandem ST2000 phone switch, for GDB. - Copyright 1990, 1991, 1992, 1999 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992 Free Software Foundation, Inc. Contributed by Cygnus Support. Written by Jim Kingdon for Cygnus. This file is part of GDB. @@ -38,19 +38,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "gdbcore.h" #include "target.h" #include "wait.h" - #ifdef ANSI_PROTOTYPES #include <stdarg.h> #else #include <varargs.h> #endif -#ifdef HAVE_SYS_SELECT_H -#include <sys/select.h> -#endif #include <signal.h> -#include <sys/types.h> - #include "gdb_string.h" +#include <sys/types.h> #include "serial.h" extern struct target_ops st2000_ops; /* Forward declaration */ diff --git a/gdb/remote-udi.c b/gdb/remote-udi.c index 6397bca..30bbfb9 100644 --- a/gdb/remote-udi.c +++ b/gdb/remote-udi.c @@ -750,10 +750,12 @@ int regno; if (remote_debug) { - printf_unfiltered("Fetching all registers\n"); - printf_unfiltered("Fetching PC0 = 0x%x, PC1 = 0x%x, PC2 = 0x%x\n", - read_register(NPC_REGNUM), read_register(PC_REGNUM), - read_register(PC2_REGNUM)); + fprintf_unfiltered (gdb_stdlog, "Fetching all registers\n"); + fprintf_unfiltered (gdb_stdlog, + "Fetching PC0 = 0x%x, PC1 = 0x%x, PC2 = 0x%x\n", + read_register (NPC_REGNUM), + read_register (PC_REGNUM), + read_register (PC2_REGNUM)); } /* There doesn't seem to be any way to get these. */ @@ -791,9 +793,12 @@ int regno; if (remote_debug) { - printf_unfiltered("Storing all registers\n"); - printf_unfiltered("PC0 = 0x%x, PC1 = 0x%x, PC2 = 0x%x\n", read_register(NPC_REGNUM), - read_register(PC_REGNUM), read_register(PC2_REGNUM)); + fprintf_unfiltered (gdb_stdlog, "Storing all registers\n"); + fprintf_unfiltered (gdb_stdlog, + "PC0 = 0x%x, PC1 = 0x%x, PC2 = 0x%x\n", + read_register (NPC_REGNUM), + read_register (PC_REGNUM), + read_register (PC2_REGNUM)); } /* Gr1/rsp */ @@ -1450,7 +1455,8 @@ fetch_register (regno) supply_register(regno, (char *) &To); if (remote_debug) - printf_unfiltered("Fetching register %s = 0x%x\n", REGISTER_NAME (regno), To); + fprintf_unfiltered (gdb_stdlog, "Fetching register %s = 0x%x\n", + REGISTER_NAME (regno), To); } /*****************************************************************************/ /* Store a single register indicated by 'regno'. @@ -1471,7 +1477,8 @@ store_register (regno) From = read_register (regno); /* get data value */ if (remote_debug) - printf_unfiltered("Storing register %s = 0x%x\n", REGISTER_NAME (regno), From); + fprintf_unfiltered (gdb_stdlog, "Storing register %s = 0x%x\n", + REGISTER_NAME (regno), From); if (regno == GR1_REGNUM) { diff --git a/gdb/remote.c b/gdb/remote.c index a88194c..fd9e902 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* *INDENT-OFF* */ /* Remote communication protocol. A debug packet whose contents are <data> @@ -195,6 +196,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ So "0* " means the same as "0000". */ +/* *INDENT-ON* */ #include "defs.h" #include "gdb_string.h" @@ -215,14 +217,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "dcache.h" #include <ctype.h> +#include <sys/time.h> #ifdef USG #include <sys/types.h> #endif -#ifdef HAVE_SYS_SELECT_H -#include <sys/select.h> -#endif - #include "event-loop.h" #include <signal.h> diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c index 86c7f5a..e6443a0 100644 --- a/gdb/ser-tcp.c +++ b/gdb/ser-tcp.c @@ -1,5 +1,5 @@ /* Serial interface for raw TCP connections on Un*x like systems - Copyright 1992, 1993, 1998, 1999 Free Software Foundation, Inc. + Copyright 1992, 1993, 1998 Free Software Foundation, Inc. This file is part of GDB. @@ -33,10 +33,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <netinet/tcp.h> #endif -#ifdef HAVE_SYS_SELECT_H -#include <sys/select.h> -#endif - #include "signals.h" #include "gdb_string.h" diff --git a/gdb/ser-unix.c b/gdb/ser-unix.c index 50f2806..dc5236f 100644 --- a/gdb/ser-unix.c +++ b/gdb/ser-unix.c @@ -1,5 +1,5 @@ /* Serial interface for local (hardwired) serial ports on Un*x like systems - Copyright 1992, 1993, 1994, 1998, 1999 Free Software Foundation, Inc. + Copyright 1992, 1993, 1994, 1998 Free Software Foundation, Inc. This file is part of GDB. @@ -26,10 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <unistd.h> #endif -#ifdef HAVE_SYS_SELECT_H -#include <sys/select.h> -#endif - #ifdef HAVE_TERMIOS struct hardwire_ttystate diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index fa0ecb8..49df334 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -38,6 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* A set of original names, to be used when restoring back to generic registers from a specific set. */ +/* *INDENT-OFF* */ static char *sh_generic_reg_names[] = { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", @@ -85,6 +86,7 @@ static char *sh3e_reg_names[] = { "r0b0", "r1b0", "r2b0", "r3b0", "r4b0", "r5b0", "r6b0", "r7b0", "r0b1", "r1b1", "r2b1", "r3b1", "r4b1", "r5b1", "r6b1", "r7b1", }; +/* *INDENT-ON* */ char **sh_register_names = sh_generic_reg_names; diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 7a1abf8..f31878f 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -1283,6 +1283,7 @@ sunos4_skip_trampoline_code (pc) #ifdef USE_PROC_FS /* Target dependent support for /proc */ +/* *INDENT-OFF* */ /* The /proc interface divides the target machine's register set up into two different sets, the general register set (gregset) and the floating point register set (fpregset). For each set, there is an ioctl to get @@ -1318,6 +1319,7 @@ sunos4_skip_trampoline_code (pc) fpregset_t formatted data. */ +/* *INDENT-ON* */ /* Given a pointer to a general register set in /proc format (gregset_t *), unpack the register contents and supply them as gdb's idea of the current diff --git a/gdb/sparcl-tdep.c b/gdb/sparcl-tdep.c index 4c8ff97..e39bf30 100644 --- a/gdb/sparcl-tdep.c +++ b/gdb/sparcl-tdep.c @@ -1,5 +1,5 @@ /* Target dependent code for the Fujitsu SPARClite for GDB, the GNU debugger. - Copyright 1994, 1995, 1996, 1999 Free Software Foundation, Inc. + Copyright 1994, 1995, 1996 Free Software Foundation, Inc. This file is part of GDB. @@ -24,10 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "serial.h" #include <sys/types.h> -#ifdef HAVE_SYS_SELECT_H -#include <sys/select.h> -#endif - #if (!defined(__GO32__) && !defined(_WIN32)) || defined(__CYGWIN32__) #define HAVE_SOCKETS #include <sys/time.h> diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 9e1217b..d8139ae 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -3574,6 +3574,7 @@ read_struct_fields (fip, pp, type, objfile) return 1; } +/* *INDENT-OFF* */ /* The stabs for C++ derived classes contain baseclass information which is marked by a '!' character after the total size. This function is called when we encounter the baseclass marker, and slurps up all the @@ -3597,6 +3598,7 @@ read_struct_fields (fip, pp, type, objfile) Type number of base class ____________________________________| Return 1 for success, 0 for (error-type-inducing) failure. */ +/* *INDENT-ON* */ static int read_baseclasses (fip, pp, type, objfile) diff --git a/gdb/target.c b/gdb/target.c index a9217d8..1c033bd 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -1182,6 +1182,7 @@ generic_mourn_inferior () /* This table must match in order and size the signals in enum target_signal in target.h. */ +/* *INDENT-OFF* */ static struct { char *name; char *string; @@ -1282,6 +1283,7 @@ static struct { /* Last entry, used to check whether the table is the right size. */ {NULL, "TARGET_SIGNAL_MAGIC"} }; +/* *INDENT-ON* */ /* Return the string for a signal. */ char * diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 6e53b67..1c56333 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,18 @@ +Wed Jul 7 00:27:35 1999 Andrew Cagney <cagney@amy.cygnus.com> + + * gdb.base/setvar.exp: Increase the time-out on tests indirectly + calling malloc. + * nodebug.exp, printcmds.exp, ptype.exp, setvar.exp: Ditto. + * ptype.exp: Move test for get_debug_format to before its first + use. + +1999-07-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com> + + * gdb.base/Makefile.in (EXECUTABLES): Remove annota2 executable. + * gdb.base/annota2.cc, annota2.exp: Move from here. + * gdb.c++/annota2.cc, annota2.exp: To here. + * gdb.c++/Makefile.in (PROGS): Add annota2 executable. + Tue Jun 29 11:56:06 1999 Andrew Cagney <cagney@b1.cygnus.com> * lib/gdb.exp (gdb_expect_list): Output one message per pattern in diff --git a/gdb/testsuite/gdb.base/Makefile.in b/gdb/testsuite/gdb.base/Makefile.in index 050ccc8..fbb7fe2 100644 --- a/gdb/testsuite/gdb.base/Makefile.in +++ b/gdb/testsuite/gdb.base/Makefile.in @@ -1,7 +1,7 @@ VPATH = @srcdir@ srcdir = @srcdir@ -EXECUTABLES = all-types annota1 annota2 bitfields break \ +EXECUTABLES = all-types annota1 bitfields break \ call-ar-st call-rt-st call-strs callfuncs callfuncs2 commands \ compiler condbreak constvars coremaker display \ ending-run exprs funcargs int-type interrupt \ diff --git a/gdb/testsuite/gdb.base/nodebug.exp b/gdb/testsuite/gdb.base/nodebug.exp index 684476e..d883272 100644 --- a/gdb/testsuite/gdb.base/nodebug.exp +++ b/gdb/testsuite/gdb.base/nodebug.exp @@ -164,6 +164,9 @@ if [runto inner] then { timeout { fail "(timeout) p/c array_index" } } } else { + # We need to up this because this can be really slow on some boards. + # (malloc() is called as part of the test). + set timeout 60; gdb_test {p/c array_index("abcdef",2)} " = 99 'c'" } } diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp index 4953ec5..cdbe56c 100644 --- a/gdb/testsuite/gdb.base/printcmds.exp +++ b/gdb/testsuite/gdb.base/printcmds.exp @@ -598,6 +598,10 @@ proc test_print_string_constants {} { return } + # We need to up this because this can be really slow on some boards. + # (Test may involve inferior malloc() calls). + set timeout 60; + setup_xfail "a29k-*-udi" 2416 gdb_test "p \"a string\"" " = \"a string\"" setup_xfail "a29k-*-udi" 2416 @@ -628,6 +632,10 @@ proc test_print_array_constants {} { return } + # We need to up this because this can be really slow on some boards. + # (Test may involve inferior malloc() calls). + set timeout 60; + setup_xfail "a29k-*-udi" 2416 gdb_test "print {'a','b','c'}" " = \"abc\"" setup_xfail "a29k-*-udi" 2416 diff --git a/gdb/testsuite/gdb.base/ptype.exp b/gdb/testsuite/gdb.base/ptype.exp index 98d4586..d36efec 100644 --- a/gdb/testsuite/gdb.base/ptype.exp +++ b/gdb/testsuite/gdb.base/ptype.exp @@ -131,6 +131,7 @@ gdb_test "ptype boolean" "type = enum (boolean |)\{FALSE, TRUE\}.*" "ptype unnam if {!$gcc_compiled && !$hp_aCC_compiler} { setup_xfail "rs6000-*-*" "i*86-*-sysv4*" "hppa*-*-*" # CLLbs14773 } +get_debug_format setup_xfail_format "DWARF 1" gdb_test "whatis v_boolean" "type = (enum |)boolean" \ "whatis unnamed typedef'd enum (compiler bug in IBM's xlc)" @@ -530,13 +531,16 @@ gdb_test "ptype nested_su.inner_union_instance" "type = union ${outer}inner_unio if [runto_main] then { - get_debug_format if [target_info exists gdb,cannot_call_functions] { setup_xfail "*-*-*" 2416 fail "This target can not call functions" continue } + # We need to up this because this can be really slow on some boards. + # (malloc() is called as part of the test). + set timeout 60; + gdb_test "ptype \"abc\"" "type = char \\\[4\\\]" gdb_test "ptype {'a','b','c'}" "type = char \\\[3\\\]" gdb_test "ptype {0,1,2}" "type = int \\\[3\\\]" diff --git a/gdb/testsuite/gdb.base/setvar.exp b/gdb/testsuite/gdb.base/setvar.exp index e7d31dc..ec217cf 100644 --- a/gdb/testsuite/gdb.base/setvar.exp +++ b/gdb/testsuite/gdb.base/setvar.exp @@ -396,6 +396,9 @@ if [target_info exists gdb,cannot_call_functions] { fail "set variable v_struct1 = {32, 33, 34, 35, 36, 37}" continue } +# We need to up this because this can be really slow on some boards. +# (malloc() is called as part of the test). +set timeout 60; gdb_test "set variable v_struct1 = {32, 33, 34, 35, 36, 37}" "Invalid.*" # And after the error the structure should be unchanged. diff --git a/gdb/testsuite/gdb.c++/Makefile.in b/gdb/testsuite/gdb.c++/Makefile.in index 13a1234..5efba8d 100644 --- a/gdb/testsuite/gdb.c++/Makefile.in +++ b/gdb/testsuite/gdb.c++/Makefile.in @@ -1,7 +1,7 @@ VPATH = @srcdir@ srcdir = @srcdir@ -PROGS = anon-union compiler cplusfuncs derivation inherit local \ +PROGS = annota2 anon-union compiler cplusfuncs derivation inherit local \ member-ptr method misc \ overload ovldbreak ref-types ref-types2 templates userdef virtfunc diff --git a/gdb/utils.c b/gdb/utils.c index 26f05a7..0e7c823 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -2251,16 +2251,16 @@ puts_debug (prefix, string, suffix) and the new prefix. */ if ((return_p || (strcmp(prev_prefix, prefix) != 0)) && !new_line) { - fputs_unfiltered (prev_suffix, gdb_stderr); - fputs_unfiltered ("\n", gdb_stderr); - fputs_unfiltered (prefix, gdb_stderr); + fputs_unfiltered (prev_suffix, gdb_stdlog); + fputs_unfiltered ("\n", gdb_stdlog); + fputs_unfiltered (prefix, gdb_stdlog); } /* Print prefix if we printed a newline during the previous call. */ if (new_line) { new_line = 0; - fputs_unfiltered (prefix, gdb_stderr); + fputs_unfiltered (prefix, gdb_stdlog); } prev_prefix = prefix; @@ -2273,20 +2273,20 @@ puts_debug (prefix, string, suffix) { default: if (isprint (ch)) - fputc_unfiltered (ch, gdb_stderr); + fputc_unfiltered (ch, gdb_stdlog); else - fprintf_unfiltered (gdb_stderr, "\\x%02x", ch & 0xff); + fprintf_unfiltered (gdb_stdlog, "\\x%02x", ch & 0xff); break; - case '\\': fputs_unfiltered ("\\\\", gdb_stderr); break; - case '\b': fputs_unfiltered ("\\b", gdb_stderr); break; - case '\f': fputs_unfiltered ("\\f", gdb_stderr); break; + case '\\': fputs_unfiltered ("\\\\", gdb_stdlog); break; + case '\b': fputs_unfiltered ("\\b", gdb_stdlog); break; + case '\f': fputs_unfiltered ("\\f", gdb_stdlog); break; case '\n': new_line = 1; - fputs_unfiltered ("\\n", gdb_stderr); break; - case '\r': fputs_unfiltered ("\\r", gdb_stderr); break; - case '\t': fputs_unfiltered ("\\t", gdb_stderr); break; - case '\v': fputs_unfiltered ("\\v", gdb_stderr); break; + fputs_unfiltered ("\\n", gdb_stdlog); break; + case '\r': fputs_unfiltered ("\\r", gdb_stdlog); break; + case '\t': fputs_unfiltered ("\\t", gdb_stdlog); break; + case '\v': fputs_unfiltered ("\\v", gdb_stdlog); break; } return_p = ch == '\r'; @@ -2295,8 +2295,8 @@ puts_debug (prefix, string, suffix) /* Print suffix if we printed a newline. */ if (new_line) { - fputs_unfiltered (suffix, gdb_stderr); - fputs_unfiltered ("\n", gdb_stderr); + fputs_unfiltered (suffix, gdb_stdlog); + fputs_unfiltered ("\n", gdb_stdlog); } } diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 0cf9371..f5f2670 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -353,6 +353,7 @@ struct pending_stabs **stabvector; #endif +/* *INDENT-OFF* */ /* Linenos are processed on a file-by-file basis. Two reasons: @@ -404,6 +405,7 @@ struct pending_stabs **stabvector; on when we come the end of the compilation unit. Include table (inclTable) and process_linenos() handle that. */ +/* *INDENT-ON* */ /* compare line table entry addresses. */ diff --git a/gdb/xmodem.c b/gdb/xmodem.c index dd13b87..d4faa42 100644 --- a/gdb/xmodem.c +++ b/gdb/xmodem.c @@ -44,7 +44,7 @@ readchar (desc, timeout) c = SERIAL_READCHAR (desc, timeout); if (remote_debug > 0) - fputc_unfiltered (c, gdb_stderr); + fputc_unfiltered (c, gdb_stdlog); if (c >= 0) return c; |