-/* Parameters for target machine of Sun 4, for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
+/* Target machine sub-parameters for SPARC, for GDB, the GNU debugger.
+ This is included by other tm-*.h files to define SPARC cpu-related info.
+ Copyright 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@mcc.com)
+
This file is part of GDB.
-GDB is free software; you can redistribute it and/or modify
+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 1, or (at your option)
-any later version.
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
-GDB is distributed in the hope that it will be useful,
+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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define TARGET_BYTE_ORDER BIG_ENDIAN
/* Floating point is IEEE compatible. */
#define IEEE_FLOAT
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#define NAMES_HAVE_UNDERSCORE
-
-/* Debugger information will be in DBX format. */
-
-#define READ_DBX_FORMAT
-
/* When passing a structure to a function, Sun cc passes the address
in a register, not the structure itself. It (under SunOS4) creates
two symbols, so we get a LOC_ARG saying the address is on the stack
#define FUNCTION_START_OFFSET 0
/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
+ to reach some "real" code. SKIP_PROLOGUE_FRAMELESS_P advances
+ the PC past some of the prologue, but stops as soon as it
+ knows that the function has a frame. Its result is equal
+ to its input PC if the function is frameless, unequal otherwise. */
#define SKIP_PROLOGUE(pc) \
- { pc = skip_prologue (pc); }
+ { pc = skip_prologue (pc, 0); }
+#define SKIP_PROLOGUE_FRAMELESS_P(pc) \
+ { pc = skip_prologue (pc, 1); }
extern CORE_ADDR skip_prologue ();
/* Immediately after a function call, return the saved pc.
encodes the structure size being returned. If we detect such
a fake insn, step past it. */
-#define PC_ADJUST(pc) ((read_memory_integer (pc + 8, 4) & 0xfffffe00) == 0 ? \
- pc+12 : pc+8)
+#define PC_ADJUST(pc) sparc_pc_adjust(pc)
+extern CORE_ADDR sparc_pc_adjust();
#define SAVED_PC_AFTER_CALL(frame) PC_ADJUST (read_register (RP_REGNUM))
-/* Address of the end of stack space. We get this from the system
- include files. */
-#include <sys/types.h>
-#include <machine/vmparam.h>
-#define STACK_END_ADDR USRSTACK
+/* Stack grows downward. */
#define INNER_THAN <
"f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \
"f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \
\
- "y", "psr", "wim", "tbr", "pc", "npc", "fpsr", "cpsr" };
+ "y", "psr", "wim", "tbr", "pc", "npc", "fpsr", "cpsr" }
/* Register numbers of various important registers.
Note that some of these values are "real" register numbers,
to virtual format for register REGNUM. */
#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
-{ bcopy ((FROM), (TO), 4); }
+{ memcpy ((TO), (FROM), 4); }
/* Convert data from virtual format for register REGNUM
to raw format for register REGNUM. */
#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
-{ bcopy ((FROM), (TO), 4); }
+{ memcpy ((TO), (FROM), 4); }
/* Return the GDB type object for the "standard" data type
of data in register N. */
{ \
if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
{ \
- bcopy (((int *)(REGBUF))+FP0_REGNUM, \
- (VALBUF), TYPE_LENGTH(TYPE)); \
+ memcpy ((VALBUF), ((int *)(REGBUF))+FP0_REGNUM, TYPE_LENGTH(TYPE));\
} \
else \
- bcopy (((int *)(REGBUF))+8, (VALBUF), TYPE_LENGTH (TYPE)); \
+ memcpy ((VALBUF), \
+ (char *)(REGBUF) + 4 * 8 + \
+ (TYPE_LENGTH(TYPE) >= 4 ? 0 : 4 - TYPE_LENGTH(TYPE)), \
+ TYPE_LENGTH(TYPE)); \
}
/* Write into appropriate registers a function return value
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
(sparc_extract_struct_value_address (REGBUF))
-CORE_ADDR sparc_extract_struct_value_address (
-#ifdef __STDC__
- char [REGISTER_BYTES]
-#endif
- );
+
+extern CORE_ADDR
+sparc_extract_struct_value_address PARAMS ((char [REGISTER_BYTES]));
\f
/* Describe the pointer in each stack frame to the previous stack frame
(its caller). */
-/* If you're not compiling this on a sun, you'll have to get a copy
- of <sun4/reg.h> (also known as <machine/reg.h>). */
-#include <sun4/reg.h>
-
/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address
- and produces the nominal address of the caller frame.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller.
- In that case, FRAME_CHAIN_COMBINE is not used. */
+ and produces the frame's chain-pointer. */
/* In the case of the Sun 4, the frame-chain's nominal address
is held in the frame pointer register.
Otherwise the bottom of this frame is the top of the next frame. */
#define EXTRA_FRAME_INFO FRAME_ADDR bottom;
-#define INIT_EXTRA_FRAME_INFO(fci) \
+#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \
(fci)->bottom = \
((fci)->next ? \
((fci)->frame == (fci)->next_frame ? \
#define FRAME_CHAIN(thisframe) (sparc_frame_chain (thisframe))
CORE_ADDR sparc_frame_chain ();
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
-
-#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain)
-
/* Define other aspects of the stack frame. */
/* A macro that tells us whether the function invocation represented
/* We need two arguments (in general) to the "info frame" command.
Note that the definition of this macro implies that there exists a
- function "setup_arbitrary_frame" in mach-dep.c */
+ function "setup_arbitrary_frame" in sparc-tdep.c */
#define FRAME_SPECIFICATION_DYADIC
print_floating (doublereg, builtin_type_double, stdout); \
} \
}
-